-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Perform native contract initialization for the set of hardforks #3202
Conversation
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 good to me, @shargon
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.
The logic looks good now, let me test it on mainnet and custom privnet.
Something has happened with the
|
// If is not configured, the Genesis is the a initialized block | ||
if (index == 0 && ActiveIn is null) | ||
{ | ||
hardforks = hfs.ToArray(); |
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.
hardforks = hfs.ToArray(); | |
hardforks = []; |
Plus move this above the if
statement above it; line:90
.
Co-authored-by: Anna Shaleva <[email protected]>
looks like Neo receive all the hardforks, but it need null :S |
…into core-close-3200
@shargon @AnnaShaleva is it just for this PR? The |
yes, but it's because without null, neo contract is not initialized in out tests |
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.
With these suggestions this code works as expected even in case of multiple hardforks being enabled at the same height. Also, with these suggestions unit tests are passed and genesis state matches the expected one (I've checked both genesis storage changes and notifications against NeoGo).
Co-authored-by: Anna Shaleva <[email protected]>
Co-authored-by: Anna Shaleva <[email protected]>
Co-authored-by: Anna Shaleva <[email protected]>
According to new logic, an empty set of hard-forks will be returned in case of genesis initialization with all hardforks disabled. Ref. #3202 (comment). Signed-off-by: Anna Shaleva <[email protected]>
@shargon, I've fixed the test, please, see the last commit. Now all tests are passing and the logic works as expected. Let's review this PR one more time (if needed) and merge, we need to include it into 3.7. |
I will test here as well. |
Close #3200