Skip to content

feat(direct): Implement CommitFinalize - #262

Open
snawaz wants to merge 2 commits into
snawaz/delegatefrom
snawaz/commit-finalize
Open

snawaz wants to merge 2 commits into
snawaz/delegatefrom
snawaz/commit-finalize

Conversation

@snawaz

@snawaz snawaz commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Implements the primary CommitFinalize instruction for Direct clusters. It applies inline full-account data or an encoded diff atomically with lamport settlement, commit ordering, owner validation, and undelegation state updates. Legacy finalization remains unchanged.

Closes #191

Add the primary Direct-cluster instruction, wire layout, and builder for committing inline full-state or diff payloads.

Authorize the cluster's current validator, validate DelegationState ordering and undelegation rules, settle lamports, apply the update without temporary state accounts, and advance the delegation state atomically.

Cover full data, aligned zero-copy diffs, authority, owner, cluster mode, commit ordering, and owner-requested undelegation in SBF tests.
@snawaz
snawaz added this pull request to stack #264 October 21, 2026 20:39
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: magicblock-labs/delegation-program/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: af2b89cc-c15e-49c3-8478-3c81b3977eb1
📥 Commits

Reviewing files that changed from the base of the PR and between 492fdf6 and 47d463f.

📒 Files selected for processing: 11
  • interface/src/args/commit_finalize.rs
  • interface/src/args/mod.rs
  • interface/src/instruction.rs
  • interface/src/instruction_builder/commit_finalize.rs
  • interface/src/instruction_builder/mod.rs
  • program/src/processor/direct/commit_finalize.rs
  • program/src/processor/direct/mod.rs
  • program/src/processor/internal/commit_finalize.rs
  • program/src/processor/internal/mod.rs
  • program/src/processor/mod.rs
  • program/tests/test_primary_commit_finalize.rs
  • 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.

@snawaz
snawaz marked this pull request as ready for review October 21, 2026 20:40
Place the reusable commit/finalize state transition under processor/internal so instruction modules depend on common processor machinery instead of sibling processor modules.

This branch has not been deployed

No deployments
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.

Implement CommitFinalize for Direct clusters

2 participants