Skip to content
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

add the eth_getProof call #1930

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

thinkAfCod
Copy link
Contributor

What does this PR do?

Add RPC call for eth_getProof

Where should the reviewer start?

Ethereum.java

Why is it needed?

In Op Rollup service, it is necessary to call the eth_getProof api to obtain the storageHash value.

@thinkAfCod thinkAfCod requested a review from conor10 as a code owner July 16, 2023 07:59
@thinkAfCod thinkAfCod force-pushed the feature/eth_getProof branch 3 times, most recently from df130af to 7df3b68 Compare July 19, 2023 11:00
@@ -501,6 +503,19 @@ public void testEthGetLogs() throws Exception {
assertFalse(logs.isEmpty());
}

@Disabled // Not available
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this disabled?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit: Test enabled, commit pushed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I just saw this comment now.
Previously, this testing method would return some error messages, and I wasn't sure of the reason.
However, when I used the same code elsewhere, I was able to get a normal response.
So, I disabled this test case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the besu node used cannot retrieve information for this address.
Here is the request log:

10:22:16.824 [Test worker] DEBUG org.web3j.protocol.http.HttpService - --> POST http://localhost:8545/
10:22:16.824 [Test worker] DEBUG org.web3j.protocol.http.HttpService - Content-Type: application/json; charset=utf-8
10:22:16.824 [Test worker] DEBUG org.web3j.protocol.http.HttpService - Content-Length: 184
10:22:16.824 [Test worker] DEBUG org.web3j.protocol.http.HttpService - 
10:22:16.825 [Test worker] DEBUG org.web3j.protocol.http.HttpService - {"jsonrpc":"2.0","method":"eth_getProof","params":["0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842",["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"],"latest"],"id":4}
10:22:16.825 [Test worker] DEBUG org.web3j.protocol.http.HttpService - --> END POST (184-byte body)
10:22:16.832 [Test worker] DEBUG org.web3j.protocol.http.HttpService - <-- 200 OK http://localhost:8545/ (7ms)
10:22:16.833 [Test worker] DEBUG org.web3j.protocol.http.HttpService - vary: origin
10:22:16.833 [Test worker] DEBUG org.web3j.protocol.http.HttpService - Content-Type: application/json
10:22:16.833 [Test worker] DEBUG org.web3j.protocol.http.HttpService - transfer-encoding: chunked
10:22:16.833 [Test worker] DEBUG org.web3j.protocol.http.HttpService - 
10:22:16.833 [Test worker] DEBUG org.web3j.protocol.http.HttpService - {
  "jsonrpc" : "2.0",
  "id" : 4,
  "error" : {
    "code" : -32000,
    "message" : "Account not found"
  }
}
10:22:16.833 [Test worker] DEBUG org.web3j.protocol.http.HttpService - <-- END HTTP (111-byte body)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced the address parameter with 0x0000000000000000000000000000000000000000, and now it works. The previous test data was from the https://docs-demo.quiknode.pro/ node, but it is clearly not compatible with the normal test network.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, thanks!

@NickSneo
Copy link
Contributor

NickSneo commented Aug 2, 2023

@thinkAfCod Just 1 comment, other than that LGTM

Edit: Comment resolved by me and commited

Copy link
Contributor

@NickSneo NickSneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NickSneo NickSneo merged commit 6e98ad6 into hyperledger-web3j:master Aug 3, 2023
4 checks passed
@NickSneo
Copy link
Contributor

Closing #1910

@thinkAfCod thinkAfCod deleted the feature/eth_getProof branch March 6, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants