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

core: exclude tracing for create/create2 failing pre-checks #1710

Merged
merged 5 commits into from
Dec 18, 2023

Conversation

canepat
Copy link
Member

@canepat canepat commented Dec 13, 2023

This PR fixes yet another incompatibility between Silkworm and Erigon database content related to call traces.

Specifically, the discrepancy happens on mainnet at block 1878695, where transaction 5 runs out of gas trying to deploy contract 0xAE050f0402c2F4C7fe0Abb0ea1F0A466061AE967: the failure is triggered within evmone::baseline in function check_requirements for opcode CREATE.

In this specific case, Erigon does not include the CREATE sender and recipient into the call trace set for the block. On the other hand, Silkworm does after the changes introduced by #1706, namely using the on_instruction_start callback to trace sender and recipient of early-returning CREATE operations. Hence, given that we need to correlate the out-of-gas failure with the CREATE opcode execution, what we can do with the current tracing interface is just reproducing the same requirement failure here.

Moreover the check_requirements function, which detects the out-of-gas condition during pre-execution checks, is currently not exported by evmone, so this PR temporarily copies the code here.

@chfast for a proper solution we either need to export the check_requirements function from evmone or even better to extend the tracing interface (perhaps by adding on_instruction_end hook or passing the last executed opcode in on_execution_end? not sure) so that we don't need to redo the check

All the above considerations can be applied to the CREATE2 operation as well.

@canepat canepat added the maintenance Some maintenance work (fix, refactor, rename, test...) label Dec 13, 2023
silkworm/core/execution/call_tracer.cpp Show resolved Hide resolved
silkworm/core/execution/call_tracer.cpp Show resolved Hide resolved
silkworm/core/execution/call_tracer.cpp Show resolved Hide resolved
canepat and others added 3 commits December 18, 2023 10:02
@canepat canepat merged commit 1075c51 into master Dec 18, 2023
3 checks passed
@canepat canepat deleted the core_exclude_create_tracing_precheck_fail branch December 18, 2023 09:59
@canepat canepat mentioned this pull request Aug 11, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Some maintenance work (fix, refactor, rename, test...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants