gballet / go-ethereum

Official Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
23 stars 13 forks source link

truncate large balances #521

Closed gballet closed 2 weeks ago

gballet commented 2 weeks ago

Large balances (>16 bytes) will overwrite the nonce in the basic data leaf. While this can not happen on mainnet, owing to the amount issued, it happens in devmode. This means the nonce will be overwritten with the balance, which is incorrect.

This PR truncates the balance if it's above that threshold.

gballet commented 2 weeks ago

As noted in dms, panicking would break devmode. So I'm merging this, and taking a note to modify the devmode in master so that it doesn't break.