-
Notifications
You must be signed in to change notification settings - Fork 13
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
save overlay conversion iterator pointers at each block #298
Conversation
@@ -64,37 +64,37 @@ type Database interface { | |||
// TrieDB retrieves the low level trie database used for data storage. | |||
TrieDB() *trie.Database | |||
|
|||
StartVerkleTransition(originalRoot, translatedRoot common.Hash, chainConfig *params.ChainConfig, cancunTime *uint64) | |||
StartVerkleTransition(originalRoot common.Hash, chainConfig *params.ChainConfig, cancunTime *uint64, root common.Hash) |
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.
TODO: see if originalRoot
and root
can be merged into a single value. It should be possible as the verkle transition is only started at a given block height, which is the one at the fork.
core/state/database.go
Outdated
CurrentAccountAddress: map[common.Hash]*common.Address{}, | ||
CurrentSlotHash: map[common.Hash]common.Hash{}, | ||
CurrentPreimageOffset: map[common.Hash]int64{}, started: map[common.Hash]bool{}, | ||
ended: map[common.Hash]bool{}, |
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.
TODO check that the proper value will be set when transitioning at genesis
core/state/database.go
Outdated
CurrentSlotHash: map[common.Hash]common.Hash{}, | ||
CurrentPreimageOffset: map[common.Hash]int64{}, | ||
started: map[common.Hash]bool{}, | ||
ended: map[common.Hash]bool{}, |
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.
same here
superseded by #304, closing |
This is in preparation for the shadow fork. It appeared, while performing the overlay transition with Kaustinen rebased on shapella, that the conversion at a slot after genesis got broken. Bugs happened because the transition was executed multiple times at the same block height, but the iterator pointers were not rewound.
This PR introduces per-block iterator pointers. More exactly, iterator pointers are related to the state root hash of the parent of the block that uses these iterators. If a block is reexecuted multiple times, then the pointers that are used will be initialized with how they were when that parent block was sealed.
The choice of linking the iterator pointers to the parent root hash instead of e.g. the slot number, comes from the fact that it's simpler to code. We might (probably will, in fact) change that after some refactoring, e.g. a rebase of the kaustinen branch on top of PBSS. Right now, this should be good enough for a reorg-less shadowfork.