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

WIP: Implement prestateTracer #3923

Merged

Conversation

PlamenHristov
Copy link
Contributor

@PlamenHristov PlamenHristov commented Jul 26, 2023

The following is a WIP for prestatTracer. With regard to that there are a couple of things that I'd ask for help

  1. The implementation won't compile, because of the trait bounds of fn trace_transaction() given that it won't be satisfied by DatabaseRef .
    1.1. Should the signature of geth_prestate_traces() be changed to accept a mutable reference and then borrow mutably from inspect_call_at_and_return_state() that gets called in try_debug_trace_call()?
    1.2. Or maybe make a copy of the db object?
  2. Where should tests be added?
  3. There are probably ways to make it more efficient, which I'm open to feedback on.

Closes #2624

@mattsse mattsse added the A-rpc Related to the RPC implementation label Jul 26, 2023
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this looks pretty good already.

the rpc impls is ready, the tracing logic needs a few changes

crates/rpc/rpc/src/debug.rs Outdated Show resolved Hide resolved
crates/revm/revm-inspectors/src/tracing/types.rs Outdated Show resolved Hide resolved
crates/revm/revm-inspectors/src/tracing/builder/geth.rs Outdated Show resolved Hide resolved
crates/revm/revm-inspectors/src/tracing/builder/geth.rs Outdated Show resolved Hide resolved
crates/revm/revm-inspectors/src/tracing/types.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/debug.rs Outdated Show resolved Hide resolved
@onbjerg onbjerg added C-enhancement New feature or request M-changelog This change should be included in the changelog labels Jul 26, 2023
@PlamenHristov PlamenHristov force-pushed the plamen/feature-prestate-tracer branch from a3eb399 to 7fb836e Compare July 26, 2023 22:58
@PlamenHristov
Copy link
Contributor Author

@mattsse, let me know if that looks better.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

nice,

almost there

crates/revm/revm-inspectors/src/tracing/builder/geth.rs Outdated Show resolved Hide resolved
crates/revm/revm-inspectors/src/tracing/builder/geth.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/debug.rs Outdated Show resolved Hide resolved
@PlamenHristov
Copy link
Contributor Author

@mattsse , should be good now.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

nice,

tysm for this!

@mattsse mattsse enabled auto-merge July 28, 2023 10:44
@codecov
Copy link

codecov bot commented Jul 28, 2023

Codecov Report

Merging #3923 (7c474b5) into main (d2cdd10) will decrease coverage by 0.07%.
The diff coverage is 7.82%.

Impacted file tree graph

Files Changed Coverage Δ
...s/revm/revm-inspectors/src/tracing/builder/geth.rs 0.00% <0.00%> (ø)
crates/revm/revm-inspectors/src/tracing/types.rs 0.00% <0.00%> (ø)
crates/rpc/rpc/src/debug.rs 10.96% <0.00%> (-0.79%) ⬇️
...ates/rpc/rpc-types/src/eth/trace/geth/pre_state.rs 95.00% <100.00%> (+1.45%) ⬆️

... and 4 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.34% <0.00%> (-0.05%) ⬇️
unit-tests 64.37% <7.82%> (-0.06%) ⬇️

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

Components Coverage Δ
reth binary 27.16% <ø> (ø)
blockchain tree 83.04% <ø> (ø)
pipeline 89.82% <ø> (ø)
storage (db) 74.30% <ø> (ø)
trie 94.70% <ø> (ø)
txpool 46.18% <ø> (+0.60%) ⬆️
networking 77.63% <ø> (-0.02%) ⬇️
rpc 58.32% <21.95%> (-0.13%) ⬇️
consensus 64.46% <ø> (ø)
revm 33.08% <0.00%> (-0.61%) ⬇️
payload builder 6.61% <ø> (ø)
primitives 87.81% <ø> (-0.02%) ⬇️

@mattsse mattsse added this pull request to the merge queue Jul 28, 2023
Merged via the queue into paradigmxyz:main with commit c04f3e4 Jul 28, 2023
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation C-enhancement New feature or request M-changelog This change should be included in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement prestateTracer
3 participants