Skip to content

fix(committor): report shared signature on single-stage finalize failure - #1493

Open
crazywriter1 wants to merge 8 commits into
magicblock-labs:masterfrom
crazywriter1:fix/single-stage-shared-signature-on-failure
Open

fix(committor): report shared signature on single-stage finalize failure#1493
crazywriter1 wants to merge 8 commits into
magicblock-labs:masterfrom
crazywriter1:fix/single-stage-shared-signature-on-failure

Conversation

@crazywriter1

@crazywriter1 crazywriter1 commented Jul 27, 2026

Copy link
Copy Markdown

Summary

Single-stage intent execution commits and finalizes in a single transaction. On the success path, commit_persister::finalize_base_intent already stores the same signature for both stages ((signature, signature)).

On failure, SingleStageExecutor passed commit_signature: None into from_finalize_execution_error, so IntentExecutorError::signatures() returned None even when the failed transaction had a signature. This made downstream error reporting inconsistent with the success path.

This change passes err.signature() as the commit signature on single-stage failures, matching the success-path semantics.

Test plan

  • cargo test -p magicblock-committor-service single_stage_finalize_failure_reports_shared_signature

Summary by CodeRabbit

  • Bug Fixes

    • Improved error reporting for failed single-stage executions by consistently preserving the transaction signature across execution and finalization errors.
    • Classified deterministic single-stage failures as non-transient for more reliable handling.
  • Tests

    • Added coverage for shared signature reporting and non-transient failure classification.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 457e5e59-5455-435f-ae03-fac839c791fa

📥 Commits

Reviewing files that changed from the base of the PR and between cac7f16 and 5be4d31.

📒 Files selected for processing (1)
  • magicblock-committor-service/src/intent_executor/error.rs

📝 Walkthrough

Walkthrough

Single-stage finalize errors now use single_stage_finalize_execution_error. Finalize-only errors expose their signature in both commit and finalize fields. Tests cover deterministic and blockhash-not-found failures.

Suggested reviewers: taco-paco, gabrielepicco

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@magicblock-committor-service/src/intent_executor/error.rs`:
- Around line 659-684: Update the test
single_stage_finalize_failure_reports_shared_signature to exercise the
SingleStageExecutor failure path rather than passing Some(signature) directly to
IntentExecutorError::from_finalize_execution_error. Ensure the scenario derives
the signature through the executor’s err.signature() propagation and still
verifies both reported signatures and non-transient status.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d0199472-25e6-49f4-b527-84df7c795e88

📥 Commits

Reviewing files that changed from the base of the PR and between 3838992 and 4289c88.

📒 Files selected for processing (2)
  • magicblock-committor-service/src/intent_executor/error.rs
  • magicblock-committor-service/src/intent_executor/single_stage_executor.rs

Comment thread magicblock-committor-service/src/intent_executor/error.rs
@GabrielePicco
GabrielePicco requested a review from taco-paco July 31, 2026 03:58
Single-stage commit+finalize share one transaction; on failure pass the
same signature for commit and finalize so error reporting matches the
success path in commit_persister.
Extract single_stage_finalize_execution_error so the unit test covers
the same mapping SingleStageExecutor uses in production.
@crazywriter1
crazywriter1 force-pushed the fix/single-stage-shared-signature-on-failure branch from a65b427 to cac7f16 Compare July 31, 2026 08:22

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@magicblock-committor-service/src/intent_executor/error.rs`:
- Around line 136-140: Update single_stage_finalize_execution_error and the
related FailedToFinalizeError classification so a signature is retained for
signatures() without implying that the transaction committed; store explicit
single-stage or commit-landed state and have IntentExecutorError::is_transient()
use that state. Add a BlockhashNotFound regression case to the existing
finalize-error test and assert the wrapped error remains transient.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3c1078e9-db18-4d30-88e5-38de9e22421a

📥 Commits

Reviewing files that changed from the base of the PR and between 3990dea and cac7f16.

📒 Files selected for processing (2)
  • magicblock-committor-service/src/intent_executor/error.rs
  • magicblock-committor-service/src/intent_executor/single_stage_executor.rs

Comment thread magicblock-committor-service/src/intent_executor/error.rs Outdated
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.

3 participants