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

(gentest): MUST NOT modify pre-state in tests #941

Open
raxhvl opened this issue Nov 6, 2024 · 0 comments
Open

(gentest): MUST NOT modify pre-state in tests #941

raxhvl opened this issue Nov 6, 2024 · 0 comments

Comments

@raxhvl
Copy link
Contributor

raxhvl commented Nov 6, 2024

We should NOT modify pre-state in the tests

This seems quite unusual to me. Ideally, the pre-state tracer should provide the state for all accounts prior to the transaction's execution.

if address == self.transaction.sender:
state_str += f"{pad}nonce={self.transaction.nonce},\n"
else:

While the sender's nonce does get updated, that's just one of several side effects resulting from the transaction. Changing the state within the test interferes with the EVM - a big red flag 🟥 . We shouldn't be updating the state ourselves; that's the EVM's responsibility. The test should focus solely on comparing the state transition against the specification.

Originally posted in #901 (comment)

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

No branches or pull requests

1 participant