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

eth/tracers/live: run supply tests off of generated artifacts #30451

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

s1na
Copy link
Contributor

@s1na s1na commented Sep 17, 2024

I think the block test format used for consensus testing is also ideal for testing live tracers. I have taken our existing tests for the supply tracer and turned them into a filler binary + a dumb test runner that takes processes the json files. I believe this format can be re-used for other live tracers (with the exception of the "except" field which would be different).

The only thorn in my side is the filler. I've put it as an executable module right now in eth/tracers/live/tests.

Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

I'm pushing some changes. For one thing, the names, instead of

=== RUN   TestSupplyTracerBlockchain/omittedFields/omitted_fields_cancun
=== PAUSE TestSupplyTracerBlockchain/omittedFields/omitted_fields_cancun
=== RUN   TestSupplyTracerBlockchain/selfdestruct/selfdestruct_cancun
=== PAUSE TestSupplyTracerBlockchain/selfdestruct/selfdestruct_cancun
=== RUN   TestSupplyTracerBlockchain/selfdestructItselfAndRevert/selfdestruct_itself_and_revert_grayGlacier

I think it's better to leave the filenames as is:

=== RUN   TestSupplyTracerBlockchain/omitted_fields.json/omitted_fields_cancun
=== PAUSE TestSupplyTracerBlockchain/omitted_fields.json/omitted_fields_cancun
=== RUN   TestSupplyTracerBlockchain/selfdestruct.json/selfdestruct_cancun
=== PAUSE TestSupplyTracerBlockchain/selfdestruct.json/selfdestruct_cancun
=== RUN   TestSupplyTracerBlockchain/selfdestruct_itself_and_revert.json/selfdestruct_itself_and_revert_grayGlacier

That way, when investigating a failure, it's easier to figure out what the source is. Instead of having to first figure out to un-camel it and add .json suffix.

params/forks/forks.go Show resolved Hide resolved
Comment on lines +539 to +510
// IsParis returns whether the given block is either equal to the Paris (merge)
// fork or greater.
// Note: Only usable for post-merge networks where MergeNetsplitBlock has been configured.
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait...

  • returns whether the given block is either >= merge,
  • only usable for > merge -networks

??

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah never mind, I get it

eth/tracers/live/tests/supply/eip1559_burn.json Outdated Show resolved Hide resolved
eth/tracers/live/supply_test.go Outdated Show resolved Hide resolved
@holiman holiman force-pushed the livetracer-test-runner branch from 20ae72c to f59f77f Compare November 20, 2024 12:02
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

Mostly LGTM, but I have one open question about that IsParis method ..?

params/config.go Outdated Show resolved Hide resolved
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM

@holiman
Copy link
Contributor

holiman commented Dec 10, 2024

@s1na needs a rebase

@namiloh
Copy link

namiloh commented Dec 13, 2024

I've approved it already, but it needs a rebase

@holiman holiman assigned s1na and unassigned holiman Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants