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

Add a test for storage trie determinism #2914

Merged
merged 12 commits into from
Feb 11, 2025
Merged

Add a test for storage trie determinism #2914

merged 12 commits into from
Feb 11, 2025

Conversation

eljobe
Copy link
Member

@eljobe eljobe commented Jan 31, 2025

This includes a new BigMap contract in the nitro-contracts repo in the mocks package.

The test attempts to set a lot of storage slots to some value in one transaction, and then to clear 75% of them and add 10% more values in a second transaction.

Finally, validation is run to ensure that the validator is behaving correctly.

The idea is that this test will pass validation with the state db's deterministic flag set, but fail without it set.

Related to: NIT-3068

This includes a new BigMap contract in the nitro-contracts repo in the mocks
package.

The test attempts to set a lot of storage slots to some value in one
transaction, and then to clear 75% of them and add 10% more values in a second
transaction.

Finally, validation is run to ensure that the validator is behaving correctly.

The idea is that this test will pass validation with the state db's
deterministic flag set, but fail without it set.

Related to: NIT-3068
This is just to make sure that the test is implemented as it was specified in
the issue.
The previous bigmap branch was based off of main instead of pre-bold. This
should make it so that the bigmap is the only contract that has been added since
the pre-bold pin.

Related to NIT-3068
By removing one of the two methods on the contract, it simplifies the code, but
makes for a slight bump in the gas needed.

Part of: NIT-3068
system_tests/storage_trie_test.go Outdated Show resolved Hide resolved
system_tests/storage_trie_test.go Outdated Show resolved Hide resolved
@eljobe eljobe requested a review from PlasmaPower February 7, 2025 11:53
Copy link
Contributor

@PlasmaPower PlasmaPower left a comment

Choose a reason for hiding this comment

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

LGTM

This is what CI is configured to check.
According to Harry Ng in Slack, v2-main is the new pre-bold
eljobe added a commit that referenced this pull request Feb 10, 2025
This will immediately start failing once it's merged in, but, then we should be
able to merge in #2914 which (in
addition to adding the test, also sets the pin for the contracts submodule to
v2-main.)
@eljobe eljobe merged commit 94943f4 into master Feb 11, 2025
16 checks passed
@eljobe eljobe deleted the storage-trie-test branch February 11, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants