feat: protect authoritative accounts from overwrites - #37
Merged
Conversation
This was referenced Aug 5, 2026
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
bmuddha
force-pushed
the
authoritative-flag
branch
from
August 5, 2026 11:57
3080bb3 to
2a0c67f
Compare
bmuddha
marked this pull request as ready for review
August 5, 2026 11:57
bmuddha
force-pushed
the
authoritative-flag
branch
3 times, most recently
from
August 5, 2026 12:50
b451f22 to
c61b395
Compare
bmuddha
force-pushed
the
authoritative-flag
branch
from
August 5, 2026 13:26
c61b395 to
9bda1be
Compare
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 changed
AUTHORITATIVEand remove the compressed-account builder API without changing the serialized account layout.PrivilegeEscalation.PostFinalizeonly immediately after the matching successfulFinalizeat the same stack height and caller.Closes #35, closes #36
Impact
Finalized delegated and transient accounts can no longer be overwritten by a higher-slot replacement, including through builtin CPI callers. Read-only, placeholder, system, ephemeral, and closed targets are not automatically marked authoritative. Existing persisted bit 1 values are intentionally reinterpreted; no migration or wire-layout change is introduced.
Validation
cargo test -p solana-account— passedcargo test -p solana-transaction-context— passedcargo test -p magic-root-program— passedcargo test -p magicblock-engine --test accounts— passedcargo test -p magicblock-engine --test security— passedcargo test --workspace— passedgit diff --check— passedReviewer notes
The ordering-sensitive boundary is in MagicRoot target authorization: the authoritative flag is applied only after executable loading succeeds, and the
PostFinalizeexception matches the immediately preceding trace entry by program, target, stack height, and caller.