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

tracer: use proper base fee in tests #28775

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

palango
Copy link
Contributor

@palango palango commented Jan 8, 2024

While working on another issue, I found that in the tracing tests the base fee is generally set to nil (see https://github.com/ethereum/go-ethereum/blob/master/eth/tracers/internal/tracetest/prestate_test.go#L120). Changing this to pass the proper base fee works for most tests, but TestPrestateWithDiffModeTracer runs into problems in the create_failed.json test case.

Here the base fee is 51088069741, and the transactions fee limit is set to 112855938170. The transactions tip cap is 1500000000. This leads to a gas price of 112855938170 when the base fee is not set, but 52588069741 when the base fee is set.

The difference between those two values is 60267868429, multiplied by the gas limit of the transaction (176545) this makes up a balance difference of 10639990831797805, which is changes in the test file.

Resolves #28773

@palango palango requested a review from s1na as a code owner January 8, 2024 14:02
Copy link
Contributor

@s1na s1na left a comment

Choose a reason for hiding this comment

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

Thanks good catch. I did have a question tho.

@palango palango force-pushed the palango/tracer-test-bug branch 4 times, most recently from 8a9c9ad to c5ca0b9 Compare January 11, 2024 14:16
Copy link
Contributor

@s1na s1na left a comment

Choose a reason for hiding this comment

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

LGTM, approved pending green tests!

@palango
Copy link
Contributor Author

palango commented Jan 11, 2024

The failing tests seems to be flaky, no caused by this PR

@palango palango force-pushed the palango/tracer-test-bug branch 6 times, most recently from 356b49a to ce36f4d Compare January 14, 2024 14:57
@holiman holiman changed the title tracer: Use proper base fee in tests tracer: use proper base fee in tests Jan 15, 2024
@holiman holiman added this to the 1.13.11 milestone Jan 15, 2024
@palango
Copy link
Contributor Author

palango commented Jan 15, 2024

I'm not sure why CI doesn't turn green. There seem to be some flaky tests, especially TestForkResendTx, which runs fine locally.

@holiman
Copy link
Contributor

holiman commented Jan 15, 2024

I'm not sure why CI doesn't turn green.

Don't worry about it. And no need to force-push to trigger it, we can rerun the ones that fail

@s1na
Copy link
Contributor

s1na commented Jan 16, 2024

Re-running the failed tests 🤞 sometimes we have to do this a couple of times to get the green check

@holiman holiman merged commit c66ca8b into ethereum:master Jan 16, 2024
2 of 3 checks passed
@palango palango deleted the palango/tracer-test-bug branch January 16, 2024 11:21
Dergarcon pushed a commit to specialmechanisms/mev-geth-0x2mev that referenced this pull request Jan 31, 2024
 In the tracing tests, the base fee was generally set to nil. This commit changes this to pass the proper base instead, and fixes the few tests which become broken by the change.
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.

Incorrect base fee usage in tracing tests
3 participants