magicblock-labs / magicblock-labs/magicblock-validator

Recover commits whose finalize stage times out

Open
#1,370 0 comments 0 reactions 1 assignee View on GitHub

@snawaz is already working on this.

Since Sep 9, 2026.

Dominant language
Rust
Stars
58
Forks
58
Avg merge
22h 1m
Merged PRs (30d)
53

Description

## Outcome

Recover commits whose finalize stage times out.

## Scope

**Problem**
The committor can leave accounts stuck when a two-stage commit reaches base layer but the finalize stage fails or times out before the validator observes a processed status.

Observed failure shape:
- Commit stage succeeds and initializes DLP commit-state records.
- Finalize stage returns `FailedToFinalizeError` / `CannotGetTransactionSignatureStatus`.
- Rows are persisted as `FailedFinalize`.
- The runtime execution worker completes the intent and unblocks the account set instead of retrying the finalize stage.
- On restart, recovery only reloads pending rows, so `FailedFinalize` rows can remain stranded.

For affected undelegations, later direct undelegate attempts can fail because the commit-state PDA already exists, while the account was never finalized/undelegated.

**Example**
For account `CqP3QW6MtCpEuVuySshx5XzdN1JnsE5sbWQfPQhxNLi9`, the commit stage landed, but the finalize stage timed out and the committor DB recorded `FailedFinalize`. The account remained stuck.

**Expected behavior**
- `FailedFinalize` rows should be recoverable after restart.
- Runtime execution should retry the finalize-stage recovery path instead of treating the intent as done.
- Retrying a `FailedFinalize` row must not rebuild or resend the commit-stage transaction; it should reuse the recorded commit-stage state and continue with finalize/undelegate work.
- Repeated finalize retry failures should preserve `FailedFinalize` status rather than downgrading the row to a generic failed-process state.

## Acceptance criteria

- [ ] The outcome is implemented and validated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.