Skip to content

Resent two-stage commits can strand undelegation #1732

Open

Description

@GabrielePicco

Problem

A two-stage commit-and-undelegate intent can fail permanently when the commit-stage transaction lands but its confirmation is missed. The resend fails with AlreadyUndelegated (Custom(11)); the committor treats that error as terminal and never sends the finalize stage. The account remains on base, owned by the delegation program, with the commit pending.

DLP sets undelegation_requester = Validator during the commit stage but advances last_commit_id only at finalize. The resend therefore still passes the commit-ID check before hitting AlreadyUndelegated. The committor currently recognizes other recoverable commit errors, but not this one. The first send landing before the resend is inferred from these semantics, not directly visible in the logs.

Reproduction

Intermittently occurs in the examples CI rock-paper-scissor flow, which commits and undelegates three accounts in one intent. Have the first commit-stage send land without observing its confirmation, then resend it. The intent fails with FailedToCommitError wrapping InstructionError(2, Custom(11)).

Expected

When AlreadyUndelegated follows our own already-landed commit, the committor should recognize the pending commit and continue to finalize. The delegation metadata must show undelegation_requester == Validator and last_commit_id == commit_id - 1; otherwise the error should remain a failure. Finalizing and retrying the commit through the existing unfinalized-account recovery path does not resolve this case, because the requester remains Validator until undelegation.

Context

Observed on Linux x86_64 in GitHub Actions with master at e66d91476; also present in release 0.14.10. The relevant recovery paths are in magicblock-committor-service/src/intent_executor/error.rs and two_stage_executor.rs.

Activity

  1. changed the title [-]bug: committor fails two-stage intent on AlreadyUndelegated after a resent commit[/-] [+]Resent two-stage commits can strand undelegation[/+] on Sep 27, 2026
  2. removed
    needs-template-fixIssue title or required template sections need correction
    on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions