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: fix prestate tracer bug with create with value #10961

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

taratorio
Copy link
Member

@taratorio taratorio commented Jul 1, 2024

Cherry-pick adaptation for Erigon 3 based on Erigon 2 PR: #10960
Commit: 30cae52


fixes #9531

Changes:

  • fixes a bug with the prestate tracer where we were incorrectly subtracting the value of a transaction from the "to" address balance in the "pre" state (should not be done for CREATE calls)
  • fixes a bug with the prestate tracer where we were incorrectly adding the value of a transaction to the "from" address balance in the "pre" state (should not be done for CREATE calls)
  • fixes a bug with the prestate tracer where we were incorrectly decrementing the nonce value of a transaction's "from" address in the "pre" state (should not be done for CREATE calls)
  • adds a test generator that can generate the test files for us based on real life transaction hash and node rpc url - check README https://github.com/ledgerwatch/erigon/blob/fix-prestate-tracer-on-create-e2/eth/tracers/internal/tracetest/testgenerator/README.md
  • adds test cases
  • fixes some existing test cases that were setup with incorrect data

@taratorio taratorio marked this pull request as draft July 1, 2024 18:15
fixes #9531

Changes:
- fixes a bug with the prestate tracer where we were incorrectly
subtracting the value of a transaction from the "to" address balance in
the "pre" state (should not be done for CREATE calls)
- fixes a bug with the prestate tracer where we were incorrectly adding
the value of a transaction to the "from" address balance in the "pre"
state (should not be done for CREATE calls)
- fixes a bug with the prestate tracer where we were incorrectly
decrementing the nonce value of a transaction's "from" address in the
"pre" state (should not be done for CREATE calls)
- adds a test generator that can generate the test files for us based on
real life transaction hash and node rpc url - check README
https://github.com/ledgerwatch/erigon/blob/fix-prestate-tracer-on-create-e2/eth/tracers/internal/tracetest/testgenerator/README.md
- adds test cases
- fixes some existing test cases that were setup with incorrect data
@taratorio taratorio force-pushed the fix-prestate-tracer-on-create-e3 branch from fe7d504 to 605e701 Compare July 2, 2024 10:04
@taratorio taratorio marked this pull request as ready for review July 2, 2024 10:06
@taratorio taratorio enabled auto-merge (squash) July 2, 2024 10:07
@taratorio taratorio merged commit 1ab8b2e into main Jul 2, 2024
17 of 19 checks passed
@taratorio taratorio deleted the fix-prestate-tracer-on-create-e3 branch July 2, 2024 10:33
@taratorio taratorio added this to the 2.60.3-fixes milestone Jul 2, 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.

debug_traceTransaction giving negative balance in result
2 participants