Skip to content

Conversation

@bmuddha
Copy link
Contributor

@bmuddha bmuddha commented Dec 2, 2025

Summary by CodeRabbit

  • Chores
    • Updated Rust toolchain to 1.91.1 across CI and project configs.
  • Refactor
    • Standardized error boxing and explicit conversion across components for consistent error propagation.
    • Added/adjusted lifetime annotations on several APIs and iterators; replaced some arithmetic/overflow patterns with safer APIs for clarity.
  • Tests
    • Updated tests to match refactors and added lint suppressions for large Result error types.
  • Documentation
    • Minor doc-comment formatting and clarity tweaks.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

Manual Deploy Available

You can trigger a manual deploy of this PR branch to testnet:

Deploy to Testnet 🚀

Alternative: Comment /deploy on this PR to trigger deployment directly.

⚠️ Note: Manual deploy requires authorization. Only authorized users can trigger deployments.

Comment updated automatically when the PR is synchronized.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 2, 2025

📝 Walkthrough

Walkthrough

This PR updates the Rust toolchain to 1.91.1 and performs widespread API shape changes: many error enum variants now box inner errors and add explicit From impls (replacing #[from]); several function return types gained explicit lifetime annotations; a few arithmetic checks were replaced with is_multiple_of; unsafe NonZeroUsize::new_unchecked was replaced with safe NonZeroUsize::new(...).unwrap(); a test scaffold was removed; plus minor CI/workflow and doc-formatting tweaks. No new runtime features introduced.

Possibly related PRs

Suggested reviewers

  • thlorenz
  • GabrielePicco
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bmuddha/chore/toolchain-bump

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 and usage tips.

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

❌ Failed to trigger deploy for branch ``. Make sure you have permission or use the manual deploy link in the PR comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (6)
tools/ledger-stats/src/transaction_details.rs (1)

53-64: Remove unnecessary nested braces in else blocks.

The refactored conditional blocks contain redundant inner braces that create unnecessary nesting and reduce readability. The double closing braces (} }) on lines 62, 75, and 87 indicate an extra block expression that should be removed.

Apply this diff to remove the unnecessary braces:

     let pre_token_balances =
         status_meta.pre_token_balances.as_ref().map_or_else(
             || "None".to_string(),
             |b| {
-                if b.is_empty() { "None".to_string() } else { {
+                if b.is_empty() {
+                    "None".to_string()
+                } else {
                     b.iter()
                         .map(|b| b.ui_token_amount.amount.to_string())
                         .collect::<Vec<_>>()
                         .join(" | ")
-                } }
+                }
             },
         );

     let post_token_balances =
         status_meta.post_token_balances.as_ref().map_or_else(
             || "None".to_string(),
             |b| {
-                if b.is_empty() { "None".to_string() } else { {
+                if b.is_empty() {
+                    "None".to_string()
+                } else {
                     b.iter()
                         .map(|b| b.ui_token_amount.amount.to_string())
                         .collect::<Vec<_>>()
                         .join(" | ")
-                } }
+                }
             },
         );

     let rewards = status_meta.rewards.as_ref().map_or_else(
         || "None".to_string(),
         |r| {
-            if r.is_empty() { "None".to_string() } else { {
+            if r.is_empty() {
+                "None".to_string()
+            } else {
                 r.iter()
                     .map(|r| r.lamports.to_formatted_string(&Locale::en))
                     .collect::<Vec<_>>()
                     .join(" | ")
-            } }
+            }
         },
     );

Also applies to: 66-77, 79-89

tools/ledger-stats/src/accounts.rs (1)

126-151: Owner filter semantics look good; consider avoiding variable shadowing for clarity

The new is_none_or condition correctly preserves the previous behavior (no filter when owner is None, filter by equality when Some). To improve readability, avoid shadowing the outer owner by renaming the closure parameter:

