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

core/state: better randomized testing (postcheck) on journalling #29627

Merged
merged 7 commits into from
Apr 25, 2024

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Apr 23, 2024

This PR fixes some flaws with the existing tests, which I discovered while working on a different journalling system.

The randomized testing (TestSnapshotRandom) executes a series of steps which modify the state and create journal-events.
Later on, we compare the forward-going-states against the backwards-unrolling-journal-states, and check that they are identical.

The "identical" check is performed using various accessors. It turned out that we failed to check some things: the accesslist contents and the transient storage contents.

After we remove the account reset operation in #29520, we should also add accessors/checks for newContract

@holiman holiman added this to the 1.14.1 milestone Apr 23, 2024
Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

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

sgtm

@holiman
Copy link
Contributor Author

holiman commented Apr 24, 2024

PTAL again, I've now added verification of the poststate journal dirties, the dirtyStorage , and the newContract flag

core/state/statedb_test.go Outdated Show resolved Hide resolved
@rjl493456442
Copy link
Member

Tests are failing

@holiman
Copy link
Contributor Author

holiman commented Apr 24, 2024

Tests are failing

Yes, that shows that it's working :)
This PR now requires #29641 (which should fix the failing test)

@holiman
Copy link
Contributor Author

holiman commented Apr 24, 2024

I can confirm that when running this on top of #29641, the tests do not fail

@holiman holiman merged commit 243cde0 into ethereum:master Apr 25, 2024
3 checks passed
jorgemmsilva pushed a commit to iotaledger/go-ethereum that referenced this pull request Jun 17, 2024
…ereum#29627)

This PR fixes some flaws with the existing tests.

The randomized testing (TestSnapshotRandom) executes a series of steps which modify the state and create journal-events. Later on, we compare the forward-going-states against the backwards-unrolling-journal-states, and check that they are identical.

The "identical" check is performed using various accessors. It turned out that we failed to check some things: 
- the accesslist contents
- the transient storage contents
- the 'newContract' flag
- the dirty storage map

This change adds these new checks
stwiname pushed a commit to subquery/data-node-go-ethereum that referenced this pull request Sep 9, 2024
…ereum#29627)

This PR fixes some flaws with the existing tests.

The randomized testing (TestSnapshotRandom) executes a series of steps which modify the state and create journal-events. Later on, we compare the forward-going-states against the backwards-unrolling-journal-states, and check that they are identical.

The "identical" check is performed using various accessors. It turned out that we failed to check some things: 
- the accesslist contents
- the transient storage contents
- the 'newContract' flag
- the dirty storage map

This change adds these new checks
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