feat: Include genesis accounts in changesets#2606
Merged
gakonst merged 1 commit intoparadigmxyz:mainfrom May 9, 2023
Merged
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #2606 +/- ##
===========================================
- Coverage 71.72% 60.08% -11.65%
===========================================
Files 489 496 +7
Lines 61424 62559 +1135
===========================================
- Hits 44059 37587 -6472
- Misses 17365 24972 +7607
Flags with carried forward coverage won't be shown. Click here to find out more.
|
onbjerg
approved these changes
May 9, 2023
| bytecode_cursor.upsert(hash, Bytecode::new_raw_with_hash(code.0.clone(), hash))?; | ||
| bytecode_hash = Some(hash); | ||
| let bytecode = Bytecode::new_raw(code.0.clone()); | ||
| // FIXME: Can bytecode_hash be Some(Bytes::new()) here? |
Collaborator
There was a problem hiding this comment.
no, if they have bytecode the hash must match since that is how we load bytecode from the database. otherwise the account would have no bytecode associated with it
Suggested change
| // FIXME: Can bytecode_hash be Some(Bytes::new()) here? |
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.
This PR changes the way genesis accounts/storage are handled. They are now treated as if they are changes that occur during the genesis block. This creates an invariant that an account that has never been written to is non-existent and storage key that has never been written is zero, which enables some lookup optimizations.
The
GenesisAccounttype unhelpfully distinguishes between accounts with no bytecode and accounts with empty bytecode. The previous code wrote an account withbytecode: Nonein the first case andbytecode: Some(<Hash of empty bytes>)in the second. I have preserved this dubious behaviour.