Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1524 +/- ##
===========================================
+ Coverage 80.31% 80.66% +0.35%
===========================================
Files 952 963 +11
Lines 17162 17656 +494
Branches 2599 2674 +75
===========================================
+ Hits 13784 14243 +459
- Misses 3373 3405 +32
- Partials 5 8 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
set_genesis_infowrites the genesis account to storage whenever it is missing, outside any commit, on every boot and every proposal.When the genesis leaves that account empty (snapshot genesis, or a premine of 0), the genesis block deletes it. Afterwards only nodes that restarted or proposed have it again, so the next transaction that touches it without adding value (e.g. a 0-value transfer) produces a different state root on nodes without the account. They reject the block with
InvalidStateRoot, leaving relays stuck and stalling validators. Anyone can trigger it for the cost of a transfer.Solution
Only write the genesis account while the genesis block is not yet committed. The genesis info is still loaded into memory every time. Genesis state roots are unchanged.
Tests
Checklist