Skip to content

bug(committor): potential panic in TransactionPreparatorImpl::prepare_for_strategy #1018

@vikions

Description

@vikions

Report

What happened:
In magicblock-committor-service/src/transaction_preparator/mod.rs at line 106, there is a .expect() call that can cause a runtime panic in committor workers:

let message = TransactionUtils::assemble_tasks_tx(
    authority,
    &tx_strategy.optimized_tasks,
    self.compute_budget_config.compute_unit_price,
    &lookup_tables,
)
.expect("Possibility to assemble checked above")
.message;

Expected:
Error should be propagated via ? through the existing PreparatorResult error path instead of panicking.

Repro:
The lookup tables passed to the second assemble_tasks_tx call may differ from the first check at line 86, making the assumption in .expect() not strictly guaranteed.

Logs/links:
https://github.com/magicblock-labs/magicblock-validator/blob/master/magicblock-committor-service/src/transaction_preparator/mod.rs#L106

I'd like to work on this fix if no one is assigned yet.

Commit / version

master

Environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions