Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use genesis state to read network_id #1923

Merged
merged 2 commits into from
Dec 17, 2019

Conversation

foriequal0
Copy link
Contributor

NetworkId hasn't been changed, and cannot be changed, and the effect of changes are unknown. It is easier to pin down to the genesis state for now.

core/src/client/client.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@sgkim126 sgkim126 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use the genesis state instead of the latest state to read the network id?
They will be the same because changing network id is invalid for now.

@foriequal0
Copy link
Contributor Author

This PR is cherry-picked from #1892. There were RPCs that try to read network_id from the previous block's state when they are requested with a block. (Reading previous block's state was our idiom) They fail to read the network_id when they are requested with a block who is the same as the snapshot is taken. So I've pinned down them to read genesis state.

@majecty majecty merged commit bf129eb into CodeChain-io:master Dec 17, 2019
@foriequal0 foriequal0 deleted the feature/genesis_network_id branch December 17, 2019 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants