QueueMapper leak test, VM account access refactor#2411
Open
andrei-marinica wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens the scenario/VM storage access layer by introducing AccountData::{storage_get, storage_set} and refactoring call sites to use them, while also adding a regression test intended to ensure QueueMapper::clear() does not leave residual metadata in storage.
Changes:
- Add
AccountData::storage_get()/storage_set()and switch multiple VM/scenario code paths away from directaccount.storagemap manipulation. - Make empty writes remove the key (
storage_set(..., b"")⇒remove) to better model “delete” semantics. - Add a
QueueMapper::clear()leak regression test for the.infoslot.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| framework/scenario/tests/test_queue_mapper.rs | Adds a regression test around QueueMapper::clear() storage cleanup. |
| framework/scenario/tests/single_tx_api_test.rs | Refactors the test to use AccountData::{storage_get, storage_set}. |
| framework/scenario/src/scenario/run_vm/check_state.rs | Uses storage_get() for expected storage checks. |
| framework/scenario/src/api/impl_vh/vh_single_tx_api.rs | Routes VM hook storage reads/writes through storage_get() / storage_set(). |
| chain/vm/src/host/vm_hooks/vh_tx_context.rs | Routes VM hook storage reads/writes through storage_get() / storage_set(). |
| chain/vm/src/blockchain/state/blockchain_state.rs | Uses storage_get() / storage_set() for validator reward storage updates. |
| chain/vm/src/blockchain/state/account_data.rs | Introduces the new storage access helpers and “empty write removes key” behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Contract comparison - from 94b6d59 to 55ee27d
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request overview
This PR tightens the scenario/VM storage access layer by introducing
AccountData::{storage_get, storage_set}and refactoring call sites to use them, while also adding a regression test intended to ensureQueueMapper::clear()does not leave residual metadata in storage.Changes:
AccountData::storage_get()/storage_set()and switch multiple VM/scenario code paths away from directaccount.storagemap manipulation.storage_set(..., b"")⇒remove) to better model “delete” semantics.QueueMapper::clear()leak regression test for the.infoslot.