fix(store): invalidate storage map values on slot recreation - #2504
Open
wodesiku wants to merge 1 commit into
Open
fix(store): invalidate storage map values on slot recreation#2504wodesiku wants to merge 1 commit into
wodesiku wants to merge 1 commit into
Conversation
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.
What does this PR do?
Invalidates stale SQLite storage-map value rows when a storage-map slot is removed or recreated.
Related Issue
Follow-up to #2328 and the previously closed #2378; the current protocol patch API now exposes the required
Create/Removeoperations.Root Cause
The account upsert path updated account and storage-header rows, but
prepare_partial_account_updatedid not close existingaccount_storage_map_valuesrows forStorageMapPatch::RemoveorCreate. Those rows retainedvalid_until = VALID_FOREVER, so removed values could be returned as current data and recreated slots could inherit stale keys.Changes Made
CreateandRemoveoperations.How to Test
cargo test --locked -p miden-node-store optimized_delta_removes_storage_map_values --libcargo test --locked -p miden-node-store storage_map_remove_resets_forest_lineage_for_later_create --libBoth commands were attempted on native Windows. Local execution is blocked before tests by existing environment/toolchain issues:
miden-core-libcannot resolvemod.masm,librocksdb-syscannot findlibclang.dll, and the proto build script reports a duplicated Windows include path forremote_prover.proto. No test assertion failure was observed.Scope
Cargo.lockunchanged.