Skip to content

fix(committor): propagate tx assembly errors in prepare_for_strategy - #1492

Open
crazywriter1 wants to merge 7 commits into
magicblock-labs:masterfrom
crazywriter1:fix/committor-transaction-preparator-panic
Open

fix(committor): propagate tx assembly errors in prepare_for_strategy#1492
crazywriter1 wants to merge 7 commits into
magicblock-labs:masterfrom
crazywriter1:fix/committor-transaction-preparator-panic

Conversation

@crazywriter1

@crazywriter1 crazywriter1 commented Jul 27, 2026

Copy link
Copy Markdown

Summary

TransactionPreparatorImpl::prepare_for_strategy used .expect() when assembling the final transaction message. A prior feasibility check runs against dummy lookup tables, so assembly can still fail with the real prepared data — causing the committor worker to panic.

This change replaces .expect() with ? so assembly failures are propagated as errors instead of panicking.

Fixes #1018

Test plan

  • cargo check -p magicblock-committor-service
  • cargo test -p magicblock-committor-service

Summary by CodeRabbit

  • Bug Fixes
    • Transaction preparation now reports message assembly errors gracefully instead of terminating unexpectedly.
    • Improved error propagation allows callers to handle failed transaction preparation safely.

@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: 7f56741d-bbce-4e89-96af-828b89c2919b

📥 Commits

Reviewing files that changed from the base of the PR and between e5119fa and 154b61b.

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

📝 Walkthrough

Walkthrough

TransactionPreparatorImpl::prepare_for_strategy now propagates TransactionUtils::assemble_tasks_tx errors through PreparatorResult using ?. Successful assembly continues to extract the VersionedMessage.

Assessment against linked issues:

Objective Addressed Explanation
Propagate transaction assembly errors instead of panicking in prepare_for_strategy [#1018]

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.

Replace .expect() with ? so assembly failures return an error instead
of panicking the committor worker.
Fixes magicblock-labs#1018
@crazywriter1
crazywriter1 force-pushed the fix/committor-transaction-preparator-panic branch from b250004 to e5119fa Compare July 28, 2026 07:14
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.

Transaction preparation can panic in committor workers

4 participants