Transport-Controlled Deposition and Dissolution of Metals