nearcore
nearcore copied to clipboard
Genesis has no canonical hash
#3470 needs genesis hash to detect if someone's trying to restart the node with a changed genesis (and disallows that). #3474 needs peers to agree on genesis. Currently genesis uses JSON format, and we permit any JSON representation as well as starting from genesis split into two files.
#3470 uses sha256(serde_json_pretty(parsed genesis))
as hash, but it's not ideal because serde can't guarantee it won't change on upgrade.
for #3474 we need some hash that will be the same across different nodes and versions.
We can either use borsh (would need to make all types borsh-able), or the hash of the original input json (would mean that there is one canonical genesis.json, and reformatting it or splitting into 2 files puts you on a different network).
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
George Milescu commented:
Once https://nearinc.atlassian.net/browse/ND-28 gets fixed, #ND-29 will be addresses as well.