Skip to content

fix(protocol): validate storage slot type at account creation - #3608

Merged
mmagician merged 10 commits into
nextfrom
mmagician-claude/fix-l11-slot-type-validation
Aug 21, 2026
Merged

fix(protocol): validate storage slot type at account creation#3608
mmagician merged 10 commits into
nextfrom
mmagician-claude/fix-l11-slot-type-validation

Conversation

@mmagician

@mmagician mmagician commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Validates every storage slot's type against the supported set (value or map) during new-account validation, and makes commit_slot_patch reject an unrecognized slot type instead of silently defaulting it to map.

Prevents an unrecognized slot type from being committed into the account patch.

Closes #3598

@mmagician
mmagician force-pushed the mmagician-claude/fix-l11-slot-type-validation branch 2 times, most recently from 740e723 to c68db27 Compare August 17, 2026 12:40
claude added 2 commits August 17, 2026 14:14
…l11-slot-type-validation

# Conflicts:
#	crates/miden-protocol/asm/kernels/transaction-core/src/account.masm
#	crates/miden-testing/src/kernel_tests/tx/test_account.rs
@mmagician
mmagician requested a review from zeapoz August 19, 2026 11:42
@mmagician
mmagician marked this pull request as ready for review August 19, 2026 11:42

@zeapoz zeapoz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good!

Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/account.masm Outdated
@mmagician
mmagician requested a review from Fumuran August 19, 2026 14:19

@bobbinth bobbinth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! Thank you! I left one comment inline.

Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/account.masm Outdated
… loop

Merge the separate validate_storage_slot_types pass into the main
validate_storage loop so storage is validated in a single pass over the
slots, per review feedback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mmagician
mmagician requested a review from bobbinth August 20, 2026 12:35
@mmagician
mmagician added this pull request to the merge queue Aug 20, 2026
@mmagician
mmagician removed this pull request from the merge queue due to a manual request Aug 20, 2026

@bobbinth bobbinth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! Thank you!

bobbinth and others added 2 commits August 20, 2026 16:06
validate_storage mixed the two accessor families: the slot count and the
slot IDs resolved through the active account, while the slot type was read
from the native account. Only the native account's storage is validated this
way, so take every read from the native account.

get_native_slot_id already existed and is identical to get_slot_id apart from
the accessor, and validate_storage was get_slot_id's only caller, so drop the
duplicate.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/account.masm Outdated

@partylikeits1983 partylikeits1983 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great!

@mmagician
mmagician added this pull request to the merge queue Aug 21, 2026
Merged via the queue into next with commit 97e9575 Aug 21, 2026
19 checks passed
@mmagician
mmagician deleted the mmagician-claude/fix-l11-slot-type-validation branch August 21, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

L-11: Storage Slot Type Is Not Constrained to Supported Values

5 participants