Skip to content

feat: Hook on Execution #1567

Merged
gakonst merged 4 commits intomainfrom
feat/executor-hook
Feb 27, 2023
Merged

feat: Hook on Execution #1567
gakonst merged 4 commits intomainfrom
feat/executor-hook

Conversation

@gakonst
Copy link
Member

@gakonst gakonst commented Feb 26, 2023

Motivation

We need better ways to inspect the internal state of various transactions when using the executor.

Solution

Introduces an InspectorStack similar to Foundry's which allows hooking on a transaction hash or a block and run a bunch of inspectors for each transaction.

In a follow-up PR, we should integrate this with the ExecutionStage, so that we can expose it e.g. for reth stage debugging.

@gakonst gakonst requested a review from rakita as a code owner February 26, 2023 03:17
Comment on lines +32 to +33
/// An inspector that prints the opcode traces to the console.
pub custom_print_tracer: Option<CustomPrintTracer>,
Copy link
Member Author

Choose a reason for hiding this comment

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

We'll introduce other inspectors here. cc @joshieDo for snapshotting state touched

@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2023

Codecov Report

Merging #1567 (b46044a) into main (b1741bd) will decrease coverage by 0.22%.
The diff coverage is 24.73%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main    #1567      +/-   ##
==========================================
- Coverage   75.15%   74.93%   -0.22%     
==========================================
  Files         371      372       +1     
  Lines       43342    43510     +168     
==========================================
+ Hits        32572    32605      +33     
- Misses      10770    10905     +135     
Flag Coverage Δ
integration-tests 21.47% <0.00%> (-0.12%) ⬇️
unit-tests 69.48% <24.73%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
crates/revm/revm-inspectors/src/lib.rs 100.00% <ø> (ø)
crates/revm/revm-inspectors/src/stack.rs 9.52% <9.52%> (ø)
crates/executor/src/executor.rs 93.67% <82.05%> (+0.20%) ⬆️
crates/net/eth-wire/src/capability.rs 74.26% <0.00%> (-0.74%) ⬇️
crates/stages/src/stages/sender_recovery.rs 90.95% <0.00%> (-0.54%) ⬇️
crates/stages/src/stages/hashing_storage.rs 95.65% <0.00%> (-0.28%) ⬇️
crates/net/network/src/session/active.rs 84.59% <0.00%> (-0.15%) ⬇️
crates/net/downloaders/src/headers/task.rs 83.67% <0.00%> (ø)
crates/net/network/src/peers/manager.rs 82.55% <0.00%> (+0.08%) ⬆️
crates/storage/provider/src/test_utils/mock.rs 37.94% <0.00%> (+0.51%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

LGTM as a starting point

@onbjerg onbjerg added C-enhancement New feature or request A-execution Related to the Execution and EVM labels Feb 27, 2023
@gakonst gakonst merged commit 56394ee into main Feb 27, 2023
@gakonst gakonst deleted the feat/executor-hook branch February 27, 2023 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-execution Related to the Execution and EVM C-enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants