-
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
feat: add Linea variant #22
Conversation
Tested and it does seem like it's always hitting state root mismatch. I believe this has to do with the EVM difference between Linea and Ethereum? I'm not familiar with Linea but the state root computation code in |
Yes I'm hitting the same issue.. Main difference I see is Linea currently uses Clique for consensus, and it might have some subtle effect somewhere... I'm a bit out of ideas on what to investigate.. |
Yeah I believe that the state root computation logic is the same between the two. If Linea were indeed using a different trie structure, you're most likely going to fail when verifying the storage proofs, which didn't happen and you were able to run the program till the end. I also think that execution is not too shabby. Apart from state root, Given that we agree root computation itself is working as intended, the issue must come from the fact that the resulting state after local block execution differs from what It's easier said than done though. A comprehensive and fool-proof approach would be to compare the 2 tries side by side to eventually find the leaf that differs. However, this requires good understanding of MPT, and also tracing the A more superficial approach would be directly compare the state. For each account modified by local execution, you can compare its new nonce, balance, code hash, and storage root with the ones reported by My guess would be that some account ends up having a different storage root than what |
So, I found a suspicious account; if we check say, transition from genesis to block 1 (or even the first few blocks which are simple), I compare the fields of the storage proof (previous and current block from geth) with the execution outcome from reth (which should match the current block from geth), there is always one balance mismatch:
So that might be clique signer issue or gas computation.. 0x000..00 is marked as the "sequencer" of the block (https://lineascan.build/block/1) |
Interesting finding! This is probably what's causing the issue since it looks like every single block is hitting the problem. Need to figure out what causes |
Went to the bottom of it by tracing step by step in local forks and made it work :-).
I have an... acceptable workaround;
Will do an updated PR tonight or tomorrow 👍 |
Wow that's really awesome! |
@xJonathanLEI PR ready for review :) not sure it's the best abstraction but it results in a minimal diff. my archive node is still up if you want to test. |
Great! Will take a look. As for testing, we now have rsp-tests that's allows running tests against it even after your node is gone. I will make use of that to add integration tests here. |
Rebased and squashed to resolve conflicts and cleanup spaghetti commit history. |
Tested this against the original problematic block of
Comparing this against RPC data, it's matching. I think we can proceed to merge :) Before testing I was kinda expecting to get a correct state root but a mismatched block hash just because how you're manually tweaking the header. To my surprise it turns out to match. I guess under the hood with Clique it's doing the exact same thing. |
@gbotrel I just added the lock file CI check for Could you please keep the node around just a little bit longer so that we can add that in as a follow up? |
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.
LGTM
Continuing #17