-                if !owner.is_none_or(|owner| acc.owner.eq(&owner)) {
+                if !owner.is_none_or(|expected_owner| acc.owner.eq(&expected_owner)) {
programs/guinea/src/lib.rs (1)

157-165: Change is correct; prefer slice::from_ref over std::slice::from_ref for consistency

The switch to using from_ref is good and avoids the extra AccountInfo clone. Since the file already imports core::slice, it’s a bit cleaner (and more no_std‑friendly if that ever matters) to use that import instead of hard‑coding the std path:

-    invoke(&ix, std::slice::from_ref(payer_info))?;
+    invoke(&ix, slice::from_ref(payer_info))?;
magicblock-ledger/src/store/api.rs (1)

417-429: Doc comment tweaks are helpful; consider fixing a small typo

The added/reshaped docs for get_confirmed_signatures_for_address, write_transaction, and iter_transaction_statuses improve clarity and better explain parameter semantics and filtering; they align with the current implementations.

Minor nit while you’re here: there’s a typo just above the new Geyser note:

-    /// * `transaction` - Transaction to be written, we take a SanititizedTransaction here
+    /// * `transaction` - Transaction to be written, we take a SanitizedTransaction here

Fixing this will keep the documentation consistent with the actual SanitizedTransaction type.

Also applies to: 851-857, 1047-1050

magicblock-validator-admin/src/claim_fees.rs (1)

70-101: LGTM! Error boxing refactor is correct.

The error handling updates properly wrap the underlying RPC errors in Box to reduce Result type size, which is a standard Rust pattern. The async flow is safe and the logic correctly handles fee claiming.

Optional improvement:

Consider creating the RpcClient once and reusing it across invocations if the periodic task runs frequently, as establishing new connections on each tick may add unnecessary overhead:

pub fn start(&mut self, tick_period: Duration, url: String) {
    // ... existing checks ...
    
    let token = self.token.clone();
    let handle = tokio::spawn(async move {
        info!("Starting claim fees task");
        let rpc_client = RpcClient::new_with_commitment(url, CommitmentConfig::confirmed());
        let start_time = Instant::now() + tick_period;
        let mut interval = tokio::time::interval_at(start_time, tick_period);
        loop {
            tokio::select! {
                _ = interval.tick() => {
                    if let Err(err) = claim_fees_with_client(&rpc_client).await {
                        error!("Failed to claim fees: {:?}", err);
                    }
                },
                _ = token.cancelled() => break,
            }
        }
        info!("Claim fees task stopped");
    });
    self.handle = Some(handle);
}
magicblock-accounts/src/errors.rs (1)

60-71: Boxing CommittorServiceError in ScheduledCommitsProcessorError is sound; consider exposing inner error in Display

Storing CommittorServiceError as Box<...> and adding the From<CommittorServiceError> impl preserves ? conversions while aligning with the boxed-error pattern used elsewhere.

If you want easier debugging when this bubbles up, you could optionally change the message to include the inner error (e.g., "CommittorSerivceError: {0}") so logs show more than just the variant name.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 02fd8fe and 87cc0a2.

📒 Files selected for processing (39)
  • .github/workflows/ci-lint.yml (1 hunks)
  • .github/workflows/ci-test-integration.yml (1 hunks)
  • .github/workflows/ci-test-unit.yml (1 hunks)
  • .github/workflows/deploy-testnet-by-pr-comment.yml (1 hunks)
  • magicblock-accounts-db/src/index.rs (1 hunks)
  • magicblock-accounts-db/src/lib.rs (2 hunks)
  • magicblock-accounts/src/errors.rs (1 hunks)
  • magicblock-api/src/errors.rs (3 hunks)
  • magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs (1 hunks)
  • magicblock-chainlink/src/remote_account_provider/errors.rs (2 hunks)
  • magicblock-committor-program/src/state/changeset.rs (1 hunks)
  • magicblock-committor-program/src/state/chunks.rs (3 hunks)
  • magicblock-committor-service/src/compute_budget.rs (1 hunks)
  • magicblock-committor-service/src/error.rs (1 hunks)
  • magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs (1 hunks)
  • magicblock-committor-service/src/intent_executor/error.rs (2 hunks)
  • magicblock-committor-service/src/intent_executor/mod.rs (1 hunks)
  • magicblock-committor-service/src/intent_executor/task_info_fetcher.rs (3 hunks)
  • magicblock-committor-service/src/persist/db.rs (4 hunks)
  • magicblock-committor-service/src/service_ext.rs (1 hunks)
  • magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs (4 hunks)
  • magicblock-committor-service/src/transaction_preparator/error.rs (1 hunks)
  • magicblock-config/src/lib.rs (2 hunks)
  • magicblock-ledger/src/blockstore_processor/mod.rs (1 hunks)
  • magicblock-ledger/src/database/db.rs (1 hunks)
  • magicblock-ledger/src/database/rocks_db.rs (5 hunks)
  • magicblock-ledger/src/store/api.rs (5 hunks)
  • magicblock-magic-program-api/src/instruction.rs (2 hunks)
  • magicblock-rpc-client/src/lib.rs (8 hunks)
  • magicblock-rpc-client/src/utils.rs (4 hunks)
  • magicblock-table-mania/src/lookup_table_rc.rs (1 hunks)
  • magicblock-task-scheduler/src/errors.rs (2 hunks)
  • magicblock-validator-admin/src/claim_fees.rs (2 hunks)
  • programs/guinea/src/lib.rs (1 hunks)
  • rust-toolchain.toml (1 hunks)
  • test-integration/rust-toolchain.toml (1 hunks)
  • test-kit/src/lib.rs (1 hunks)
  • tools/ledger-stats/src/accounts.rs (1 hunks)
  • tools/ledger-stats/src/transaction_details.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (12)
📚 Learning: 2025-11-19T12:55:48.931Z
Learnt from: Dodecahedr0x
Repo: magicblock-labs/magicblock-validator PR: 639
File: test-integration/test-tools/src/validator.rs:193-197
Timestamp: 2025-11-19T12:55:48.931Z
Learning: In the magicblock-validator codebase, when constructing arguments for the light CLI test validator in start_light_validator_with_config (test-integration/test-tools/src/validator.rs), the shlex::split approach is necessary because the light CLI does not handle whitespaces properly in validator arguments. The string concatenation + shlex parsing pattern should not be refactored to direct argument construction in this specific case.

Applied to files:

  • magicblock-config/src/lib.rs
📚 Learning: 2025-11-07T14:20:31.457Z
Learnt from: thlorenz
Repo: magicblock-labs/magicblock-validator PR: 621
File: magicblock-chainlink/src/remote_account_provider/chain_pubsub_actor.rs:457-495
Timestamp: 2025-11-07T14:20:31.457Z
Learning: In magicblock-chainlink/src/remote_account_provider/chain_pubsub_client.rs, the unsubscribe closure returned by PubSubConnection::account_subscribe(...) resolves to () (unit), not a Result. Downstream code should not attempt to inspect an unsubscribe result and can optionally wrap it in a timeout to guard against hangs.

Applied to files:

  • programs/guinea/src/lib.rs
  • magicblock-task-scheduler/src/errors.rs
  • magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs
  • magicblock-chainlink/src/remote_account_provider/errors.rs
  • magicblock-rpc-client/src/lib.rs
📚 Learning: 2025-10-21T14:00:54.642Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 578
File: magicblock-aperture/src/requests/websocket/account_subscribe.rs:18-27
Timestamp: 2025-10-21T14:00:54.642Z
Learning: In magicblock-aperture account_subscribe handler (src/requests/websocket/account_subscribe.rs), the RpcAccountInfoConfig fields data_slice, commitment, and min_context_slot are currently ignored—only encoding is applied. This is tracked as technical debt in issue #579: https://github.com/magicblock-labs/magicblock-validator/issues/579

Applied to files:

  • programs/guinea/src/lib.rs
  • magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs
  • magicblock-validator-admin/src/claim_fees.rs
  • magicblock-accounts-db/src/lib.rs
  • magicblock-chainlink/src/remote_account_provider/errors.rs
  • magicblock-rpc-client/src/lib.rs
📚 Learning: 2025-11-21T10:22:07.520Z
Learnt from: taco-paco
Repo: magicblock-labs/magicblock-validator PR: 661
File: magicblock-committor-service/src/intent_executor/single_stage_executor.rs:20-28
Timestamp: 2025-11-21T10:22:07.520Z
Learning: In magicblock-committor-service's SingleStageExecutor and TwoStageExecutor (single_stage_executor.rs and two_stage_executor.rs), the fields transaction_strategy, junk, and patched_errors are intentionally public because these executors are designed to be used independently outside of the IntentExecutor scope, and callers need access to these execution reports for cleanup and error handling.

Applied to files:

  • magicblock-accounts/src/errors.rs
  • magicblock-committor-service/src/intent_executor/mod.rs
  • magicblock-committor-service/src/service_ext.rs
  • magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs
  • magicblock-committor-service/src/intent_executor/error.rs
  • magicblock-committor-service/src/intent_executor/task_info_fetcher.rs
  • magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs
📚 Learning: 2025-11-18T08:47:39.702Z
Learnt from: Dodecahedr0x
Repo: magicblock-labs/magicblock-validator PR: 639
File: magicblock-chainlink/tests/04_redeleg_other_separate_slots.rs:158-165
Timestamp: 2025-11-18T08:47:39.702Z
Learning: In magicblock-chainlink tests involving compressed accounts, `set_remote_slot()` sets the slot of the `AccountSharedData`, while `compressed_account_shared_with_owner_and_slot()` sets the slot of the delegation record. These are two different fields and both calls are necessary.

Applied to files:

  • magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs
📚 Learning: 2025-11-19T09:34:37.917Z
Learnt from: thlorenz
Repo: magicblock-labs/magicblock-validator PR: 621
File: test-integration/test-chainlink/tests/ix_remote_account_provider.rs:62-63
Timestamp: 2025-11-19T09:34:37.917Z
Learning: In test-integration/test-chainlink/tests/ix_remote_account_provider.rs and similar test files, the `_fwd_rx` receiver returned by `init_remote_account_provider()` is intentionally kept alive (but unused) to prevent "receiver dropped" errors on the sender side. The pattern `let (remote_account_provider, _fwd_rx) = init_remote_account_provider().await;` should NOT be changed to `let (remote_account_provider, _) = ...` because dropping the receiver would cause send() operations to fail.

Applied to files:

  • magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs
  • magicblock-chainlink/src/remote_account_provider/errors.rs
📚 Learning: 2025-11-07T13:20:13.793Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 589
File: magicblock-processor/src/scheduler/coordinator.rs:227-238
Timestamp: 2025-11-07T13:20:13.793Z
Learning: In magicblock-processor's ExecutionCoordinator (scheduler/coordinator.rs), the `account_contention` HashMap intentionally does not call `shrink_to_fit()`. Maintaining slack capacity is beneficial for performance by avoiding frequent reallocations during high transaction throughput. As long as empty entries are removed from the map (which `clear_account_contention` does), the capacity overhead is acceptable.

Applied to files:

  • magicblock-committor-program/src/state/changeset.rs
  • magicblock-accounts-db/src/lib.rs
📚 Learning: 2025-10-21T10:34:59.140Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 578
File: magicblock-accounts-db/src/lib.rs:63-72
Timestamp: 2025-10-21T10:34:59.140Z
Learning: In magicblock-validator, the AccountsDb "stop-the-world" synchronizer is managed at the processor/executor level, not at the AccountsDb API level. Transaction executors in magicblock-processor hold a read lock (sync.read()) for the duration of each slot and release it only at slot boundaries, ensuring all account writes happen under the read lock. Snapshot operations acquire a write lock, blocking until all executors release their read locks. This pattern ensures mutual exclusion between writes and snapshots without requiring read guards in AccountsDb write APIs.

Applied to files:

  • magicblock-accounts-db/src/lib.rs
📚 Learning: 2025-10-28T13:15:42.706Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 596
File: magicblock-processor/src/scheduler.rs:1-1
Timestamp: 2025-10-28T13:15:42.706Z
Learning: In magicblock-processor, transaction indexes were always set to 0 even before the changes in PR #596. The proper transaction indexing within slots will be addressed during the planned ledger rewrite.

Applied to files:

  • magicblock-ledger/src/blockstore_processor/mod.rs
📚 Learning: 2025-11-12T09:46:27.553Z
Learnt from: Dodecahedr0x
Repo: magicblock-labs/magicblock-validator PR: 614
File: magicblock-task-scheduler/src/db.rs:26-0
Timestamp: 2025-11-12T09:46:27.553Z
Learning: In magicblock-task-scheduler, task parameter validation (including ensuring iterations > 0 and enforcing minimum execution intervals) is performed in the Magic program (on-chain) before ScheduleTaskRequest instances reach the scheduler service. The From<&ScheduleTaskRequest> conversion in db.rs does not need additional validation because inputs are already validated at the program level.

Applied to files:

  • magicblock-committor-service/src/intent_executor/task_info_fetcher.rs
📚 Learning: 2025-11-07T13:09:52.253Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 589
File: test-kit/src/lib.rs:275-0
Timestamp: 2025-11-07T13:09:52.253Z
Learning: In test-kit, the transaction scheduler in ExecutionTestEnv is not expected to shut down during tests. Therefore, using `.unwrap()` in test helper methods like `schedule_transaction` is acceptable and will not cause issues in the test environment.

Applied to files:

  • magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs
📚 Learning: 2025-11-24T14:21:00.996Z
Learnt from: Dodecahedr0x
Repo: magicblock-labs/magicblock-validator PR: 639
File: Cargo.toml:58-58
Timestamp: 2025-11-24T14:21:00.996Z
Learning: In the magicblock-validator codebase, magicblock-api/Cargo.toml intentionally uses borsh = "1.5.3" (instead of the workspace version 0.10.4) because it needs to deserialize types from the magic-domain-program external dependency, which requires borsh 1.5.x compatibility. This is an intentional exception for interoperability with the magic domain program.

Applied to files:

  • .github/workflows/ci-test-integration.yml
🧬 Code graph analysis (16)
magicblock-accounts/src/errors.rs (3)
magicblock-api/src/errors.rs (6)
  • from (104-106)
  • from (110-112)
  • from (116-118)
  • from (122-124)
  • from (128-130)
  • from (134-136)
magicblock-committor-service/src/intent_executor/error.rs (3)
  • from (29-31)
  • from (152-154)
  • from (276-281)
magicblock-committor-service/src/service_ext.rs (2)
  • from (232-234)
  • new (44-58)
magicblock-committor-service/src/intent_executor/mod.rs (1)
test-integration/test-tools/src/conversions.rs (1)
  • err (8-8)
magicblock-task-scheduler/src/errors.rs (2)
magicblock-api/src/errors.rs (6)
  • from (104-106)
  • from (110-112)
  • from (116-118)
  • from (122-124)
  • from (128-130)
  • from (134-136)
magicblock-chainlink/src/remote_account_provider/errors.rs (1)
  • from (93-95)
magicblock-committor-service/src/service_ext.rs (2)
magicblock-accounts/src/errors.rs (1)
  • from (68-70)
magicblock-api/src/errors.rs (6)
  • from (104-106)
  • from (110-112)
  • from (116-118)
  • from (122-124)
  • from (128-130)
  • from (134-136)
magicblock-committor-program/src/state/changeset.rs (2)
magicblock-committor-service/src/stubs/changeset_committor_stub.rs (1)
  • len (39-41)
magicblock-committor-program/src/state/chunks.rs (1)
  • chunk_size (130-132)
magicblock-committor-service/src/error.rs (1)
magicblock-rpc-client/src/lib.rs (1)
  • error (199-201)
magicblock-committor-service/src/transaction_preparator/error.rs (3)
magicblock-accounts/src/errors.rs (1)
  • from (68-70)
magicblock-api/src/errors.rs (6)
  • from (104-106)
  • from (110-112)
  • from (116-118)
  • from (122-124)
  • from (128-130)
  • from (134-136)
magicblock-committor-service/src/intent_executor/error.rs (3)
  • from (29-31)
  • from (152-154)
  • from (276-281)
magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs (3)
magicblock-committor-service/src/intent_executor/error.rs (5)
  • from (29-31)
  • from (152-154)
  • from (276-281)
  • value (121-133)
  • value (248-256)
magicblock-committor-service/src/intent_executor/task_info_fetcher.rs (2)
  • from (281-283)
  • new (53-61)
magicblock-committor-service/src/transaction_preparator/error.rs (2)
  • from (20-22)
  • from (35-40)
magicblock-ledger/src/database/db.rs (1)
magicblock-ledger/src/database/rocks_db.rs (2)
  • raw_iterator_cf (209-211)
  • batch (213-215)
magicblock-api/src/errors.rs (3)
magicblock-accounts/src/errors.rs (1)
  • from (68-70)
magicblock-committor-service/src/service_ext.rs (2)
  • from (232-234)
  • new (44-58)
magicblock-task-scheduler/src/errors.rs (1)
  • from (50-54)
magicblock-ledger/src/database/rocks_db.rs (1)
magicblock-ledger/src/database/db.rs (1)
  • raw_iterator_cf (105-107)
magicblock-ledger/src/blockstore_processor/mod.rs (2)
magicblock-accounts-db/src/lib.rs (1)
  • slot (234-236)
magicblock-ledger/src/database/columns.rs (8)
  • slot (131-131)
  • slot (181-183)
  • slot (249-251)
  • slot (329-331)
  • slot (404-406)
  • slot (503-505)
  • slot (577-579)
  • slot (649-651)
magicblock-committor-service/src/intent_executor/error.rs (3)
magicblock-api/src/errors.rs (4)
  • from (104-106)
  • from (110-112)
  • from (116-118)
  • from (122-124)
magicblock-committor-service/src/intent_executor/task_info_fetcher.rs (2)
  • from (281-283)
  • new (53-61)
magicblock-rpc-client/src/lib.rs (3)
  • from (80-82)
  • from (234-236)
  • new (241-243)
tools/ledger-stats/src/accounts.rs (1)
magicblock-committor-program/src/state/changeset.rs (1)
  • owner (119-124)
magicblock-committor-service/src/intent_executor/task_info_fetcher.rs (1)
magicblock-committor-service/src/intent_executor/error.rs (3)
  • from (29-31)
  • from (152-154)
  • from (276-281)
magicblock-rpc-client/src/lib.rs (3)
magicblock-api/src/errors.rs (6)
  • from (104-106)
  • from (110-112)
  • from (116-118)
  • from (122-124)
  • from (128-130)
  • from (134-136)
magicblock-committor-service/src/intent_executor/error.rs (3)
  • from (29-31)
  • from (152-154)
  • from (276-281)
magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs (3)
  • from (513-515)
  • from (548-552)
  • from (574-576)
🔇 Additional comments (47)
magicblock-magic-program-api/src/instruction.rs (1)

29-29: Also applies to: 46-46

magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs (1)

18-18: LGTM! Documentation formatting improvement.

The reformatted doc comment improves alignment and readability with no functional impact.

magicblock-table-mania/src/lookup_table_rc.rs (1)

173-177: Display impl change to iterate via keys() is correct and idiomatic

Using pubkeys.read().expect(...).keys().map(|key| key.to_string()) keeps the same behavior as iterating over (key, _) pairs, holds only a read lock while building the string, and matches Clippy’s recommendation to use .keys() when values are unused. Looks good as-is.

magicblock-committor-service/src/persist/db.rs (3)

856-857: Switch to std::slice::from_ref is correct and more efficient

Passing std::slice::from_ref(&row) avoids an unnecessary clone and is fully compatible with insert_commit_status_rows’ read-only use of the slice.


871-872: Same from_ref change here is sound

This mirrors the previous test: single borrowed row, no post-call mutation, so the borrow via from_ref is correct and avoids an extra allocation/clone.


904-905: Final from_ref usage in tests looks good

Using std::slice::from_ref(&row) here continues the same pattern and keeps the tests free of redundant cloning.

.github/workflows/deploy-testnet-by-pr-comment.yml (1)

151-162: No changes requiring comment.

The modification is a minor whitespace/indentation adjustment with no functional impact on the workflow logic or behavior.

test-integration/rust-toolchain.toml (1)

1-2: Properly sets test-integration toolchain.

Adding an explicit rust-toolchain.toml for the test-integration directory ensures consistent Rust version (1.91.1) alignment with the root configuration and CI workflows.

.github/workflows/ci-test-integration.yml (2)

24-28: Rust toolchain updated to 1.91.1 in build job.

The build step now correctly uses the updated toolchain version.


65-70: Both jobs already use the same toolchain version (1.84.1).

There is no mismatch between the build and run_integration_tests jobs; both use rust_toolchain_release: "1.84.1". The suggested update to 1.91.1 is not supported by the current state of the file. The review comment was based on an incorrect assumption about the build job's toolchain version.

Likely an incorrect or invalid review comment.

rust-toolchain.toml (1)

1-2: Root toolchain correctly updated to 1.91.1.

The toolchain channel is now aligned with the CI workflow specifications and test-integration configuration.

.github/workflows/ci-lint.yml (1)

23-28: Lint CI workflow correctly updated to 1.91.1.

The setup-build-env action now uses the updated Rust toolchain version, consistent with the root configuration and other CI workflows.

.github/workflows/ci-test-unit.yml (1)

23-28: Unit test CI workflow correctly updated to 1.91.1.

The setup-build-env action now uses the updated Rust toolchain version, consistent with the root configuration and other CI workflows.

magicblock-committor-program/src/state/changeset.rs (1)

372-372: LGTM: Idiomatic divisibility check.

The replacement of len % chunk_size > 0 with !len.is_multiple_of(chunk_size as usize) is functionally equivalent and more idiomatic. This standard library method improves code readability without changing behavior.

magicblock-committor-program/src/state/chunks.rs (2)

100-100: LGTM: Consistent use of idiomatic divisibility checks.

Both replacements of modulo-based offset validation with is_multiple_of improve readability and align with modern Rust idioms. The logic remains functionally equivalent.

Also applies to: 115-115


187-187: LGTM: Explicit lifetime annotation improves clarity.

The explicit lifetime annotation ChunksIter<'_> clarifies that the iterator borrows from self. This is good practice and aligns with newer Rust edition requirements for explicitness in lifetime elision.

magicblock-ledger/src/store/api.rs (1)

207-212: Explicit lifetime on RwLockReadGuard return types looks correct

Making the RwLockReadGuard lifetime explicit in check_lowest_cleanup_slot and ensure_lowest_cleanup_slot matches what newer Rust/clippy expect and correctly ties the guard’s lifetime to &self. Call sites continue to bind the guard (e.g., let _lock = … / let (_lock, _) = …), so the lock is still held for the intended scope and behavior is unchanged.

Please re-run the existing ledger tests on Rust 1.91.1 to confirm there are no additional borrow/lifetime warnings or regressions around these helpers.

Also applies to: 230-233

magicblock-validator-admin/src/claim_fees.rs (1)

84-84: No action needed. Error context is properly preserved after boxing.

The MagicBlockRpcClientError enum uses the thiserror crate with #[derive(Debug, Error)], and the error format strings for both GetLatestBlockhash and SendTransaction variants explicitly include both Display ({0}) and Debug ({0:?}) representations. Boxing the errors does not obscure debugging information—the thiserror macro automatically implements Display and Debug traits that format the boxed error with full context.

magicblock-ledger/src/blockstore_processor/mod.rs (1)

59-59: LGTM! Improved readability with is_multiple_of.

The refactor from modulo arithmetic to is_multiple_of is semantically equivalent and more readable. This aligns with the PR's goal of adopting idiomatic Rust patterns.

test-kit/src/lib.rs (1)

294-294: LGTM! Explicit lifetime annotation.

The explicit lifetime parameter makes the borrow relationship clear and aligns with the broader lifetime annotation updates across the codebase (e.g., AccountsScanner<'_, F> in magicblock-accounts-db/src/lib.rs).

magicblock-config/src/lib.rs (1)

70-70: LGTM! Consistent error boxing pattern.

Boxing figment::error::Error aligns with the project-wide refactor to reduce error enum sizes and standardize error handling, as seen in magicblock-api/src/errors.rs and other modules.

Also applies to: 94-94

magicblock-accounts-db/src/lib.rs (2)

189-189: LGTM! Explicit lifetime parameter.

The lifetime annotation AccountsScanner<'_, F> ties the scanner to the AccountsDb borrow, consistent with similar changes in magicblock-accounts-db/src/index.rs (AccountOffsetFinder<'_>).


249-249: LGTM! Clearer snapshot trigger logic.

The refactor to !slot.is_multiple_of(self.snapshot_frequency) maintains the same semantics (early return when not a multiple) while improving readability. This aligns with the similar change in magicblock-ledger/src/blockstore_processor/mod.rs.

magicblock-chainlink/src/remote_account_provider/errors.rs (1)

10-10: LGTM! Consistent error boxing with explicit From implementation.

Boxing PubsubClientError and replacing #[from] with an explicit From impl aligns with the project-wide pattern seen in magicblock-api/src/errors.rs and magicblock-rpc-client/src/lib.rs.

Also applies to: 90-96

magicblock-accounts-db/src/index.rs (1)

362-362: LGTM! Explicit lifetime annotation.

The lifetime parameter AccountOffsetFinder<'_> clarifies the borrow relationship and is consistent with similar changes like AccountsScanner<'_, F> in magicblock-accounts-db/src/lib.rs.

magicblock-rpc-client/src/lib.rs (1)

53-53: LGTM! Comprehensive error boxing refactor.

Boxing RPC client errors across all enum variants and adding the From implementation provides consistent error handling. The changes at error propagation sites (lines 251, 258, 279, 317, 359, 406, 584) correctly wrap errors in Box::new().

Also applies to: 56-56, 59-59, 65-65, 79-83

magicblock-rpc-client/src/utils.rs (1)

115-115: LGTM! Correct dereferencing and boxing for updated error types.

The dereferencing at lines 115 and 121 (*err) properly handles the boxed RpcClientError and SendTransaction variants. The updated return type and error constructions in try_map_client_error consistently box errors to match the new signature.

Also applies to: 121-121, 146-146, 155-159, 168-171

magicblock-committor-service/src/intent_executor/mod.rs (1)

687-693: Owned rpc error mapping from boxed InternalError looks correct

Pattern-matching InternalError::MagicBlockRpcClientError(err) and passing *err into map_magicblock_client_error correctly moves the MagicBlockRpcClientError out of the Box, which matches the new boxed-InternalError design. The box is consumed and not reused afterwards, so there’s no double-use or borrow issue.

magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs (1)

363-370: Test import cleanup is safe

Switching to only HashSet in the test imports matches actual usage (the tests use HashSet but not HashMap), so this just removes an unused import and quiets lints without changing behavior.

magicblock-committor-service/src/error.rs (1)

42-50: Boxing init changeset RPC errors is consistent with the new error pattern

FailedToSendInitChangesetAccount and FailedToConfirmInitChangesetAccount now store Box<solana_rpc_client_api::client_error::Error>, which aligns with the repo’s move to boxed inner errors and keeps CommittorServiceError’s size in check. Since these variants never had #[from], callers already had to construct them explicitly; they now just need to wrap with Box::new(err) instead of passing the error by value.

magicblock-task-scheduler/src/errors.rs (1)

11-15: Boxed PubsubClientError variant with explicit From keeps ? behavior intact

Wrapping PubsubClientError in Box<...> for the Pubsub variant and adding a manual From<PubsubClientError> preserves the ability to use ? on pubsub calls while matching the project-wide boxed-error pattern. The #[error(transparent)] annotation continues to delegate formatting and source to the inner error via the boxed wrapper.

Also applies to: 47-55

magicblock-committor-service/src/service_ext.rs (1)

221-235: CommittorServiceExtError now boxes CommittorServiceError correctly

Switching CommittorServiceExtError::CommittorServiceError to hold a Box<CommittorServiceError> and adding the explicit From<CommittorServiceError> keeps the schedule_base_intents_waiting await?? flow working while matching the rest of the stack’s boxed-error conventions.

magicblock-committor-service/src/intent_executor/error.rs (1)

20-32: Boxed MagicBlockRpcClientError in InternalError and updated From chain look correct

Storing MagicBlockRpcClientError as Box<...> in InternalError and providing From<MagicBlockRpcClientError> ensures all ?-based RPC error paths (e.g., in send_prepared_message) still compile while keeping the enum size reasonable. The From<MagicBlockRpcClientError> for TransactionStrategyExecutionError now routing through InternalError::from(value) correctly produces the InternalError variant rather than duplicating logic, and InternalError::signature() still works via Box’s deref.

Also applies to: 151-155

magicblock-committor-service/src/intent_executor/task_info_fetcher.rs (2)

16-17: Safer NonZeroUsize const initialization

Using NonZeroUsize::new(5).unwrap() and NonZeroUsize::new(1000).unwrap() in consts removes the need for unsafe initialization and is provably safe given the non-zero literals. This is compatible with the newer toolchain and keeps clippy happy.

Also applies to: 54-55


271-284: TaskInfoFetcherError now boxes RPC client errors with proper From

TaskInfoFetcherError::MagicBlockRpcClientError(Box<MagicBlockRpcClientError>) plus the new From<MagicBlockRpcClientError> keeps ?-based propagation from RPC calls (e.g., in fetch_metadata) working while aligning with the boxed-error pattern. The retry loop in fetch_metadata_with_retries still behaves correctly by moving the boxed error into last_err, and signature() continues to delegate to the underlying rpc error via Box’s deref.

magicblock-ledger/src/database/db.rs (1)

104-117: LGTM! Correct lifetime annotations for RocksDB types.

The explicit '_ lifetime annotations on DBRawIterator<'_> and WriteBatch<'_> correctly tie these returned types to the borrow of &self. This is semantically accurate since WriteBatch holds column family references obtained from self.backend.

magicblock-committor-service/src/transaction_preparator/error.rs (1)

15-23: LGTM! Boxing the error type follows the established codebase pattern.

The change from #[from] attribute to an explicit From implementation with boxing is consistent with the error-handling patterns across the codebase (e.g., magicblock-api/src/errors.rs, magicblock-accounts/src/errors.rs). This reduces enum size while preserving ergonomic ? operator usage.

magicblock-ledger/src/database/rocks_db.rs (3)

83-90: LGTM! Correct lifetime annotation for pinned slice.

The DBPinnableSlice<'_> lifetime annotation correctly reflects that the pinned data is borrowed from the database and must not outlive the &self reference.


102-117: LGTM! Lifetime annotations on batched multi-get results.

The Vec<LedgerResult<Option<DBPinnableSlice<'_>>>> return type correctly propagates the lifetime constraint from the underlying RocksDB API.


172-210: LGTM! Iterator lifetime annotations are correct.

The DBIterator<'_> and DBRawIterator<'_> return types correctly tie the iterators to the database borrow, ensuring safe iteration over database contents.

magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs (4)

346-354: LGTM! Correct unboxing when mapping the client error.

The *err dereference at line 349 correctly extracts the owned MagicBlockRpcClientError from the Box before passing it to map_magicblock_client_error.


508-516: LGTM! Boxing pattern for TransactionSendError is consistent.

The explicit From implementation with boxing follows the established error-handling pattern in the codebase.


547-553: LGTM! BufferExecutionError conversion correctly boxes the error.

The From<MagicBlockRpcClientError> implementation properly boxes the error before wrapping in TransactionSendError.


565-577: LGTM! InternalError boxing follows the same pattern.

Consistent with other error types in this file and across the codebase.

magicblock-api/src/errors.rs (3)

15-36: LGTM! Error variants correctly updated to use boxed types.

Boxing these error types reduces the overall ApiError enum size, which addresses clippy's variant_size_differences lint while maintaining the same public API behavior.


92-95: LGTM! TaskSchedulerServiceError variant updated consistently.


102-137: LGTM! Explicit From implementations follow established codebase patterns.

The explicit From implementations with boxing are consistent with patterns in magicblock-accounts/src/errors.rs and other modules. This approach replaces the #[from] derive macro to enable boxing while preserving ergonomic ? operator usage.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tools/ledger-stats/src/transaction_details.rs (1)

53-68: LGTM! Consider removing unnecessary inner braces.

The refactoring from bool::then to explicit if-else improves clarity. However, lines 60-65 have redundant braces that can be removed.

Apply this diff to simplify:

             |b| {
                 if b.is_empty() {
                     "None".to_string()
                 } else {
-                    {
-                        b.iter()
-                            .map(|b| b.ui_token_amount.amount.to_string())
-                            .collect::<Vec<_>>()
-                            .join(" | ")
-                    }
+                    b.iter()
+                        .map(|b| b.ui_token_amount.amount.to_string())
+                        .collect::<Vec<_>>()
+                        .join(" | ")
                 }
             },
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 87cc0a2 and 59aab51.

⛔ Files ignored due to path filters (1)
  • test-integration/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • magicblock-api/src/errors.rs (3 hunks)
  • magicblock-chainlink/src/remote_account_provider/errors.rs (2 hunks)
  • magicblock-committor-service/src/compute_budget.rs (1 hunks)
  • magicblock-committor-service/src/intent_executor/task_info_fetcher.rs (3 hunks)
  • magicblock-rpc-client/src/lib.rs (8 hunks)
  • magicblock-table-mania/src/lookup_table_rc.rs (1 hunks)
  • magicblock-task-scheduler/src/errors.rs (2 hunks)
  • magicblock-validator-admin/src/claim_fees.rs (2 hunks)
  • tools/ledger-stats/src/transaction_details.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-10-21T14:00:54.642Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 578
File: magicblock-aperture/src/requests/websocket/account_subscribe.rs:18-27
Timestamp: 2025-10-21T14:00:54.642Z
Learning: In magicblock-aperture account_subscribe handler (src/requests/websocket/account_subscribe.rs), the RpcAccountInfoConfig fields data_slice, commitment, and min_context_slot are currently ignored—only encoding is applied. This is tracked as technical debt in issue #579: https://github.com/magicblock-labs/magicblock-validator/issues/579

Applied to files:

  • magicblock-validator-admin/src/claim_fees.rs
  • magicblock-chainlink/src/remote_account_provider/errors.rs
  • magicblock-rpc-client/src/lib.rs
  • magicblock-api/src/errors.rs
📚 Learning: 2025-11-07T14:20:31.457Z
Learnt from: thlorenz
Repo: magicblock-labs/magicblock-validator PR: 621
File: magicblock-chainlink/src/remote_account_provider/chain_pubsub_actor.rs:457-495
Timestamp: 2025-11-07T14:20:31.457Z
Learning: In magicblock-chainlink/src/remote_account_provider/chain_pubsub_client.rs, the unsubscribe closure returned by PubSubConnection::account_subscribe(...) resolves to () (unit), not a Result. Downstream code should not attempt to inspect an unsubscribe result and can optionally wrap it in a timeout to guard against hangs.

Applied to files:

  • magicblock-chainlink/src/remote_account_provider/errors.rs
  • magicblock-task-scheduler/src/errors.rs
  • magicblock-rpc-client/src/lib.rs
📚 Learning: 2025-11-19T09:34:37.917Z
Learnt from: thlorenz
Repo: magicblock-labs/magicblock-validator PR: 621
File: test-integration/test-chainlink/tests/ix_remote_account_provider.rs:62-63
Timestamp: 2025-11-19T09:34:37.917Z
Learning: In test-integration/test-chainlink/tests/ix_remote_account_provider.rs and similar test files, the `_fwd_rx` receiver returned by `init_remote_account_provider()` is intentionally kept alive (but unused) to prevent "receiver dropped" errors on the sender side. The pattern `let (remote_account_provider, _fwd_rx) = init_remote_account_provider().await;` should NOT be changed to `let (remote_account_provider, _) = ...` because dropping the receiver would cause send() operations to fail.

Applied to files:

  • magicblock-chainlink/src/remote_account_provider/errors.rs
📚 Learning: 2025-11-21T10:22:07.520Z
Learnt from: taco-paco
Repo: magicblock-labs/magicblock-validator PR: 661
File: magicblock-committor-service/src/intent_executor/single_stage_executor.rs:20-28
Timestamp: 2025-11-21T10:22:07.520Z
Learning: In magicblock-committor-service's SingleStageExecutor and TwoStageExecutor (single_stage_executor.rs and two_stage_executor.rs), the fields transaction_strategy, junk, and patched_errors are intentionally public because these executors are designed to be used independently outside of the IntentExecutor scope, and callers need access to these execution reports for cleanup and error handling.

Applied to files:

  • magicblock-committor-service/src/intent_executor/task_info_fetcher.rs
📚 Learning: 2025-11-12T09:46:27.553Z
Learnt from: Dodecahedr0x
Repo: magicblock-labs/magicblock-validator PR: 614
File: magicblock-task-scheduler/src/db.rs:26-0
Timestamp: 2025-11-12T09:46:27.553Z
Learning: In magicblock-task-scheduler, task parameter validation (including ensuring iterations > 0 and enforcing minimum execution intervals) is performed in the Magic program (on-chain) before ScheduleTaskRequest instances reach the scheduler service. The From<&ScheduleTaskRequest> conversion in db.rs does not need additional validation because inputs are already validated at the program level.

Applied to files:

  • magicblock-committor-service/src/intent_executor/task_info_fetcher.rs
  • magicblock-task-scheduler/src/errors.rs
🧬 Code graph analysis (4)
magicblock-chainlink/src/remote_account_provider/errors.rs (3)
magicblock-api/src/errors.rs (6)
  • from (104-106)
  • from (110-112)
  • from (116-118)
  • from (122-124)
  • from (130-134)
  • from (138-140)
magicblock-task-scheduler/src/errors.rs (1)
  • from (52-56)
magicblock-accounts/src/errors.rs (1)
  • from (68-70)
magicblock-committor-service/src/intent_executor/task_info_fetcher.rs (2)
magicblock-rpc-client/src/lib.rs (3)
  • new (243-245)
  • from (82-84)
  • from (236-238)
magicblock-committor-service/src/intent_executor/error.rs (3)
  • from (29-31)
  • from (152-154)
  • from (276-281)
magicblock-rpc-client/src/lib.rs (3)
magicblock-api/src/errors.rs (6)
  • from (104-106)
  • from (110-112)
  • from (116-118)
  • from (122-124)
  • from (130-134)
  • from (138-140)
magicblock-chainlink/src/remote_account_provider/errors.rs (1)
  • from (95-97)
magicblock-committor-service/src/intent_executor/error.rs (3)
  • from (29-31)
  • from (152-154)
  • from (276-281)
magicblock-api/src/errors.rs (4)
magicblock-chainlink/src/remote_account_provider/errors.rs (1)
  • from (95-97)
magicblock-task-scheduler/src/errors.rs (1)
  • from (52-56)
magicblock-accounts/src/errors.rs (1)
  • from (68-70)
magicblock-committor-service/src/intent_executor/error.rs (3)
  • from (29-31)
  • from (152-154)
  • from (276-281)
🔇 Additional comments (13)
magicblock-table-mania/src/lookup_table_rc.rs (1)

173-179: Approved: idiomatic HashMap key iteration refactoring.

The change from iterating over key-value pairs to using .keys() directly is more idiomatic and clearly expresses the intent to iterate only over keys. The functional output remains identical, and this is a solid clippy fix that improves code clarity.

magicblock-committor-service/src/compute_budget.rs (1)

56-64: Idiomatic use of saturating_add preserves previous overflow semantics

Switching from a manual checked_add(...).unwrap_or(u32::MAX) pattern to .saturating_add(self.base_budget) keeps the same clamping behavior while simplifying the code and avoiding explicit unwrap_or. The overflow path still cleanly saturates at u32::MAX after the u32::try_from step.

magicblock-chainlink/src/remote_account_provider/errors.rs (2)

10-12: LGTM: Error boxing reduces enum size.

Boxing the PubsubClientError variant helps reduce the overall size of the RemoteAccountProviderError enum, which can improve performance by reducing stack allocation and copy costs.


92-98: LGTM: Explicit From implementation maintains ergonomic error conversion.

The explicit From implementation preserves the convenience of the ? operator for error propagation while boxing the error.

magicblock-rpc-client/src/lib.rs (3)

53-65: LGTM: Consistent error boxing across all RPC error variants.

All RPC-related error variants now consistently use Box<...> to reduce the enum size. This is a standard optimization for error types containing large variants.


79-85: LGTM: From implementation enables ergonomic error conversion.

The From implementation allows seamless conversion from solana_rpc_client_api::client_error::Error using the ? operator while applying the boxing strategy.


250-252: LGTM: All error propagation sites correctly updated.

All error construction and propagation sites have been consistently updated to box errors, maintaining correctness while applying the new error boxing pattern.

Also applies to: 259-260, 280-280, 318-318, 360-360, 407-409, 587-587

magicblock-committor-service/src/intent_executor/task_info_fetcher.rs (2)

16-16: LGTM: Safe NonZeroUsize construction replaces unsafe code.

Replacing NonZeroUsize::new_unchecked with NonZeroUsize::new(...).unwrap() eliminates unsafe code while maintaining the same semantics for these compile-time constant values. This is a safer approach that satisfies Clippy lints in the new toolchain.

Also applies to: 53-53


275-282: LGTM: Error boxing maintains consistency with codebase patterns.

Boxing MagicBlockRpcClientError with an explicit From implementation follows the same pattern applied across the codebase and helps reduce enum size.

magicblock-task-scheduler/src/errors.rs (1)

12-16: LGTM: Error boxing with explicit From implementation.

The boxing of PubsubClientError with its accompanying From implementation follows the consistent pattern applied throughout this PR, reducing enum size while maintaining ergonomic error conversion.

Also applies to: 49-57

magicblock-api/src/errors.rs (2)

16-16: LGTM: Comprehensive error boxing across API error variants.

All major inner error types are now consistently boxed, reducing the size of the ApiError enum. This is particularly beneficial for this top-level error type that aggregates errors from multiple subsystems.

Also applies to: 19-19, 22-22, 25-25, 34-36, 93-95


103-141: LGTM: Complete From implementations for all boxed error types.

All six From implementations correctly box their respective error types, maintaining ergonomic error propagation with the ? operator while applying the boxing optimization.

magicblock-validator-admin/src/claim_fees.rs (1)

96-96: LGTM! Consistent error boxing pattern.

The error boxing for SendTransaction is consistent with the GetLatestBlockhash error handling above (lines 82-83) and follows the same refactoring pattern.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 59aab51 and f43835c.

📒 Files selected for processing (11)
  • magicblock-committor-program/src/lib.rs (1 hunks)
  • magicblock-committor-program/src/state/changeset.rs (1 hunks)
  • magicblock-committor-program/src/state/chunks.rs (1 hunks)
  • test-integration/programs/flexi-counter/src/processor.rs (1 hunks)
  • test-integration/programs/schedulecommit/src/utils/mod.rs (2 hunks)
  • test-integration/schedulecommit/client/src/schedule_commit_context.rs (1 hunks)
  • test-integration/schedulecommit/test-scenarios/tests/01_commits.rs (1 hunks)
  • test-integration/test-committor-service/tests/test_ix_commit_local.rs (1 hunks)
  • test-integration/test-runner/src/env_config.rs (1 hunks)
  • test-integration/test-tools/src/integration_test_context.rs (10 hunks)
  • test-integration/test-tools/src/transactions.rs (5 hunks)
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2025-11-07T13:20:13.793Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 589
File: magicblock-processor/src/scheduler/coordinator.rs:227-238
Timestamp: 2025-11-07T13:20:13.793Z
Learning: In magicblock-processor's ExecutionCoordinator (scheduler/coordinator.rs), the `account_contention` HashMap intentionally does not call `shrink_to_fit()`. Maintaining slack capacity is beneficial for performance by avoiding frequent reallocations during high transaction throughput. As long as empty entries are removed from the map (which `clear_account_contention` does), the capacity overhead is acceptable.

Applied to files:

  • magicblock-committor-program/src/state/changeset.rs
📚 Learning: 2025-10-21T14:00:54.642Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 578
File: magicblock-aperture/src/requests/websocket/account_subscribe.rs:18-27
Timestamp: 2025-10-21T14:00:54.642Z
Learning: In magicblock-aperture account_subscribe handler (src/requests/websocket/account_subscribe.rs), the RpcAccountInfoConfig fields data_slice, commitment, and min_context_slot are currently ignored—only encoding is applied. This is tracked as technical debt in issue #579: https://github.com/magicblock-labs/magicblock-validator/issues/579

Applied to files:

  • magicblock-committor-program/src/state/changeset.rs
  • test-integration/programs/flexi-counter/src/processor.rs
  • test-integration/programs/schedulecommit/src/utils/mod.rs
📚 Learning: 2025-11-07T18:19:48.996Z
Learnt from: Dodecahedr0x
Repo: magicblock-labs/magicblock-validator PR: 614
File: test-integration/programs/schedulecommit/Cargo.toml:19-20
Timestamp: 2025-11-07T18:19:48.996Z
Learning: In Solana programs (crates depending on solana-program), the empty feature flags `custom-heap = []` and `custom-panic = []` are standard declarations required to avoid compiler warnings. These should not be flagged as unused features in Cargo.toml files for Solana program crates.

Applied to files:

  • magicblock-committor-program/src/lib.rs
📚 Learning: 2025-10-14T09:56:14.047Z
Learnt from: taco-paco
Repo: magicblock-labs/magicblock-validator PR: 564
File: test-integration/programs/flexi-counter/src/processor/call_handler.rs:122-125
Timestamp: 2025-10-14T09:56:14.047Z
Learning: The file test-integration/programs/flexi-counter/src/processor/call_handler.rs contains a test smart contract used for integration testing, not production code.

Applied to files:

  • test-integration/programs/flexi-counter/src/processor.rs
  • test-integration/test-committor-service/tests/test_ix_commit_local.rs
  • test-integration/test-tools/src/integration_test_context.rs
📚 Learning: 2025-11-19T09:34:37.917Z
Learnt from: thlorenz
Repo: magicblock-labs/magicblock-validator PR: 621
File: test-integration/test-chainlink/tests/ix_remote_account_provider.rs:62-63
Timestamp: 2025-11-19T09:34:37.917Z
Learning: In test-integration/test-chainlink/tests/ix_remote_account_provider.rs and similar test files, the `_fwd_rx` receiver returned by `init_remote_account_provider()` is intentionally kept alive (but unused) to prevent "receiver dropped" errors on the sender side. The pattern `let (remote_account_provider, _fwd_rx) = init_remote_account_provider().await;` should NOT be changed to `let (remote_account_provider, _) = ...` because dropping the receiver would cause send() operations to fail.

Applied to files:

  • test-integration/programs/flexi-counter/src/processor.rs
📚 Learning: 2025-11-07T13:09:52.253Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 589
File: test-kit/src/lib.rs:275-0
Timestamp: 2025-11-07T13:09:52.253Z
Learning: In test-kit, the transaction scheduler in ExecutionTestEnv is not expected to shut down during tests. Therefore, using `.unwrap()` in test helper methods like `schedule_transaction` is acceptable and will not cause issues in the test environment.

Applied to files:

  • test-integration/schedulecommit/test-scenarios/tests/01_commits.rs
🧬 Code graph analysis (2)
magicblock-committor-program/src/state/changeset.rs (1)
magicblock-committor-program/src/state/chunks.rs (1)
  • chunk_size (130-132)
magicblock-committor-program/src/state/chunks.rs (1)
magicblock-ledger/src/database/db.rs (1)
  • iter (67-80)
🔇 Additional comments (10)
test-integration/schedulecommit/client/src/schedule_commit_context.rs (1)

286-286: LGTM! Explicit lifetime improves clarity.

The addition of the explicit lifetime annotation <'_> aligns with modern Rust best practices and clippy recommendations. The placeholder '_ correctly allows Rust to infer the lifetime tied to &self, making the code more explicit without changing behavior.

magicblock-committor-program/src/state/changeset.rs (1)

371-376: Semantically equivalent remainder check; no behavior change

Changing the condition from len % chunk_size as usize > 0 to len % chunk_size as usize != 0 is semantically equivalent for usize (remainder is always ≥ 0), so chunk_count computation is unchanged while satisfying clippy. No further action needed here.

magicblock-committor-program/src/state/chunks.rs (1)

187-187: LGTM! Explicit lifetime annotation improves clarity.

The addition of '_ makes the lifetime dependency explicit—the returned iterator borrows from self. This change aligns with newer Rust toolchain requirements and best practices while maintaining the same behavior.

test-integration/test-runner/src/env_config.rs (2)

52-57: LGTM! More idiomatic Option API.

The refactoring from map_or(true, ...) to is_none_or(...) maintains identical behavior while using a more idiomatic and readable API introduced in newer Rust versions.


59-64: LGTM! Consistent refactoring.

The same idiomatic refactoring applied here maintains behavioral equivalence and improves code clarity.

test-integration/test-tools/src/transactions.rs (1)

19-19: Lint suppressions appropriate for test utilities.

The #[allow(clippy::result_large_err)] suppressions are pragmatic for test helper functions. Since client_error::Error is an external type from the Solana SDK and these are test utilities, the performance impact is negligible.

Note: If similar patterns appear in production code paths, consider boxing the error (Result<T, Box<client_error::Error>>) to reduce the Result size.

Also applies to: 39-39, 52-52, 71-71, 83-83

test-integration/test-tools/src/integration_test_context.rs (1)

670-670: Lint suppressions selectively and correctly applied.

The #[allow(clippy::result_large_err)] attributes are added only to methods returning Result<..., client_error::Error>, while methods returning Result<..., anyhow::Error> (lines 771-919) correctly omit the suppression since anyhow::Error is already heap-allocated. This selective application demonstrates understanding of when the warning applies.

For integration test context utilities, this suppression approach is appropriate.

Also applies to: 687-687, 704-704, 721-721, 738-738, 755-755, 857-857, 879-879, 891-891, 903-903

test-integration/programs/schedulecommit/src/utils/mod.rs (1)

89-89: LGTM! Good optimization to avoid unnecessary cloning.

Using std::slice::from_ref(account_info) instead of cloning is more efficient and idiomatic. Since invoke_signed only needs a reference to a single-element slice, there's no need to clone the AccountInfo. This change eliminates unnecessary allocation while maintaining identical functionality.

Also applies to: 98-98

test-integration/test-committor-service/tests/test_ix_commit_local.rs (1)

711-735: Use of is_multiple_of keeps behavior while matching modern Rust idioms

Switching from remaining_tries % 4 == 0 to remaining_tries.is_multiple_of(4) is equivalent here for u8 with a constant divisor of 4, including the remaining_tries == 0 case, and makes the intent clearer/aligns with newer std APIs. No functional or test semantics concerns from this change.

Please confirm your toolchain (Rust 1.91.1 per PR description) indeed has u8::is_multiple_of stabilized and that cargo test -p test-committor-service --test test_ix_commit_local passes end‑to‑end with this change.

test-integration/programs/flexi-counter/src/processor.rs (1)

492-492: LGTM! Idiomatic slice construction.

The change to std::slice::from_ref(payer_info) is the idiomatic way to create a single-element slice from a reference without copying, and is functionally equivalent to the previous &[payer_info] pattern. This improvement aligns with Rust best practices and was likely recommended by clippy as part of the toolchain update.

Copy link
Contributor

@Dodecahedr0x Dodecahedr0x left a comment

Choose a reason for hiding this comment

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

Few questions, but LGTM

@@ -1,3 +1,5 @@
#![allow(clippy::manual_is_multiple_of)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed because build-sbf does not have the feature enabled? Would be nice to avoid it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, unfortunately solana uses older toolchain to build, but clippy runs with newer one, we have to silence it until solana upgrades the toolchain to 1.87 or higher.

(player, player_pda)
}

#[allow(clippy::result_large_err)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why stopping the error boxing now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I suppose because these are tests, so perf optimizations don't matter as much.

Copy link
Collaborator

@thlorenz thlorenz left a comment

Choose a reason for hiding this comment

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

After addressing the nits I pointed out LGTM.

));
}

