Skip to content

fix: distinguish repeated private account mutations - #187

Merged
bmuddha merged 1 commit into
masterfrom
fix/private-mutation-nonce
Oct 23, 2026
Merged

bmuddha merged 1 commit into
masterfrom
fix/private-mutation-nonce

Conversation

@bmuddha

@bmuddha bmuddha commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

What changed

Materializing an account, deleting it, and materializing the same image before the blockhash changes can produce the same signed transaction. Signature deduplication then rejects necessary work as AlreadyProcessed.

Append a random u64 nonce as a signed MagicRoot no-op to distinguish separate private account mutations within one blockhash lifetime.

Related to magicblock-validator#1813. This covers Engine's account mutations; the scheduler's base-chain transaction builder is unchanged.

Impact

Each private mutation gains one built-in instruction. The nonce variant is appended to the MagicRoot enum, leaving existing instruction discriminants unchanged. Validator and verifier must both consume the updated Engine to replay these transactions.

@bmuddha bmuddha added the bug Something isn't working label Oct 23, 2026
@bmuddha bmuddha self-assigned this Oct 23, 2026
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 1bcb0bd and 3f52268.

⛔ Files ignored due to path filters: 1
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing: 5
  • engine/Cargo.toml
  • engine/src/accessor.rs
  • engine/src/transaction.rs
  • programs/magic-root-interface/src/lib.rs
  • programs/magic-root-program/src/processor.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The magic-root interface adds a nonce instruction, and the processor handles it as a successful no-op after target-account lookup. The engine appends an authority-composed random nonce to private transactions and checks instruction-trace and account-lock limits. Accessor execution now passes owned instruction vectors.

Priority: ➖ Normal

Change: Bug fix

Merge Risk: 🔵 Low · up to 3f522

At the exact trace-capacity boundary, some private transactions with nested actions may now fail; this is a narrow follow-up risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly describes the main change: distinguishing repeated private account mutations.
Description check Passed The description directly explains the duplicate-signature problem, the nonce-based fix, its impact, and related issue.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (1 skipped: 1 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bmuddha
bmuddha marked this pull request as ready for review October 23, 2026 11:23
@bmuddha
bmuddha merged commit a8a7a50 into master Oct 23, 2026
13 checks passed
@bmuddha
bmuddha deleted the fix/private-mutation-nonce branch October 23, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant