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

feat: add erigons debugTraceCallMany #3878

Merged
merged 6 commits into from
Aug 3, 2023

Conversation

0x6020c0
Copy link
Contributor

WIP #3522. I'm not sure about the function arguments, because if I understand correctly, the current implementation of trace_call_many doesn't use state_overrides and transaction_index.

@onbjerg onbjerg added C-enhancement New feature or request A-rpc Related to the RPC implementation M-changelog This change should be included in the changelog labels Jul 24, 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.

ty,

A few suggestions, overall looks very good already

regarding the params, I think we need this structure, which differs from the currently used Vec<> I think

https://github.com/ledgerwatch/erigon/pull/4567/files#diff-da201633f50d1f08dc64245a4ee39b0b4c123404fb663998c5df00f6f161529eR73

crates/rpc/rpc-api/src/debug.rs Outdated Show resolved Hide resolved
crates/rpc/rpc-api/src/debug.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/debug.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/debug.rs Outdated Show resolved Hide resolved
@0x6020c0
Copy link
Contributor Author

Thanks for the help. The new structs are for now placed in crates/rpc/rpc-types/src/eth/call.rs. Currently transaction_index different than 0 causes nonce too low error, working on fixing that.

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.

I made a few changes and fixed the nonce issue which happened because we were using the wrong state: if we're replaying a block we need the parent block's state

@mattsse mattsse marked this pull request as ready for review August 3, 2023 12:35
@mattsse mattsse requested a review from Rjected as a code owner August 3, 2023 12:35
@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #3878 (7c45ace) into main (ce6e247) will decrease coverage by 0.14%.
Report is 1 commits behind head on main.
The diff coverage is 16.15%.

Impacted file tree graph

Files Changed Coverage Δ
crates/rpc/rpc-api/src/debug.rs 100.00% <ø> (ø)
crates/rpc/rpc/src/debug.rs 9.10% <0.00%> (-1.86%) ⬇️
crates/rpc/rpc-types/src/eth/call.rs 59.55% <53.84%> (-4.45%) ⬇️

... and 11 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.45% <0.00%> (-0.02%) ⬇️
unit-tests 64.08% <16.15%> (-0.13%) ⬇️

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

Components Coverage Δ
reth binary 25.85% <ø> (-0.02%) ⬇️
blockchain tree 83.04% <ø> (ø)
pipeline 90.07% <ø> (ø)
storage (db) 74.40% <ø> (ø)
trie 94.70% <ø> (ø)
txpool 47.36% <ø> (-0.63%) ⬇️
networking 77.38% <ø> (-0.05%) ⬇️
rpc 57.77% <16.15%> (-0.52%) ⬇️
consensus 63.86% <ø> (ø)
revm 32.71% <ø> (ø)
payload builder 6.58% <ø> (ø)
primitives 87.99% <ø> (-0.01%) ⬇️

@mattsse mattsse added this pull request to the merge queue Aug 3, 2023
Merged via the queue into paradigmxyz:main with commit e9cb414 Aug 3, 2023
23 checks passed
@geomad
Copy link

geomad commented Aug 3, 2023

Hey, I barely understand rust, so my comment may be completly dumb, but I'll leave it anyway just to be sure:

  1. If the tx index is set to x shouldn't we just replay the txs until x-1? I think we are replaying until x here?
  2. Shouldn't the blocknumber be set at blocknumber + 1 (unless it's overriden) after each bundle is executed for the context of the next bundle? Same with timestamp, erigon adds +1 to the timestamp after each bundle, but I think +12 would be more appropriate here, since we are in POS now.

@geomad
Copy link

geomad commented Aug 7, 2023

Hey, I barely understand rust, so my comment may be completly dumb, but I'll leave it anyway just to be sure:

  1. If the tx index is set to x shouldn't we just replay the txs until x-1? I think we are replaying until x here?
  2. Shouldn't the blocknumber be set at blocknumber + 1 (unless it's overriden) after each bundle is executed for the context of the next bundle? Same with timestamp, erigon adds +1 to the timestamp after each bundle, but I think +12 would be more appropriate here, since we are in POS now.

@mattsse I would appreciate some feedback on those, before the new release!

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.

4 participants