#[allow(clippy::result_large_err)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally #![allow(clippy::result_large_err)] at the test module level so you don't have to repeat this everywhere.


use crate::conversions::stringify_simulation_result;

#[allow(clippy::result_large_err)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto on module level pragma may be better

@bmuddha bmuddha force-pushed the bmuddha/chore/toolchain-bump branch from f43835c to 18c9fcc Compare December 3, 2025 14:32
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
magicblock-committor-service/src/persist/db.rs (1)

926-926: Consider applying the same borrow pattern for consistency.

Three other tests still use &[row.clone()] for single-row inserts. For consistency with the refactored tests, consider updating these to use std::slice::from_ref(&row) as well:

  • Line 926 in test_get_signatures_by_commit
  • Line 959 in test_empty_data_handling
  • Line 972 in test_undelegate_flag

Apply this diff to update test_get_signatures_by_commit:

-        db.insert_commit_status_rows(&[row.clone()]).unwrap();
+        db.insert_commit_status_rows(std::slice::from_ref(&row)).unwrap();

Similar changes can be applied to the other two tests.

Also applies to: 959-959, 972-972

magicblock-accounts/src/errors.rs (1)

59-71: Preserve inner CommittorServiceError details in Display

Boxing CommittorSerivceError is fine, but the current variant no longer prints the inner error, which makes logs and user-facing messages less informative compared to the other variants in this file.

You can keep boxing while still exposing the underlying error by including {0} in the error message:

-    #[error("CommittorSerivceError")]
-    CommittorSerivceError(Box<CommittorServiceError>),
+    #[error("CommittorSerivceError: {0}")]
+    CommittorSerivceError(Box<CommittorServiceError>),
magicblock-ledger/src/database/db.rs (1)

109-147: Align all WriteBatch usages with the lifetime parameter

WriteBatch is defined as WriteBatch<'a>, and batch(&self) -> WriteBatch<'_> correctly ties the batch's lifetime to &self. However, the following methods accept WriteBatch without the lifetime parameter:

  • Line 119: pub fn write(&self, batch: WriteBatch)
  • Line 132: pub fn delete_range_cf<C>(&self, batch: &mut WriteBatch, ...)

Update these signatures to:

-    pub fn write(&self, batch: WriteBatch) -> Result<(), LedgerError> {
+    pub fn write(&self, batch: WriteBatch<'_>) -> Result<(), LedgerError> {
         self.backend.write(batch.write_batch)
     }
@@
-    pub fn delete_range_cf<C>(
-        &self,
-        batch: &mut WriteBatch,
+    pub fn delete_range_cf<C>(
+        &self,
+        batch: &mut WriteBatch<'_>,
         from: Slot,
         to: Slot,
     ) where
♻️ Duplicate comments (3)
test-integration/test-tools/src/transactions.rs (1)

1-2: Crate-level lint suppression added.

The crate-level #![allow(clippy::result_large_err)] suppresses the lint for the entire file. As noted in previous reviews, a module-level pragma might offer better granularity if specific modules within the crate need different lint configurations in the future.

test-integration/test-tools/src/integration_test_context.rs (1)

672-672: Remove redundant function-level lint suppressions.

Since the crate-level #![allow(clippy::result_large_err)] at Line 1 already suppresses this lint for the entire file, the function-level #[allow(clippy::result_large_err)] attributes on confirm_transaction_chain, confirm_transaction_ephem, and send_transaction_ephem are redundant and should be removed.

Apply this diff to remove the redundant attributes:

-    #[allow(clippy::result_large_err)]
     pub fn confirm_transaction_chain(
         &self,
         sig: &Signature,
         tx: Option<&Transaction>,
     ) -> Result<bool, client_error::Error> {

-    #[allow(clippy::result_large_err)]
     pub fn confirm_transaction_ephem(
         &self,
         sig: &Signature,
         tx: Option<&Transaction>,
     ) -> Result<bool, client_error::Error> {

-    #[allow(clippy::result_large_err)]
     pub fn send_transaction_ephem(
         &self,
         tx: &mut Transaction,
         signers: &[&Keypair],
     ) -> Result<Signature, client_error::Error> {

Also applies to: 689-689, 706-706

magicblock-committor-service/src/compute_budget.rs (1)

55-64: Saturating add change is correct; optional consistency refactor in ComputeBudget::total_budget.

The new .saturating_add(self.base_budget) on Line 63 preserves the previous “cap at u32::MAX” behavior while being more idiomatic than checked_add(..).unwrap_or(u32::MAX), and it composes correctly with the earlier try_from(..).unwrap_or(u32::MAX) logic. No correctness issues here.

As a small, optional follow‑up (and echoing the earlier bot comment), you could make ComputeBudget::total_budget (Lines 202‑207) use saturating arithmetic for consistency, e.g.:

-    fn total_budget(&self, committee_count: u32) -> u32 {
-        self.per_committee()
-            .checked_mul(committee_count)
-            .and_then(|product| product.checked_add(self.base_budget()))
-            .unwrap_or(u32::MAX)
-    }
+    fn total_budget(&self, committee_count: u32) -> u32 {
+        self.per_committee()
+            .saturating_mul(committee_count)
+            .saturating_add(self.base_budget())
+    }

This is purely stylistic and not required for the toolchain/clippy bump.

Also applies to: 202-207

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f43835c and 18c9fcc.

⛔ Files ignored due to path filters (1)
  • test-integration/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (48)
  • .github/workflows/ci-lint.yml (1 hunks)
  • .github/workflows/ci-test-integration.yml (1 hunks)
  • .github/workflows/ci-test-unit.yml (1 hunks)
  • .github/workflows/deploy-testnet-by-pr-comment.yml (1 hunks)
  • magicblock-accounts-db/src/index.rs (1 hunks)
  • magicblock-accounts-db/src/lib.rs (2 hunks)
  • magicblock-accounts/src/errors.rs (1 hunks)
  • magicblock-api/src/errors.rs (3 hunks)
  • magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs (1 hunks)
  • magicblock-chainlink/src/remote_account_provider/errors.rs (2 hunks)
  • magicblock-committor-program/src/lib.rs (1 hunks)
  • magicblock-committor-program/src/state/changeset.rs (1 hunks)
  • magicblock-committor-program/src/state/chunks.rs (1 hunks)
  • magicblock-committor-service/src/compute_budget.rs (1 hunks)
  • magicblock-committor-service/src/error.rs (1 hunks)
  • magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs (1 hunks)
  • magicblock-committor-service/src/intent_executor/error.rs (2 hunks)
  • magicblock-committor-service/src/intent_executor/mod.rs (1 hunks)
  • magicblock-committor-service/src/intent_executor/task_info_fetcher.rs (3 hunks)
  • magicblock-committor-service/src/persist/db.rs (4 hunks)
  • magicblock-committor-service/src/service_ext.rs (1 hunks)
  • magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs (4 hunks)
  • magicblock-committor-service/src/transaction_preparator/error.rs (1 hunks)
  • magicblock-config/src/lib.rs (2 hunks)
  • magicblock-ledger/src/blockstore_processor/mod.rs (1 hunks)
  • magicblock-ledger/src/database/db.rs (1 hunks)
  • magicblock-ledger/src/database/rocks_db.rs (5 hunks)
  • magicblock-ledger/src/store/api.rs (5 hunks)
  • magicblock-magic-program-api/src/instruction.rs (2 hunks)
  • magicblock-rpc-client/src/lib.rs (8 hunks)
  • magicblock-rpc-client/src/utils.rs (4 hunks)
  • magicblock-table-mania/src/lookup_table_rc.rs (1 hunks)
  • magicblock-task-scheduler/src/errors.rs (2 hunks)
  • magicblock-validator-admin/src/claim_fees.rs (2 hunks)
  • programs/guinea/src/lib.rs (1 hunks)
  • rust-toolchain.toml (1 hunks)
  • test-integration/programs/flexi-counter/src/processor.rs (1 hunks)
  • test-integration/programs/schedulecommit/src/utils/mod.rs (2 hunks)
  • test-integration/rust-toolchain.toml (1 hunks)
  • test-integration/schedulecommit/client/src/schedule_commit_context.rs (1 hunks)
  • test-integration/schedulecommit/test-scenarios/tests/01_commits.rs (1 hunks)
  • test-integration/test-committor-service/tests/test_ix_commit_local.rs (1 hunks)
  • test-integration/test-runner/src/env_config.rs (1 hunks)
  • test-integration/test-tools/src/integration_test_context.rs (4 hunks)
  • test-integration/test-tools/src/transactions.rs (1 hunks)
  • test-kit/src/lib.rs (1 hunks)
  • tools/ledger-stats/src/accounts.rs (1 hunks)
  • tools/ledger-stats/src/transaction_details.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (16)
📚 Learning: 2025-12-03T09:36:01.504Z
Learnt from: Dodecahedr0x
Repo: magicblock-labs/magicblock-validator PR: 639
File: magicblock-chainlink/src/remote_account_provider/mod.rs:1350-1353
Timestamp: 2025-12-03T09:36:01.504Z
Learning: Repo: magicblock-labs/magicblock-validator
File: magicblock-chainlink/src/remote_account_provider/mod.rs
Context: consolidate_fetched_remote_accounts
Learning: For unexpected result counts (>2), the project prefers logging an error and returning an empty Vec over panicking; acceptable during development per maintainer (Dodecahedr0x).

Applied to files:

  • magicblock-validator-admin/src/claim_fees.rs
  • test-integration/test-committor-service/tests/test_ix_commit_local.rs
  • magicblock-committor-service/src/error.rs
  • test-integration/programs/schedulecommit/src/utils/mod.rs
  • test-integration/programs/flexi-counter/src/processor.rs
  • magicblock-chainlink/src/remote_account_provider/errors.rs
  • tools/ledger-stats/src/accounts.rs
  • tools/ledger-stats/src/transaction_details.rs
  • magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs
  • magicblock-rpc-client/src/lib.rs
  • magicblock-committor-program/src/state/changeset.rs
  • magicblock-accounts-db/src/lib.rs
  • magicblock-accounts-db/src/index.rs
  • magicblock-committor-service/src/intent_executor/mod.rs
  • magicblock-config/src/lib.rs
  • magicblock-committor-service/src/intent_executor/task_info_fetcher.rs
  • magicblock-api/src/errors.rs
  • magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs
📚 Learning: 2025-10-21T14:00:54.642Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 578
File: magicblock-aperture/src/requests/websocket/account_subscribe.rs:18-27
Timestamp: 2025-10-21T14:00:54.642Z
Learning: In magicblock-aperture account_subscribe handler (src/requests/websocket/account_subscribe.rs), the RpcAccountInfoConfig fields data_slice, commitment, and min_context_slot are currently ignored—only encoding is applied. This is tracked as technical debt in issue #579: https://github.com/magicblock-labs/magicblock-validator/issues/579

Applied to files:

  • magicblock-validator-admin/src/claim_fees.rs
  • magicblock-committor-service/src/error.rs
  • magicblock-magic-program-api/src/instruction.rs
  • test-integration/programs/schedulecommit/src/utils/mod.rs
  • test-integration/programs/flexi-counter/src/processor.rs
  • magicblock-chainlink/src/remote_account_provider/errors.rs
  • magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs
  • magicblock-rpc-client/src/lib.rs
  • magicblock-committor-program/src/state/changeset.rs
  • magicblock-accounts-db/src/lib.rs
📚 Learning: 2025-12-03T09:33:48.684Z
Learnt from: Dodecahedr0x
Repo: magicblock-labs/magicblock-validator PR: 639
File: test-integration/test-committor-service/tests/test_ix_commit_local.rs:867-881
Timestamp: 2025-12-03T09:33:48.684Z
Learning: Repo: magicblock-labs/magicblock-validator PR: 639
Context: test-integration/test-committor-service/tests/test_ix_commit_local.rs (ix_commit_local)
Learning: The PhotonIndexer used for compressed account fetches (get_compressed_account) has built‑in retry logic (defaults to ~10 attempts), so tests should not add separate retry loops around compressed fetches unless there’s a specific need.

Applied to files:

  • magicblock-validator-admin/src/claim_fees.rs
  • test-integration/test-committor-service/tests/test_ix_commit_local.rs
  • magicblock-committor-service/src/error.rs
  • magicblock-committor-program/src/state/changeset.rs
  • magicblock-committor-service/src/intent_executor/mod.rs
  • magicblock-committor-service/src/persist/db.rs
  • test-integration/schedulecommit/test-scenarios/tests/01_commits.rs
  • magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs
  • magicblock-committor-service/src/intent_executor/task_info_fetcher.rs
📚 Learning: 2025-10-14T09:56:14.047Z
Learnt from: taco-paco
Repo: magicblock-labs/magicblock-validator PR: 564
File: test-integration/programs/flexi-counter/src/processor/call_handler.rs:122-125
Timestamp: 2025-10-14T09:56:14.047Z
Learning: The file test-integration/programs/flexi-counter/src/processor/call_handler.rs contains a test smart contract used for integration testing, not production code.

Applied to files:

  • test-integration/test-committor-service/tests/test_ix_commit_local.rs
  • test-integration/test-tools/src/integration_test_context.rs
  • test-integration/programs/flexi-counter/src/processor.rs
  • test-integration/schedulecommit/test-scenarios/tests/01_commits.rs
📚 Learning: 2025-11-19T09:34:37.917Z
Learnt from: thlorenz
Repo: magicblock-labs/magicblock-validator PR: 621
File: test-integration/test-chainlink/tests/ix_remote_account_provider.rs:62-63
Timestamp: 2025-11-19T09:34:37.917Z
Learning: In test-integration/test-chainlink/tests/ix_remote_account_provider.rs and similar test files, the `_fwd_rx` receiver returned by `init_remote_account_provider()` is intentionally kept alive (but unused) to prevent "receiver dropped" errors on the sender side. The pattern `let (remote_account_provider, _fwd_rx) = init_remote_account_provider().await;` should NOT be changed to `let (remote_account_provider, _) = ...` because dropping the receiver would cause send() operations to fail.

Applied to files:

  • test-integration/test-committor-service/tests/test_ix_commit_local.rs
  • test-integration/programs/flexi-counter/src/processor.rs
  • magicblock-chainlink/src/remote_account_provider/errors.rs
  • magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs
  • test-kit/src/lib.rs
📚 Learning: 2025-11-07T13:20:13.793Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 589
File: magicblock-processor/src/scheduler/coordinator.rs:227-238
Timestamp: 2025-11-07T13:20:13.793Z
Learning: In magicblock-processor's ExecutionCoordinator (scheduler/coordinator.rs), the `account_contention` HashMap intentionally does not call `shrink_to_fit()`. Maintaining slack capacity is beneficial for performance by avoiding frequent reallocations during high transaction throughput. As long as empty entries are removed from the map (which `clear_account_contention` does), the capacity overhead is acceptable.

Applied to files:

  • test-integration/programs/schedulecommit/src/utils/mod.rs
  • magicblock-committor-program/src/state/changeset.rs
  • magicblock-accounts-db/src/lib.rs
📚 Learning: 2025-11-12T09:46:27.553Z
Learnt from: Dodecahedr0x
Repo: magicblock-labs/magicblock-validator PR: 614
File: magicblock-task-scheduler/src/db.rs:26-0
Timestamp: 2025-11-12T09:46:27.553Z
Learning: In magicblock-task-scheduler, task parameter validation (including ensuring iterations > 0 and enforcing minimum execution intervals) is performed in the Magic program (on-chain) before ScheduleTaskRequest instances reach the scheduler service. The From<&ScheduleTaskRequest> conversion in db.rs does not need additional validation because inputs are already validated at the program level.

Applied to files:

  • magicblock-task-scheduler/src/errors.rs
  • magicblock-committor-service/src/intent_executor/task_info_fetcher.rs
📚 Learning: 2025-11-07T14:20:31.457Z
Learnt from: thlorenz
Repo: magicblock-labs/magicblock-validator PR: 621
File: magicblock-chainlink/src/remote_account_provider/chain_pubsub_actor.rs:457-495
Timestamp: 2025-11-07T14:20:31.457Z
Learning: In magicblock-chainlink/src/remote_account_provider/chain_pubsub_client.rs, the unsubscribe closure returned by PubSubConnection::account_subscribe(...) resolves to () (unit), not a Result. Downstream code should not attempt to inspect an unsubscribe result and can optionally wrap it in a timeout to guard against hangs.

Applied to files:

  • magicblock-task-scheduler/src/errors.rs
  • magicblock-chainlink/src/remote_account_provider/errors.rs
  • magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs
  • magicblock-rpc-client/src/lib.rs
📚 Learning: 2025-11-07T13:09:52.253Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 589
File: test-kit/src/lib.rs:275-0
Timestamp: 2025-11-07T13:09:52.253Z
Learning: In test-kit, the transaction scheduler in ExecutionTestEnv is not expected to shut down during tests. Therefore, using `.unwrap()` in test helper methods like `schedule_transaction` is acceptable and will not cause issues in the test environment.

Applied to files:

  • test-integration/test-tools/src/transactions.rs
  • test-integration/schedulecommit/test-scenarios/tests/01_commits.rs
  • magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs
  • test-kit/src/lib.rs
📚 Learning: 2025-10-28T13:15:42.706Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 596
File: magicblock-processor/src/scheduler.rs:1-1
Timestamp: 2025-10-28T13:15:42.706Z
Learning: In magicblock-processor, transaction indexes were always set to 0 even before the changes in PR #596. The proper transaction indexing within slots will be addressed during the planned ledger rewrite.

Applied to files:

  • magicblock-ledger/src/blockstore_processor/mod.rs
📚 Learning: 2025-11-18T08:47:39.702Z
Learnt from: Dodecahedr0x
Repo: magicblock-labs/magicblock-validator PR: 639
File: magicblock-chainlink/tests/04_redeleg_other_separate_slots.rs:158-165
Timestamp: 2025-11-18T08:47:39.702Z
Learning: In magicblock-chainlink tests involving compressed accounts, `set_remote_slot()` sets the slot of the `AccountSharedData`, while `compressed_account_shared_with_owner_and_slot()` sets the slot of the delegation record. These are two different fields and both calls are necessary.

Applied to files:

  • magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs
📚 Learning: 2025-11-04T10:48:00.070Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 589
File: magicblock-processor/src/scheduler/mod.rs:217-219
Timestamp: 2025-11-04T10:48:00.070Z
Learning: In magicblock-validator, the codebase uses a pattern where types containing non-Send/non-Sync fields (like Rc<RefCell<...>>) are marked with unsafe impl Send when they are guaranteed to be confined to a single thread through careful API design and thread spawning patterns.

Applied to files:

  • magicblock-rpc-client/src/lib.rs
📚 Learning: 2025-11-24T14:21:00.996Z
Learnt from: Dodecahedr0x
Repo: magicblock-labs/magicblock-validator PR: 639
File: Cargo.toml:58-58
Timestamp: 2025-11-24T14:21:00.996Z
Learning: In the magicblock-validator codebase, magicblock-api/Cargo.toml intentionally uses borsh = "1.5.3" (instead of the workspace version 0.10.4) because it needs to deserialize types from the magic-domain-program external dependency, which requires borsh 1.5.x compatibility. This is an intentional exception for interoperability with the magic domain program.

Applied to files:

  • magicblock-rpc-client/src/lib.rs
  • .github/workflows/ci-test-integration.yml
📚 Learning: 2025-10-21T10:34:59.140Z
Learnt from: bmuddha
Repo: magicblock-labs/magicblock-validator PR: 578
File: magicblock-accounts-db/src/lib.rs:63-72
Timestamp: 2025-10-21T10:34:59.140Z
Learning: In magicblock-validator, the AccountsDb "stop-the-world" synchronizer is managed at the processor/executor level, not at the AccountsDb API level. Transaction executors in magicblock-processor hold a read lock (sync.read()) for the duration of each slot and release it only at slot boundaries, ensuring all account writes happen under the read lock. Snapshot operations acquire a write lock, blocking until all executors release their read locks. This pattern ensures mutual exclusion between writes and snapshots without requiring read guards in AccountsDb write APIs.

Applied to files:

  • magicblock-accounts-db/src/lib.rs
📚 Learning: 2025-11-21T10:22:07.520Z
Learnt from: taco-paco
Repo: magicblock-labs/magicblock-validator PR: 661
File: magicblock-committor-service/src/intent_executor/single_stage_executor.rs:20-28
Timestamp: 2025-11-21T10:22:07.520Z
Learning: In magicblock-committor-service's SingleStageExecutor and TwoStageExecutor (single_stage_executor.rs and two_stage_executor.rs), the fields transaction_strategy, junk, and patched_errors are intentionally public because these executors are designed to be used independently outside of the IntentExecutor scope, and callers need access to these execution reports for cleanup and error handling.

Applied to files:

  • magicblock-committor-service/src/intent_executor/mod.rs
  • magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs
  • magicblock-committor-service/src/intent_executor/task_info_fetcher.rs
  • magicblock-committor-service/src/intent_executor/error.rs
  • magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs
📚 Learning: 2025-11-19T12:55:48.931Z
Learnt from: Dodecahedr0x
Repo: magicblock-labs/magicblock-validator PR: 639
File: test-integration/test-tools/src/validator.rs:193-197
Timestamp: 2025-11-19T12:55:48.931Z
Learning: In the magicblock-validator codebase, when constructing arguments for the light CLI test validator in start_light_validator_with_config (test-integration/test-tools/src/validator.rs), the shlex::split approach is necessary because the light CLI does not handle whitespaces properly in validator arguments. The string concatenation + shlex parsing pattern should not be refactored to direct argument construction in this specific case.

Applied to files:

  • magicblock-config/src/lib.rs
🧬 Code graph analysis (15)
magicblock-committor-service/src/error.rs (1)
magicblock-rpc-client/src/lib.rs (1)
  • error (201-203)
magicblock-task-scheduler/src/errors.rs (2)
magicblock-chainlink/src/remote_account_provider/errors.rs (1)
  • from (95-97)
magicblock-rpc-client/src/lib.rs (3)
  • from (82-84)
  • from (236-238)
  • new (243-245)
magicblock-committor-program/src/state/chunks.rs (1)
magicblock-ledger/src/database/db.rs (1)
  • iter (67-80)
magicblock-chainlink/src/remote_account_provider/errors.rs (3)
magicblock-api/src/errors.rs (6)
  • from (104-106)
  • from (110-112)
  • from (116-118)
  • from (122-124)
  • from (130-134)
  • from (138-140)
magicblock-task-scheduler/src/errors.rs (1)
  • from (52-56)
magicblock-accounts/src/errors.rs (1)
  • from (68-70)
tools/ledger-stats/src/accounts.rs (1)
magicblock-committor-program/src/state/changeset.rs (1)
  • owner (119-124)
magicblock-committor-service/src/service_ext.rs (2)
magicblock-api/src/errors.rs (4)
  • from (104-106)
  • from (110-112)
  • from (116-118)
  • from (122-124)
magicblock-committor-service/src/intent_executor/error.rs (3)
  • from (29-31)
  • from (152-154)
  • from (276-281)
magicblock-ledger/src/blockstore_processor/mod.rs (1)
magicblock-ledger/src/database/columns.rs (8)
  • slot (131-131)
  • slot (181-183)
  • slot (249-251)
  • slot (329-331)
  • slot (404-406)
  • slot (503-505)
  • slot (577-579)
  • slot (649-651)
magicblock-committor-program/src/state/changeset.rs (2)
magicblock-committor-service/src/stubs/changeset_committor_stub.rs (1)
  • len (39-41)
magicblock-committor-program/src/state/chunks.rs (1)
  • chunk_size (130-132)
magicblock-ledger/src/database/db.rs (1)
magicblock-ledger/src/database/rocks_db.rs (2)
  • raw_iterator_cf (209-211)
  • batch (213-215)
magicblock-ledger/src/database/rocks_db.rs (1)
magicblock-ledger/src/database/db.rs (1)
  • raw_iterator_cf (105-107)
magicblock-committor-service/src/transaction_preparator/error.rs (3)
magicblock-api/src/errors.rs (3)
  • from (104-106)
  • from (110-112)
  • from (116-118)
magicblock-committor-service/src/intent_executor/error.rs (3)
  • from (29-31)
  • from (152-154)
  • from (276-281)
magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs (4)
  • from (513-515)
  • from (548-552)
  • from (574-576)
  • new (49-59)
magicblock-committor-service/src/intent_executor/task_info_fetcher.rs (2)
magicblock-api/src/errors.rs (5)
  • from (104-106)
  • from (110-112)
  • from (116-118)
  • from (122-124)
  • from (130-134)
magicblock-committor-service/src/intent_executor/error.rs (3)
  • from (29-31)
  • from (152-154)
  • from (276-281)
magicblock-api/src/errors.rs (6)
magicblock-chainlink/src/remote_account_provider/errors.rs (1)
  • from (95-97)
magicblock-task-scheduler/src/errors.rs (1)
  • from (52-56)
magicblock-accounts/src/errors.rs (1)
  • from (68-70)
magicblock-committor-service/src/intent_executor/error.rs (3)
  • from (29-31)
  • from (152-154)
  • from (276-281)
magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs (3)
  • new (51-64)
  • new (105-122)
  • new (698-704)
magicblock-committor-service/src/intent_executor/mod.rs (1)
  • new (124-138)
magicblock-committor-service/src/intent_executor/error.rs (3)
magicblock-committor-service/src/intent_executor/task_info_fetcher.rs (2)
  • from (279-281)
  • new (52-59)
magicblock-rpc-client/src/lib.rs (3)
  • from (82-84)
  • from (236-238)
  • new (243-245)
magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs (4)
  • from (513-515)
  • from (548-552)
  • from (574-576)
  • new (49-59)
magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs (3)
magicblock-committor-service/src/intent_executor/task_info_fetcher.rs (2)
  • from (279-281)
  • new (52-59)
magicblock-rpc-client/src/lib.rs (4)
  • from (82-84)
  • from (236-238)
  • new (243-245)
  • error (201-203)
magicblock-committor-service/src/intent_executor/error.rs (5)
  • from (29-31)
  • from (152-154)
  • from (276-281)
  • value (121-133)
  • value (248-256)
🔇 Additional comments (56)
.github/workflows/deploy-testnet-by-pr-comment.yml (1)

151-162: Non-functional formatting change approved.

The whitespace/newline adjustment to the "Add failure comment" step does not affect workflow logic, GitHub API calls, or authorization checks. The YAML structure and script behavior remain unchanged.

magicblock-magic-program-api/src/instruction.rs (1)

28-30: Documentation formatting improvements approved.

The wrapped account reference documentation in both ScheduleCommit (line 28-30) and ScheduleCommitAndUndelegate (line 45-47) improves readability without changing semantics or public API. These are appropriate companion changes during the toolchain update.

Also applies to: 45-47

magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs (1)

17-18: Doc comment formatting aligned per clippy recommendations.

The continuation line of the remote_slot_in_bank parameter documentation is now properly aligned with the documentation style.

rust-toolchain.toml (1)

2-2: Toolchain version update is correct.

The channel update to 1.91.1 aligns with the PR objective.

.github/workflows/ci-test-unit.yml (1)

26-26: CI unit test toolchain is correctly updated.

The rust_toolchain_release matches the root rust-toolchain.toml update to 1.91.1.

.github/workflows/ci-lint.yml (1)

26-26: CI lint toolchain is correctly updated.

The rust_toolchain_release matches the root rust-toolchain.toml update to 1.91.1.

test-integration/rust-toolchain.toml (1)

1-2: Test-integration toolchain is correctly initialized.

The new file ensures the test-integration environment uses the updated 1.91.1 toolchain, maintaining consistency across the repository.

test-kit/src/lib.rs (1)

294-296: Explicit lifetime on get_payer is correct and consistent

The updated signature -> CommitableAccount<'_> is consistent with get_account and the CommitableAccount<'db> definition, and keeps the borrow correctly tied to &self. No behavioral changes or soundness issues introduced here.

magicblock-committor-program/src/state/chunks.rs (1)

187-187: LGTM! Explicit lifetime annotation improves clarity.

The explicit '_ lifetime annotation in the return type correctly matches the lifetime parameter of ChunksIter<'a> and aligns with clippy recommendations in the updated toolchain. This test-only change is functionally equivalent to the previous elided form and improves code explicitness.

magicblock-table-mania/src/lookup_table_rc.rs (1)

176-177: LGTM! More idiomatic iteration over HashMap keys.

Using .keys() is clearer and more idiomatic than .iter().map(|(key, _)| ...) when only keys are needed. This change maintains identical behavior while likely addressing a clippy warning.

magicblock-committor-program/src/state/changeset.rs (1)

371-377: Remainder predicate change is behavior‑preserving and clippy‑friendly

len % chunk_size as usize > 0!= 0 is equivalent for this unsigned remainder case, and chunk_size == 0 is already short‑circuited above, so there’s no risk of division by zero. Chunk counting semantics remain unchanged; this is a safe, lint‑driven cleanup.

test-integration/test-committor-service/tests/test_ix_commit_local.rs (1)

711-735: Semantics of retry logging preserved with is_multiple_of

Switching from remaining_tries % 4 == 0 to remaining_tries.is_multiple_of(4) keeps the behavior (log every 4th remaining try when validation is failing) and reads cleaner. The only requirement is that is_multiple_of is available for u8 in your Rust 1.91.1 toolchain (either as a std method or via an in-scope trait); if the build passes, this change is fully compatible.

Please confirm that is_multiple_of resolves correctly on u8 under the updated toolchain and that clippy is satisfied with this style in this file as well.

test-integration/test-tools/src/integration_test_context.rs (1)

1-2: Crate-level lint suppression added.

The crate-level #![allow(clippy::result_large_err)] at the top of the file suppresses the result_large_err lint for the entire crate, making function-level suppressions elsewhere in this file unnecessary.

magicblock-committor-service/src/persist/db.rs (1)

856-857: LGTM! Idiomatic borrow pattern avoids unnecessary clones.

The use of std::slice::from_ref(&row) instead of &[row.clone()] is an appropriate optimization for these test cases. This pattern creates a single-element slice by borrowing the existing row rather than cloning it, which is both more efficient and more idiomatic for test setup.

Also applies to: 871-872, 886-887, 904-905

test-integration/programs/schedulecommit/src/utils/mod.rs (1)

83-100: Switch to std::slice::from_ref is correct and avoids unnecessary cloning

Using std::slice::from_ref(account_info) for the invoke_signed account slice is semantically equivalent to the previous &[account_info.clone()], avoids an extra AccountInfo clone, and keeps lifetimes straightforward. No correctness or lifetime issues here, and this aligns well with clippy’s preferences for single‑element slices.

test-integration/test-runner/src/env_config.rs (2)

52-57: Good refactoring to use is_none_or.

The change from map_or(true, |setup| setup.devnet()) to is_none_or(|setup| setup.devnet()) is functionally equivalent and more idiomatic for boolean predicates.


59-64: Good refactoring to use is_none_or.

The change is functionally equivalent and more idiomatic. Option::is_none_or has been available since Rust 1.82.0, so it's safe to use with any recent Rust toolchain.

test-integration/schedulecommit/test-scenarios/tests/01_commits.rs (1)

1-1: Crate-level result_large_err allow is acceptable for this test crate

Using #![allow(clippy::result_large_err)] at the crate level is consistent with treating these integration tests as non‑perf‑critical and avoids churn boxing test-only error types. The only trade‑off is that future large error Results in this file will also be silently allowed, so if you ever add non‑test helpers here, it’s worth revisiting and tightening the scope of the lint suppression.

test-integration/schedulecommit/client/src/schedule_commit_context.rs (1)

286-300: Explicit lifetime on fields return type is correct and clarifies borrowing

Changing fields(&self) to return ScheduleCommitTestContextFields<'_> aligns the method with the lifetime parameter on ScheduleCommitTestContextFields and correctly ties all returned references to &self without altering semantics. This looks sound and should satisfy the newer toolchain/clippy requirements.

test-integration/programs/flexi-counter/src/processor.rs (1)

492-492: CPI account slice construction looks good and avoids unnecessary clone/allocation

Using invoke(&ix, std::slice::from_ref(payer_info)) is semantically equivalent to the previous single‑element account slice of payer_info.clone(), while avoiding both a clone and an intermediate allocation. Lifetimes line up with the accounts slice, so this should be a no‑op behaviorally and satisfies stricter clippy/toolchain lints.

Please confirm the existing integration tests that exercise process_cancel_task (especially CancelTask CPI paths) still pass under the updated Rust toolchain to validate no behavioral drift.

programs/guinea/src/lib.rs (1)

163-163: Single‑account CPI via from_ref is correct and consistent

Switching invoke to use std::slice::from_ref(payer_info) correctly produces the required single‑element &[AccountInfo] without cloning or heap allocation. Given the instruction metas only reference the payer, this remains behaviorally identical to the prior implementation.

Please rerun the guinea program tests or scenarios that call GuineaInstruction::CancelTask to confirm the CPI still behaves as expected with the new toolchain.

magicblock-config/src/lib.rs (1)

68-95: Boxed figment error return type is type-safe and causes no actual breakage

The change to pub fn try_new(...) -> Result<Self, Box<figment::error::Error>> with figment.extract().map_err(Box::new) is type-correct and preserves all behavior. While the return type signature has changed, all three call sites in the codebase (main.rs, tests.rs, and README.md) use generic error handling (Display trait via eprintln!, .expect(), or ? operator) which Box transparently forwards, so no caller updates are needed. The config layering and precedence remain unchanged.

Likely an incorrect or invalid review comment.

magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs (1)

363-370: Import cleanup in tests is correct and minimal

Switching the test std imports to only bring in collections::HashSet matches actual usage in test_non_blocking_messages and removes now‑unused imports. This is a safe clippy‑style cleanup with no behavioral impact on tests or production code.

magicblock-ledger/src/blockstore_processor/mod.rs (1)

59-59: LGTM!

The is_multiple_of method is the idiomatic replacement for slot % PROGRESS_REPORT_INTERVAL == 0 introduced in Rust 1.91. Since PROGRESS_REPORT_INTERVAL is a non-zero constant (100), this is semantically equivalent and cleaner.

magicblock-ledger/src/store/api.rs (2)

210-210: LGTM - Explicit lifetime annotations.

Adding '_ to RwLockReadGuard return types makes the elided lifetime explicit, which is a clippy lint fix for the new toolchain. This improves readability without changing behavior.

Also applies to: 232-232


421-429: Documentation formatting adjustments.

Minor whitespace changes in doc comments. No semantic changes.

Also applies to: 855-856, 1049-1050

magicblock-accounts-db/src/index.rs (1)

360-365: LGTM - Explicit lifetime annotation.

The '_ lifetime on AccountOffsetFinder<'_> explicitly ties the returned iterator to the borrow of self, which correctly captures the dependency on the read-only transaction created from self.env. This aligns with the broader lifetime threading pattern in this PR.

magicblock-chainlink/src/remote_account_provider/errors.rs (1)

10-12: LGTM - Boxing inner error for stack efficiency.

Boxing PubsubClientError reduces the size of RemoteAccountProviderError on the stack. The manual From impl correctly handles the boxing, replacing the previous #[from] attribute. This pattern is consistent with similar changes across the codebase (e.g., magicblock-api/src/errors.rs, magicblock-task-scheduler/src/errors.rs).

Also applies to: 91-98

magicblock-accounts-db/src/lib.rs (2)

185-205: LGTM - Lifetime threading for AccountsScanner.

The explicit lifetime parameter 'db on AccountsScanner and the return type AccountsScanner<'_, F> correctly captures the borrow relationship with &self. The struct already held 'db-lifetime references, so this makes the signature consistent with the actual constraints.

Also applies to: 380-384


249-251: LGTM - is_multiple_of for snapshot frequency check.

The is_multiple_of method replaces the modulo check. Since snapshot_frequency is asserted non-zero at line 66 (assert_ne!(snapshot_frequency, 0, ...)), this is safe and semantically equivalent.

magicblock-rpc-client/src/lib.rs (2)

50-85: LGTM - Consistent error boxing pattern.

Boxing solana_rpc_client_api::client_error::Error in error variants reduces stack size for MagicBlockRpcClientResult. The From impl correctly boxes the error, providing ergonomic conversion via .into().


247-260: Error propagation sites updated correctly.

All error mapping locations properly construct boxed variants:

  • get_latest_blockhash: GetLatestBlockhash(Box::new(e))
  • get_slot: GetSlot(Box::new(e))
  • get_account: RpcClientError(Box::new(err))
  • get_multiple_accounts_with_commitment: .into() (uses From impl)
  • request_airdrop: RpcClientError(Box::new(e))
  • send_transaction: SendTransaction(Box::new(e))
  • get_transaction: RpcClientError(Box::new(e))

Also applies to: 280-280, 318-318, 360-360, 407-409, 587-587

magicblock-validator-admin/src/claim_fees.rs (1)

81-84: LGTM - Error boxing aligned with MagicBlockRpcClientError changes.

The error mappings correctly use the boxed variants (GetLatestBlockhash(Box::new(e)) and SendTransaction(Box::new(e))) to match the updated MagicBlockRpcClientError enum definition in magicblock-rpc-client/src/lib.rs.

Also applies to: 93-96

magicblock-rpc-client/src/utils.rs (2)

114-125: LGTM - Correct dereference of boxed errors.

Since RpcClientError and SendTransaction variants now hold Box<Error>, the dereference *err correctly extracts the inner error for mapping via try_map_client_error. The result is re-boxed when reconstructing the error variant.


143-174: LGTM - try_map_client_error returns boxed errors.

The return type change to Result<ExecErr, Box<...>> aligns with the boxed error variants. All error construction paths correctly wrap in Box::new(...), ensuring consistent boxing throughout the error handling chain.

magicblock-committor-service/src/intent_executor/mod.rs (1)

676-698: Boxed RPC error mapping looks correct

Dereferencing the boxed MagicBlockRpcClientError here to pass the owned inner error into map_magicblock_client_error is the right adjustment after boxing InternalError::MagicBlockRpcClientError; it preserves previous behavior without double-boxing or cloning.

magicblock-task-scheduler/src/errors.rs (1)

11-16: Pubsub boxing and explicit From impl are consistent and safe

Storing PubsubClientError in a Box and adding an explicit From<...> keeps the enum size in check while preserving ? ergonomics and transparent display behavior.

Also applies to: 49-56

magicblock-committor-service/src/intent_executor/task_info_fetcher.rs (2)

16-16: Safe NonZeroUsize initialization

Switching to NonZeroUsize::new(...).unwrap() in consts removes the unsafe usage while remaining provably safe with positive literals (5, 1000). No behavioral change.

Also applies to: 52-58


268-282: Boxed RPC client error in TaskInfoFetcherError is wired correctly

Wrapping MagicBlockRpcClientError in a Box plus the new From<MagicBlockRpcClientError> keeps ?-based propagation working (e.g., in fetch_metadata) and signature() correctly delegates to the inner error via deref.

magicblock-committor-service/src/service_ext.rs (1)

221-235: Boxing CommittorServiceError in the Ext error type is consistent

The boxed CommittorServiceError variant plus the explicit From keeps the await?? pattern in schedule_base_intents_waiting working while aligning with the boxed-error pattern used elsewhere.

magicblock-committor-service/src/error.rs (1)

42-51: Boxing init changeset RPC client errors is fine

Wrapping the init changeset client_error::Error values in a Box matches the general boxing strategy and doesn’t affect existing helpers (like signature()), since those never inspected these variants.

magicblock-committor-service/src/intent_executor/error.rs (1)

20-32: Internal RPC error boxing and conversion chain look correct

Making InternalError::MagicBlockRpcClientError boxed and funneling From<MagicBlockRpcClientError> for TransactionStrategyExecutionError through InternalError::from is a clean centralization of the boxing logic. The signature() helper and existing ? paths remain valid.

Also applies to: 151-154

magicblock-committor-service/src/transaction_preparator/error.rs (1)

9-23: Boxed DeliveryPreparatorError integration is sound

Storing DeliveryPreparatorError in a Box and adding the explicit From keeps conversions ergonomic while allowing signature() to keep delegating cleanly to the inner error.

Also applies to: 25-31

magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs (4)

346-354: LGTM - Correct dereference of boxed error.

The dereference *err is necessary here since map_magicblock_client_error expects the unboxed MagicBlockRpcClientError, while the variant now stores Box<MagicBlockRpcClientError>.


508-516: LGTM - Consistent boxing pattern for error conversion.

The explicit From implementation correctly boxes the error, aligning with the project-wide pattern for MagicBlockRpcClientError conversions seen in other modules (e.g., intent_executor/error.rs, task_info_fetcher.rs).


547-553: LGTM - Proper error chaining with boxing.

The From implementation correctly boxes the MagicBlockRpcClientError when wrapping it in TransactionSendError, maintaining consistent error conversion semantics.


565-577: LGTM - Boxing reduces enum size.

The boxed MagicBlockRpcClientError variant and explicit From implementation follow the established pattern, helping reduce the stack size of InternalError.

magicblock-api/src/errors.rs (3)

15-25: LGTM - Selective boxing of larger error types.

Boxing AccountsError, AccountClonerError, LedgerError, and ChainlinkError while leaving smaller types unboxed is a reasonable approach to reduce enum size without over-engineering.


33-36: LGTM - Boxing applied consistently.

The boxed service errors align with the project-wide pattern.

Also applies to: 92-95


103-141: LGTM - All From implementations correctly box errors.

The explicit From implementations consistently box each error type before wrapping, enabling ergonomic ? operator usage while maintaining the boxed representation. This aligns with the pattern used across the codebase (e.g., magicblock_accounts::errors, magicblock_task_scheduler::errors).

magicblock-ledger/src/database/db.rs (1)

104-107: Lifetime‑bound raw iterator wrapper looks correct

The explicit DBRawIterator<'_> return type cleanly ties the iterator’s lifetime to &self and simply forwards to self.backend.raw_iterator_cf(cf). This is consistent with the Rocks::raw_iterator_cf signature and should satisfy the updated RocksDB API without changing behavior.

magicblock-ledger/src/database/rocks_db.rs (5)

83-90: Pinned‑slice lifetime annotation is consistent with &self

Changing get_pinned_cf to return LedgerResult<Option<DBPinnableSlice<'_>>> matches the RocksDB API shape where the pinnable slice’s lifetime is tied to the DB reference. The body simply forwards self.db.get_pinned_cf(...) and propagates the result, so behavior is unchanged.


102-117: multi_get_cf return type now correctly exposes lifetimes of pinned slices

The new signature

pub fn multi_get_cf(
    &self,
    cf: &ColumnFamily,
    keys: Vec<&[u8]>,
) -> Vec<LedgerResult<Option<DBPinnableSlice<'_>>>>

accurately reflects that each DBPinnableSlice is borrowed from &self. The mapping from RocksDB’s batched_multi_get_cf into LedgerResult is unchanged, so this is purely a type‑level adjustment.


172-190: Iterator wrapper now explicitly lifetime‑bound; logic unchanged

Returning DBIterator<'_> from iterator_cf is consistent with the iterator being tied to &self. The match that converts your higher‑level IteratorMode<C::Index> into RocksIteratorMode is unchanged, and you still just forward into self.db.iterator_cf(cf, iterator_mode), so this is a safe, signature‑only update.


192-207: Raw‑key iterator lifetime annotation mirrors typed iterator semantics

iterator_cf_raw_key now returning DBIterator<'_> aligns its signature with iterator_cf and the underlying RocksDB API. Construction of RocksIteratorMode from your IteratorMode<Vec<u8>> is identical to before, so there’s no functional change beyond exposing the proper lifetime.


209-211: raw_iterator_cf lifetime is now explicit and matches RocksDB

Switching to pub fn raw_iterator_cf(&self, cf: &ColumnFamily) -> DBRawIterator<'_> cleanly ties the raw iterator’s lifetime to &self while still just delegating to self.db.raw_iterator_cf(cf). This keeps the wrapper in sync with RocksDB’s type signatures.

with:
build_cache_key_name: "magicblock-validator-ci-test-integration-${{ github.ref_name }}-${{ hashFiles('magicblock-validator/Cargo.lock') }}"
rust_toolchain_release: "1.84.1"
rust_toolchain_release: "1.91.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Inconsistent toolchain versions across CI jobs.

The build job uses 1.91.1 (line 27), but the run_integration_tests job still uses 1.84.1 (line 68). This creates a mismatch: code compiled with one toolchain is tested with another, which can mask toolchain-specific bugs or inconsistencies.

Update line 68 to 1.91.1 to maintain consistency across all CI jobs.

Apply this diff to fix the inconsistency:

      - uses: ./magicblock-validator/.github/actions/setup-build-env
         with:
           build_cache_key_name: "magicblock-validator-ci-test-integration-${{ github.ref_name }}-${{ hashFiles('magicblock-validator/Cargo.lock') }}"
-          rust_toolchain_release: "1.84.1"
+          rust_toolchain_release: "1.91.1"
           github_access_token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
           github_token: ${{ secrets.GITHUB_TOKEN }}

Also applies to: 68-68

🤖 Prompt for AI Agents
.github/workflows/ci-test-integration.yml lines 27 and 68: the Rust toolchain
versions are inconsistent across CI jobs (line 27 shows 1.91.1 while line 68
uses 1.84.1); update the rust_toolchain_release value at line 68 from 1.84.1 to
1.91.1 so both build and run_integration_tests jobs use the same 1.91.1
toolchain.

Comment on lines +1 to +2
#![allow(clippy::manual_is_multiple_of)]

Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Document the toolchain constraint with an inline comment.

The crate-level allow is justified given Solana's older toolchain constraint (as explained in the discussion). However, add an inline comment explaining why this exists and when it can be removed to help future maintainers.

Apply this diff to add documentation:

+// TODO: Remove once Solana upgrades to toolchain 1.87+
+// Needed because Solana build uses older toolchain but clippy runs with 1.91.1
 #![allow(clippy::manual_is_multiple_of)]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#![allow(clippy::manual_is_multiple_of)]
// TODO: Remove once Solana upgrades to toolchain 1.87+
// Needed because Solana build uses older toolchain but clippy runs with 1.91.1
#![allow(clippy::manual_is_multiple_of)]
🤖 Prompt for AI Agents
In magicblock-committor-program/src/lib.rs around lines 1 to 2, add an inline
comment next to the crate-level allow attribute explaining that
clippy::manual_is_multiple_of is allowed because the crate must maintain
compatibility with an older Solana toolchain that lacks the newer is_multiple_of
intrinsic; state when it can be removed (e.g., after upgrading the Solana
toolchain to a version that provides the intrinsic or when the minimum supported
Rust/toolchain is bumped), and include a short reference to the issue/discussion
or PR that justifies the exception.

Comment on lines +57 to +66
if b.is_empty() {
"None".to_string()
} else {
{
b.iter()
.map(|b| b.ui_token_amount.amount.to_string())
.collect::<Vec<_>>()
.join(" | ")
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider removing unnecessary inner braces.

The else block contains redundant braces around the iterator chain (lines 60-65). Removing them would improve readability and match idiomatic Rust style.

Apply this diff to simplify:

             |b| {
                 if b.is_empty() {
                     "None".to_string()
                 } else {
-                    {
-                        b.iter()
-                            .map(|b| b.ui_token_amount.amount.to_string())
-                            .collect::<Vec<_>>()
-                            .join(" | ")
-                    }
+                    b.iter()
+                        .map(|b| b.ui_token_amount.amount.to_string())
+                        .collect::<Vec<_>>()
+                        .join(" | ")
                 }
             },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if b.is_empty() {
"None".to_string()
} else {
{
b.iter()
.map(|b| b.ui_token_amount.amount.to_string())
.collect::<Vec<_>>()
.join(" | ")
}
}
if b.is_empty() {
"None".to_string()
} else {
b.iter()
.map(|b| b.ui_token_amount.amount.to_string())
.collect::<Vec<_>>()
.join(" | ")
}
🤖 Prompt for AI Agents
In tools/ledger-stats/src/transaction_details.rs around lines 57 to 66, the else
branch contains redundant inner braces around the iterator chain; remove the
extra braces so the branch simply returns b.iter().map(|b|
b.ui_token_amount.amount.to_string()).collect::<Vec<_>>().join(" | ") (keeping
the surrounding if/else structure intact) to simplify and match idiomatic Rust.

@bmuddha bmuddha merged commit 8d6482e into master Dec 3, 2025
18 checks passed
@bmuddha bmuddha deleted the bmuddha/chore/toolchain-bump branch December 3, 2025 15:07
thlorenz added a commit that referenced this pull request Dec 4, 2025
* master:
  chore: update toolchain and fix clippy (#708)
  fix: set default base fee to 0 (#716)
  fix: use svm with program cache fix (#712)
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.

4 participants