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

new(tests): TSTORE: ensure transient storage is cleared after transactions #798

Merged

Conversation

jochem-brouwer
Copy link
Member

@jochem-brouwer jochem-brouwer commented Sep 13, 2024

🗒️ Description

This PR introduces 2 tests, which test that the transient storage is cleared after transactions. EthereumJS did clear storage after "normal" transactions, but did not clear the transient storage after a transaction created a contract. If the deployed contract address was then called, then the transient storage was not empty. See: ethereumjs/ethereumjs-monorepo#3625. This was not caught by these tests, so I have added two tests, one which does the create-tx and then call-contract, and the other calls the same contract twice.

The tests are very repetitive, so I would love some suggestions how to make those more compact (we could also move these two tests into one single test, where we use 3 transactions instead of two, writing to different storage slots and different transient storage slots).

The good/bad cases of these tests have been tested using EthereumJS (with and without the bug) using our new t8ntool 😄

🔗 Related Issues

Test produced by a bug in EthereumJS: ethereumjs/ethereumjs-monorepo#3625

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • All: Added an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: All converted JSON/YML tests from ethereum/tests have been added to converted-ethereum-tests.txt.
  • Tests: A PR with removal of converted JSON/YML tests from ethereum/tests have been opened.
  • Tests: Included the type and version of evm t8n tool used to locally execute test cases: e.g., ref with commit hash or geth 1.13.1-stable-3f40e65.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@jochem-brouwer jochem-brouwer changed the title new(tests): TSTORE: ensure transient storage is cleared after transac… new(tests): TSTORE: ensure transient storage is cleared after transactions Sep 13, 2024
Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

Looks good! Just one comment, thanks!

@jochem-brouwer jochem-brouwer marked this pull request as ready for review September 15, 2024 19:15
@jochem-brouwer jochem-brouwer marked this pull request as draft September 17, 2024 15:20
@jochem-brouwer jochem-brouwer marked this pull request as ready for review September 18, 2024 15:37
Copy link
Member

@marioevz marioevz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@marioevz marioevz merged commit 758baf3 into ethereum:main Sep 18, 2024
4 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.

4 participants