-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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
eth_getProof
implementation returns invalid hashes
#28441
Comments
Instead, I think it's pretty good to distinguish "empty account" and "non-existent account".
It makes sense to me. |
I think it works as expected |
@rjl493456442 I don't think I understand your assessment for the following reasons:
Of course, it would be easy for an application using this API to introduce special handling to be compatible with the previous behavior, and it might even be useful in some cases to maintain the distinction between "empty account" and "non-existent account". However, this seems to me to be a geth-specific response that is not covered by the EIP, and thus could cause compatibility issues with applications or other node/protocol implementations. |
You are reasoning as if there's nothing in particular different between 'empty account' and 'non-existent account'. IMO there's a world of difference,
|
FYI, test the
|
Yeah, we apologize for the breaking change, but I believe the new behavior is more correct.
I think we should improve the EIP by clarifing this corner case. But I don't think it makes sense to return a value(keccak256(0x0)) for non-existent account(null is expected).
For this storage trie(two layer structure), I think the storage slot verification involves two steps: (1) verify the account is existent and storage trie is not empty (2) verify the existence or inexistence of storage slot. In the case you mentioned, we can clearly prove this account is not existent, then obviously the step (2) is no longer required.
It's a fair good point. In my opinion, we should try to clarify EIP and align other client implementations with this behavioral definition. |
My main point was the discrepancy between the new behavior and the EIP, which IMHO clearly did not make a distinction between empty and non-existent. And that this could cause implementations and applications (like ours) that followed that EIP to now diverge. So, as long as the EIP is updated or the new expected behavior is clearly documented somewhere, I'd consider this issue resolved. That being said, I still believe that from a mathematical/formal point of view the Of course, these are just my subjective observations and remarks, and I see that you are coming more from a concrete go-/geth-developer point of view. However, I hope that I could maybe explain my slightly different perspective on what I think the perfect API could be 😄 |
Description
When
eth_getProof
is called for an account, that does not exist, it returns null hashes for the code and the storage hash. This is inconsistent with the behavior of existing simple accounts and was apparently introduced with #28357. Previously,codeHash
consistently returned the hash of the empty string0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470
andstorageHash
returned the empty MPT root hash0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421
.Steps to reproduce the behaviour
Actual behaviour
The previous command returns
Expected behaviour
The previous command should return the correct hash for "empty" data:
The text was updated successfully, but these errors were encountered: