Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Task model and construction committor/src/tasks/*, committor/src/intent_executor/utils.rs |
Task and TaskBuilder replace the base-task trait and builder APIs. Task creation, validation, and transaction utility functions use Task. Buffer preparation and cleanup types are renamed, and cleanup limits are constants. |
Strategy planning and transaction preparation committor/src/tasks/task_strategist.rs, committor/src/transaction_preparator/*, committor/src/intent_executor/test_utils.rs |
TransactionStrategy stores tasks in tasks. Planning and preparation use Task, BufferPreparation, and BufferCleanup. Cleanup batches use the declared transaction-count and compute-unit constants. |
Transaction execution and recovery committor/src/intent_executor/strategy_executor/*, committor/src/tasks/task_info_fetcher.rs, committor/src/intent_executor/executor.rs |
Execution and recovery use Task and TransactionExecutionError. CPI-limit handling splits work with split_for_follow_up. Nonce invalidation removes specified keys from the active and retiring caches. |
Intent interfaces and executor integration committor/src/intent_engine/*, committor/src/intent_executor/*, committor/src/outbox/*, committor/src/service.rs, committor/src/lib.rs |
The backlog storage API accepts batches. Intent execution and reporting use TransactionExecutionError; close_intent and selected crate re-exports are removed. The service uses ProdChainlink directly. |
Priority:
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Refactor
Possibly related issues
- magicblock-labs/magicblock-validator#1840 — The change updates
TransactionStrategyand its task interface, but the issue’s execution-mode replacement remains outside this change. - magicblock-labs/magicblock-validator#1842 — The change adds
BufferCleanuprecords and cleanup limits, but does not include the full cleanup redesign.
Possibly related PRs
- magicblock-labs/magicblock-validator#1843 — This PR continues changes to the intent executor, recovery, client, task, and error interfaces.
- magicblock-labs/magicblock-validator#1769 — This PR continues the transaction-execution refactor and updates task and error interfaces.
- magicblock-labs/magicblock-validator#1847 — This PR changes the same transaction and recovery modules and uses the task-based execution flow.
Suggested reviewers: bmuddha
Merge Risk: 
Minimal · previous review a4fe0
-
No actionable issue is established for these changes. They are mergeable after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title "refactor(committor): simplify tasks and remove unused interfaces" matches the main change. The PR replaces the task and builder traits with concrete
TaskandTaskBuildertypes, renames helpers, and removes unused interfaces such asclose_intent,ResetType, andTasksBuilder. The scope prefix names the affected crate. The title is concise and specific.
Full details: Description check
-
Explanation
The description states that the PR replaces the task and builder traits with concrete
TaskandTaskBuildertypes, renames buffer and recovery helpers, removes unused interfaces, and stops revisiting tasks already converted to buffer delivery. It also notes the scheduler and task test consolidation and the Rust API name changes. This relates directly to the changeset.
-
-
Finishing Touches: 💡 2
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
The task enum already selects the concrete instruction implementation, and TaskBuilder has no alternate implementation. Remove their traits and put the methods directly on Task, CommitFinalizeTask, and TaskBuilder. This also removes async-trait boxing from task construction. Use names that describe the current responsibilities: CommitInputs, BufferPreparation, BufferCleanup, TransactionExecutionError, try_use_buffer, split_for_follow_up, and finalize_legacy_commit. Rename TransactionStrategy.optimized_tasks to tasks because a strategy can keep inline tasks unchanged. Remove unused transaction assembly, outbox close, and single-item backlog interfaces, the committor Chainlink alias, and unused changeset re-exports. Keep the program's outbox close instruction and the existing completion notification path. Replace the nonce reset enum with invalidate_nonces, which still removes selected keys from both active and retiring caches. Stop measuring and reinserting a task after switching it to buffer delivery: that conversion can happen only once. Continue recalculating the transaction size after every conversion and processing the largest remaining instructions first. Express the existing buffer cleanup limits as constants and remove redundant return bindings and the one-use error classification wrapper. Update existing tests only for the changed APIs. Keep instruction formats, resource limits, recovery behavior, callback checks, and metric labels. Validation: - cargo fmt - cargo check -p magicblock-committor-service --tests - cargo clippy --workspace --all-targets -- -D warnings - cargo test -p magicblock-committor-service test_optimize_strategy_prioritizes_largest_tasks -- --nocapture
Merge the callback tests, undelegation test, and standalone buffer-limit test into one tasks test module with shared imports. Merge the scheduler's seven test modules into one and replace six identical setup helpers with a single helper. Keep the shared intent bundle factory at its existing scope for callers in other modules. Preserve all 25 test functions, assertions, and setup calls. This removes 76 lines without changing production code. Validation: - cargo fmt - cargo check -p magicblock-committor-service --tests - cargo test -p magicblock-committor-service test_callback_destination_bound_to_recorded_source -- --nocapture
Move create_test_intent_bundle above the consolidated tests module to satisfy Clippy's items_after_test_module lint. Keep the helper at the same module scope so its callers retain their existing imports. The helper body and test behavior are unchanged. Validation: - cargo fmt - cargo check -p magicblock-committor-service --tests - cargo clippy -p magicblock-committor-service --all-targets -- -D warnings - cargo test -p magicblock-committor-service test_completion_unblocks_intents -- --nocapture
a40634c to
066c7b5
Compare
What changed
Replace the task and builder traits with concrete
TaskandTaskBuildertypes. Give buffer and recovery helpers clearer names, remove unused interfaces, and stop revisiting tasks already converted to buffer delivery.Consolidate the task and scheduler test modules, sharing imports and setup while preserving all tests.
Closes #1850.
Impact
This changes Rust API names in the committor crate. Transaction formats, execution behavior, and resource limits stay the same.