-
Notifications
You must be signed in to change notification settings - Fork 43
genesis: Makes account balances format consistent across networks #73
genesis: Makes account balances format consistent across networks #73
Conversation
mind note: I should add conformance tests to ensure new files adhere to hex. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, thanks very much Everton!
@@ -3,5 +3,5 @@ | |||
"0x0000000000000000000000000000000000000002": "0x1", | |||
"0x0000000000000000000000000000000000000003": "0x1", | |||
"0x0000000000000000000000000000000000000004": "0x1", | |||
"0x00521965e7bd230323c423d96c657db5b79d099f": "1606938044258990275541962092341162602522202993782792835301376" | |||
"0x00521965e7bd230323c423d96c657db5b79d099f": "0x100000000000000000000000000000000000000000000000000" | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mainnet file comment (no way to attach found due to file size):
Consistency checks, addition/deletion number stays the same, random value tests (full text searches), genesis block hash test execution from Everton.
Looks good.
"0x00000000000000000000000000000000000000fd": "0x0", | ||
"0x00000000000000000000000000000000000000fe": "0x0", | ||
"0x00000000000000000000000000000000000000ff": "0x0", | ||
"0x874b54a8bd152966d63f706bae1ffeb0411921e5": "0xc9f2c9cd04674edea40000000" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, number of "1" -> "0x1" balances stayed the same, single more funded account moved to bottom.
This PR converts all balances from decimal to hex. Ordering shouldn't matter and the diff got rather impossible to review manually — but the tests cover that.
I put this gist up for whoever wants to audit the process of data gathering and transformation. It was fun learning to use jq to manipulate json content 😄
To test:
npm run dist
ethereumjs-vm/node_modules/ethereumjs-common
npm run build:dist && tape './tests/api/state/stateManager.js'
This test ensures genesis block hash matches state root for each chain (example).
Related: ethereumjs/ethereumjs-monorepo#589
Closes #35.