-
Notifications
You must be signed in to change notification settings - Fork 31
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
blockchain: make a genesis block according to forks #246
Conversation
ec909e9
to
8c57216
Compare
How about clearly indicating in the code that the code diff from this PR does not affect the production (test) environment and is for testing purposes? Or adding a link to this PR in the code? |
@shiki-tak |
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.
If I'm not mistaken, I don't see negative impact to other area by genesis block state changing. Also, this may be treated as correct modification
// If account.Code is nil and originalCode is not nil, | ||
// just update the code and don't change the other states | ||
if len(account.Code) != 0 && originalCode != nil { | ||
logger.Warn("this address already has a not nil code, now the code of this address has been changed", "addr", addr.String()) | ||
continue |
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.
Looks like this can be checked first before L316-322.
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.
I can't do that. I want to do continue after setting code if an original code exists.
Co-authored-by: Yunjong Jeong (ollie) <[email protected]>
Co-authored-by: murogari <[email protected]>
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.
LGTM
Proposed changes
This PR enables to make genesis blocks according to forks. This may have braking change in the case where the fork of genesis is Istanbul fork and after because this changes the state root of genesis by changing codeinfo of SCA (version 0 into version 1). But there is no effect against mainnet and testnet because the genesis doesn't have any forks. You can see the state roof of genesis doesn't change in this test.
This stores genesis accounts like bellow:
Types of changes
Please put an x in the boxes related to your change.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
I have read the CLA Document and I hereby sign the CLA
in first time contribute$ make test
)Related issues
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...