-
Notifications
You must be signed in to change notification settings - Fork 812
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
Bonsai TrieLogFactory serializer/deserializer #5372
Bonsai TrieLogFactory serializer/deserializer #5372
Conversation
|
…ge as cleared Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…e rather than slotHash Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
…es equivalence check Signed-off-by: garyschulte <garyschulte@gmail.com>
…in TrieLogLayer.addCodeChange rather than Bytes.EMPTY Signed-off-by: garyschulte <garyschulte@gmail.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
53791d4
to
7f8ea0b
Compare
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
address, | ||
new BonsaiValue<>( | ||
oldValue == null ? Bytes.EMPTY : oldValue, newValue == null ? Bytes.EMPTY : newValue)); | ||
code.put(address, new BonsaiValue<>(oldValue, newValue, newValue == null)); |
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.
@matkt I believe we were previously returning Bytes.EMPTY here because the old BonsaiLayeredWorldState implementation would serve state directly from TrieLogs.
Since the 5123 bonsai refactor, we should be able to treat this consistently as null. Otherwise a constructed trielog != that same trielog serialized and then deserialized. It was the difference between code == null vs code == 0x.
* add account zero reads, mark self-destructed accounts, code and storage as cleared * refactor BonsaiWorldView and TrieLog to use StorageSlotKey record type rather than slotHash * add isCleared to read/write of BonsaiValues * for consistency between serialize and deserialize, use null directly in TrieLogLayer.addCodeChange rather than Bytes.EMPTY Signed-off-by: garyschulte <garyschulte@gmail.com>
* add account zero reads, mark self-destructed accounts, code and storage as cleared * refactor BonsaiWorldView and TrieLog to use StorageSlotKey record type rather than slotHash * add isCleared to read/write of BonsaiValues * for consistency between serialize and deserialize, use null directly in TrieLogLayer.addCodeChange rather than Bytes.EMPTY Signed-off-by: garyschulte <garyschulte@gmail.com>
PR description
This PR introduces a TrieLogFactory interface and default implementation that will allow for a pluggable implementation of bonsai trie log serialization and deserialization.
This pr also introduces a StorageSlotKey record type that enables accumulators and serializers to utilize slotKeys and/or slotKeyHashes when writing trieLogs.
Fixed Issue(s)
related to protocol-misc # 755