-
Notifications
You must be signed in to change notification settings - Fork 30
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
Implement EIP-1186 eth_getProof #1563
base: nightly
Are you sure you want to change the base?
Conversation
can you base this on v0.5.5 release branch? we can merge it to nightly later on. |
note: in ethereum accounts have storage root so root -> account -> storage you have 2 proofs that are actually continiuations on the state tree. we use a different tree and accounts and storages live on different parts of this tree that's why account storage root is not a thing in Citrea. so we can return two different proofs, one for the so leave storage root empty and put two proofs, one for account being read, one for the storage queried. |
then I highly suggest renaming this endpoint into something else. Most people will query it and their program/library will panic. |
Yes, but I wanted to ported it into 0.5.5 later |
The response will have the same output format. Do you still think it’s a problem? We can have a verification code snippet in our docs for js |
If the output format doesn't blow up the caller client, then its ok. verification algorithm is not an issue as long as its documented (or even added as an endpoint?) |
crates/ethereum-rpc/src/ethereum.rs
Outdated
storage_proof.push(EIP1186StorageProof { | ||
key: JsonStorageKey(key.into()), | ||
value: value.unwrap_or_default(), | ||
proof: vec![value_proof], |
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.
this feels weird? why a vec of single length?
I thought the storage proof was a vec of merkle nodes that should be hashed?
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.
That's because let proof: sov_state::storage::StorageProof<<<C as Spec>::Storage as Storage>::Proof> = working_set.get_with_proof(storage_key);
- the real type is generic. I would need to hack into trait Proof
to properly serialize it with rlp.
Do we need it?
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.
we can force the rpc implementation to have NativeStorage = ProverStorage
so we get a concrete type for the Proof
then we can apply eth-like serialization to the proof
PR looks ok. some testing we need:
|
Description
Implements https://docs.alchemy.com/reference/eth-getproof
Linked Issues