Electrodeposition stability of metal electrodes