-
Notifications
You must be signed in to change notification settings - Fork 200
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
Test for multiple writes/reads to the same storage slot #2874
base: master
Are you sure you want to change the base?
Test for multiple writes/reads to the same storage slot #2874
Conversation
Hi @beeguy74 👋, |
hi @franciszekjob ! I think i finished here. But I'm not sure it's necessary to change the documentation and changelog. Thank you in advance! |
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.
Overall looks good 😄 , please see my nits.
crates/cheatnet/tests/cheatcodes/multiple_writes_same_storage.rs
Outdated
Show resolved
Hide resolved
crates/cheatnet/tests/cheatcodes/multiple_writes_same_storage.rs
Outdated
Show resolved
Hide resolved
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.
Please, show that these tests fail in the modified state
Hi @kkawula! As far the tests pass in both states: modified or not |
So, guys. You want me to achieve a test failing? |
Hi @beeguy74 , let me check why these tests don't fail. Will update you. |
It would help me a lot if you gave me another assignment, sir, while I'm blocked here. For example, I applied for another test issue. Can you assign me please? |
@beeguy74 in fact, the repro steps in issue description were a bit misleading. The tests should pass in both cases (so it's ok as it is now), apologies for little inconvenience. |
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.
Please fix formatting 🙏
5bca80a
to
826ed59
Compare
Closes #1559
Introduced changes
I modified locally :
storage_view
field to map only StorageKey to feltScreenshot of modified `crates/runtime/src/starknet/state.rs`
And created two test cases which ensure that writes to the storage across multiple contracts with same ClassHash and storage key is not possible inside
crates/cheatnet/tests/cheatcodes/multiple_writes_same_storage.rs
:same_storage_access_call_contract
- Verifies that the two deployed contracts with same class_hash have different addresses and demonstrates modification and access to storage variablebalance
withcall_contract
methodsame_storage_access_store
- does same routine but uses custom implementations for storage operationsstore
andload
instead ofcall_contract
to access to storageChecklist
CHANGELOG.md