fix(committor): report shared signature on single-stage finalize failure - #1493
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughSingle-stage finalize errors now use Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
magicblock-committor-service/src/intent_executor/error.rsmagicblock-committor-service/src/intent_executor/single_stage_executor.rs
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.
a65b427 to
cac7f16
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
magicblock-committor-service/src/intent_executor/error.rsmagicblock-committor-service/src/intent_executor/single_stage_executor.rs
…ng retry Keep commit_signature None for single-stage finalize failures so transient errors like BlockhashNotFound remain retryable. Expose the shared tx signature via signatures() when only finalize_signature is present.
Summary
Single-stage intent execution commits and finalizes in a single transaction. On the success path,
commit_persister::finalize_base_intentalready stores the same signature for both stages ((signature, signature)).On failure,
SingleStageExecutorpassedcommit_signature: Noneintofrom_finalize_execution_error, soIntentExecutorError::signatures()returnedNoneeven 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_signatureSummary by CodeRabbit
Bug Fixes
Tests