nearcore icon indicating copy to clipboard operation
nearcore copied to clipboard

Genesis has no canonical hash

Open mikhailOK opened this issue 4 years ago • 2 comments

#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).

mikhailOK avatar Oct 09 '20 00:10 mikhailOK

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.

stale[bot] avatar Jul 01 '21 07:07 stale[bot]

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.

stale[bot] avatar Oct 04 '21 21:10 stale[bot]

George Milescu commented:

Once https://nearinc.atlassian.net/browse/ND-28 gets fixed, #ND-29 will be addresses as well.

exalate-issue-sync[bot] avatar Sep 06 '22 16:09 exalate-issue-sync[bot]