Open frisitano opened 1 week ago
I have had a response from alchemy suggesting that they have fixed their rpc service. It would be good to run a test to see how it performs now.
That's great! I'll kick off some tests today then.
@frisitano It seems that alchemy is still returning erroneous data, or the native tracer may be having some issues. I have got a few seemingly erroneous witnesses, which failed generating proofs at some point, while their jerigon counterpart worked fine. Note that these are cancun blocks (you can test them against feat/cancun
branch).
Failed blocks with alchemy:
First and last got a mpt_read_hash_node
error, so possibly coming from native tracer edge cases.
I've taken a look into this issue. I have the following suspicions:
In conclusion I think these errors are associated with native tracer edge cases rather than rpc provider issues.
We have identified two RPC issues, these are:
1)
entered unreachable code
associated with the following code:https://github.com/0xPolygonZero/zk_evm/blob/d81d68380e1209030c91508adcb9007c47441fdb/zero_bin/rpc/src/native/txn.rs#L77-L82
It turns out that the RPC provider returns an incorrect enum variant. The following example is taken from block
20169213
and txn hash0xa14a8b6a069a35100a292320a3d28df14a69d67cc71677f2098d782150d2a736
using quicknode as the rpc provider. We would expect the enum variant to beGethTrace::PreStateTracer(PreStateFrame::Default(read))
for thepre_trace
but instead we receiveGethTrace::JS(...)
as seen below:If we observe the data we can see that for account
0xf5d5193e0dcc8e49c151713c5b456e15cd4e7c5e
we are being returned an invalid balance-0x1bc16d674ec80000
which I suspect is causingalloy
to parse this as a customJS
response.When we look at this transaction in etherescan we can see the balance for this account should be 0 - https://etherscan.io/tx/0xa14a8b6a069a35100a292320a3d28df14a69d67cc71677f2098d782150d2a736#statechange.
Interestingly this appears to be an rpc provider specific issue. Lets observe the response for the following request from quicknode and alchemy.
Request:
quicknode:
alchemy:
Running this block against the alchemy rpc results in successful witness generation as such I conclude that this is an rpc provider specific issue.
2)
Failed to get proof for account
when requesting account state witness dataIt appears that when making requests for state witness data, in some instances the rpc provider returns an error. If we take the example of block
20169553
and account0xb8901acB165ed027E32754E0FFe830802919727f
with associated keys as seen in the request below:The rpc response from quicknode is:
Using alchemy as the rpc provided does in fact yield a response, however this response also yields an error associated with the storage proof, specifically
trusted rlp should be valid: RlpExpectedToBeData
. I have further investigated the problem here and will be opening a related issue to address this.Conclusion
Both of these issues appear to be associated with the reliability of data returned from rpc providers. We should find a solution where we can improve the reliability of rpc data. My suggestion would be to host a dedicated archive node.