feat(rpc): add preimages to execution witness response#10456
Merged
Conversation
5c9158f to
8df597a
Compare
onbjerg
approved these changes
Aug 23, 2024
| .witness(HashedPostState::default(), hashed_state) | ||
| .map_err(Into::into)?; | ||
|
|
||
| // TODO(alexey): return `state_preimages` as well when https://github.com/alloy-rs/alloy/pull/1178 is released |
Collaborator
There was a problem hiding this comment.
lets add a follow up issue to track
rkrasiuk
reviewed
Aug 23, 2024
Comment on lines
+652
to
+659
| state_preimages.insert(hashed_address, alloy_rlp::encode(address)); | ||
|
|
||
| for (slot, value) in account.storage { | ||
| let hashed_slot = keccak256(B256::from(slot)); | ||
| let slot = B256::from(slot); | ||
| let hashed_slot = keccak256(slot); | ||
| storage.storage.insert(hashed_slot, value); | ||
|
|
||
| state_preimages.insert(hashed_slot, alloy_rlp::encode(slot)); |
Contributor
There was a problem hiding this comment.
ideally i'd want to reuse HashedPostState::from_cache_state for this, but no need to tackle here
Member
Author
There was a problem hiding this comment.
right, but you'd need to walk the cache state anyway because HashedPostState won't contain pre-images, no?
| .witness(HashedPostState::default(), hashed_state) | ||
| .map_err(Into::into)?; | ||
|
|
||
| // TODO(alexey): return `state_preimages` as well when https://github.com/alloy-rs/alloy/pull/1178 is released |
Contributor
There was a problem hiding this comment.
let's maybe wait for the release? otherwise, it's collecting preimages for no reason
Contributor
|
blocked by alloy release w/ alloy-rs/alloy#1178 |
Member
Author
|
Alloy release just happened, cc @rkrasiuk |
mattsse
approved these changes
Aug 30, 2024
emhane
approved these changes
Aug 30, 2024
rkrasiuk
approved these changes
Sep 2, 2024
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.
Closes #10404