-
Notifications
You must be signed in to change notification settings - Fork 43
Account addresses in genesisStates should be prefixed with '0x' #32
Comments
I think we should directly fix the addresses, should be doable with some clever search-and-replace. |
I think the real solution to this is really to stop this nonsense and be more strict in the utility functions in We should really put some dedicated thought into that, makes probably sense to do this along the |
What is with the values, there is also some hex-decimal mix on this. Just have checked, at least this is consistent along a separate chain genesis file (e.g. |
Yes, totally agree. Great example of where |
Since no one uses the genesisStates files yet, it's hard to make a judgment about if the values are working correctly. It's really up to the user of the genesisStates to properly handle the mixed types. I think there can be three possible types for account balances:
Until we switch to |
Closed by #33. |
Many of the addresses in the
alloc
field in the genesisStates json files aren't prefixed with0x
. This causes state roots computed from these files to be incorrect when usingethereumjs/merkle-patricia-tree
to load these states. The reason for this is that theTrie.prototype.put
function https://github.com/ethereumjs/merkle-patricia-tree/blob/master/src/baseTrie.js#L87) callsethUtil.toBuffer()
on the account address which treats the address as a plain string instead of a hex string if it's not prefix with a0x
.As a fix, we can either prefix all of the addresses with a
0x
in thealloc
field of each genesisStates file or modifygenesisStates/index.js
to programmatically add a '0x' prefix if its missing.The text was updated successfully, but these errors were encountered: