-
Notifications
You must be signed in to change notification settings - Fork 20.6k
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
core/state: move slot RLP encoding into the MPT implementation #27000
Conversation
v, _ = rlp.EncodeToBytes(common.TrimLeftZeroes(value[:])) | ||
if err := tr.UpdateStorage(s.address, key[:], v); err != nil { | ||
v, _ = rlp.EncodeToBytes(trimmedVal) | ||
if err := tr.UpdateStorage(s.address, key[:], trimmedVal); err != nil { |
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.
Please change this to make it more obvious that v
will be used for the snapshot later.
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.
For example, we could add a comment saying that.
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.
renamed it to snapshotVal
and added a comment.
9c8a06b
to
d21aaf9
Compare
Need to test on the benchmarkers before we revisit it |
…eum#27000) Continuing with a series of PRs to make the Trie interface more generic, this PR moves the RLP encoding of storage slots inside the StateTrie and light.Trie implementations, as other types of tries don't use RLP.
ethereum#27000)" This reverts commit 797c100.
ethereum#27000)" This reverts commit 797c100.
Continuing with a series of PRs to make the
Trie
interface more generic, this PR moves the RLP encoding of storage slots inside thesecure_trie
andlight.Trie
implementations, as other types of tries don't use this.This PR is still in draft, as the snapshot still uses RLP. While I think the snapshot should also get rid of RLP, this would cause a bunch of issues:
Until a solution has been found, this means the RLP decoding happens twice for a snapshot-enabled MPT client.