Skip to content

fix(protocol): assert reserved account state elements are zero at creation - #3609

Merged
mmagician merged 6 commits into
mmagician-claude/fix-l11-slot-type-validationfrom
mmagician-claude/fix-l12-reserved-elements-validation
Aug 21, 2026
Merged

fix(protocol): assert reserved account state elements are zero at creation#3609
mmagician merged 6 commits into
mmagician-claude/fix-l11-slot-type-validationfrom
mmagician-claude/fix-l12-reserved-elements-validation

Conversation

@mmagician

@mmagician mmagician commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Enforces that the account's two reserved elements are zero at account creation, so advice-provider data can no longer inject arbitrary values into the account commitment

Closes #3599

@mmagician
mmagician force-pushed the mmagician-claude/fix-l12-reserved-elements-validation branch 2 times, most recently from 7671230 to 6ca06ce Compare August 17, 2026 12:40
@mmagician
mmagician requested a review from zeapoz August 19, 2026 14:17
@mmagician
mmagician marked this pull request as ready for review August 19, 2026 14:17
@mmagician
mmagician requested a review from Fumuran August 19, 2026 14:19
Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/account.masm Outdated
Comment thread crates/miden-protocol/src/account/storage/header.rs Outdated
Comment thread crates/miden-protocol/src/account/header.rs Outdated
@mmagician
mmagician changed the base branch from next to mmagician-claude/fix-l11-slot-type-validation August 20, 2026 12:19
@mmagician
mmagician force-pushed the mmagician-claude/fix-l12-reserved-elements-validation branch from 413f716 to 58d935d Compare August 20, 2026 12:46
@mmagician
mmagician requested a review from zeapoz August 20, 2026 13:05

@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.

LGTM! 👍

@bobbinth
bobbinth force-pushed the mmagician-claude/fix-l12-reserved-elements-validation branch from 58d935d to 9b8bd6a Compare August 20, 2026 23:08

@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 a comment about a potential issue - though it is from the base PR.

Comment on lines +1105 to +1108
pub proc get_account_reserved
exec.get_active_account_data_ptr add.ACCT_RESERVED_OFFSET
mem_load
end

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.

This is probably the element that would could use to keep track of the account versions.

Comment thread crates/miden-protocol/asm/kernels/transaction-core/src/account.masm
claude added 2 commits August 21, 2026 06:44
…native account

Both accessors introduced here resolve through the active account, but their
only callers validate a new native account: validate_new_account for the
account header word and validate_storage for the slot records. Read them from
the native account instead, so neither can be pointed at a foreign account.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…gician-claude/fix-l12-reserved-elements-validation

# Conflicts:
#	crates/miden-protocol/asm/kernels/transaction-core/src/account.masm

@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 good!

@mmagician
mmagician added this pull request to the merge queue Aug 21, 2026
Merged via the queue into next with commit 1f4e2c3 Aug 21, 2026
19 checks passed
@mmagician
mmagician deleted the mmagician-claude/fix-l12-reserved-elements-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-12: Reserved Account State Elements From Advice Are Not Constrained at Creation

5 participants