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

w3vm: fix txIndex during rollback #182

Merged
merged 6 commits into from
Aug 22, 2024

Conversation

wesraph
Copy link
Contributor

@wesraph wesraph commented Aug 21, 2024

TxIndex is always set to 0 when a new vm is created while the snapshot index is different.

This bug can lead to getting the logs of the wrong tx after a simulation:

Steps to reproduce:

  • Get a block
  • Simulate tx[0]
  • Make a snapshot
  • Create a new vm and import a copy of the snapshot
  • Simulate tx[1]

The receipt will contain the logs of both 0 and 1. This fixes the bug by setting the vm's txIndex to the state's txIndex

@lmittmann lmittmann changed the title fix: import txIndex during rollback w3vm: fix txIndex during rollback Aug 22, 2024
@lmittmann lmittmann merged commit 54aeeda into lmittmann:main Aug 22, 2024
3 checks passed
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.

2 participants