-
Notifications
You must be signed in to change notification settings - Fork 106
test(l1): add storage slot reorg test #4652
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
base: main
Are you sure you want to change the base?
Conversation
Lines of code reportTotal lines added: Detailed view
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a storage slot reorg test to verify that contract storage state is properly handled during blockchain reorganizations. The test deploys a simple contract that sets storage slots based on calldata parameters and verifies that different storage values are correctly maintained across divergent chains.
Key changes:
- Enhanced simulator with test-specific data directory structure and contract deployment/interaction methods
- Added new reorg test that verifies storage slot consistency across chain forks
- Added utility methods for contract deployment and storage querying
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
tooling/reorgs/src/simulator.rs | Added test name parameter, contract interaction methods, and test-specific data directories |
tooling/reorgs/src/main.rs | Added new storage slot reorg test function and integrated it into test runner |
Comments suppressed due to low confidence (1)
tooling/reorgs/src/simulator.rs:1
- [nitpick] The calldata construction using
to_big_endian()
andconcat()
creates intermediate allocations. Consider using a more efficient approach like pre-allocating a 64-byte array and copying the values directly.
use std::{fs::File, io::Read, path::PathBuf, process::Stdio, time::Duration};
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Blocked by #4620Motivation
The main components of chain state are account balance and contract storage. Testing reorgs affect those as expected is important.
Description
This PR adds a reorg test using a simple contract that sets a storage slot as received by calldata.
NOTE: this is currently failing due to issues with full-sync header requests