From 944ec11aeb608e85e0057ce77a1f0eca34bc747d Mon Sep 17 00:00:00 2001 From: Babur Makhmudov Date: Tue, 2 Dec 2025 16:25:02 +0400 Subject: [PATCH 1/4] chore: update toolchain and fix clippy --- .github/workflows/ci-lint.yml | 2 +- .github/workflows/ci-test-integration.yml | 2 +- .github/workflows/ci-test-unit.yml | 2 +- .../deploy-testnet-by-pr-comment.yml | 2 +- magicblock-accounts-db/src/index.rs | 2 +- magicblock-accounts-db/src/lib.rs | 4 +- magicblock-accounts/src/errors.rs | 8 +++- magicblock-api/src/errors.rs | 48 ++++++++++++++++--- .../account_still_undelegating_on_chain.rs | 2 +- .../src/remote_account_provider/errors.rs | 12 +++-- .../src/state/changeset.rs | 2 +- .../src/state/chunks.rs | 6 +-- .../src/compute_budget.rs | 4 +- magicblock-committor-service/src/error.rs | 4 +- .../intent_execution_engine.rs | 30 +----------- .../src/intent_executor/error.rs | 10 +++- .../src/intent_executor/mod.rs | 2 +- .../src/intent_executor/task_info_fetcher.rs | 12 +++-- .../src/persist/db.rs | 12 +++-- .../src/service_ext.rs | 8 +++- .../delivery_preparator.rs | 20 ++++++-- .../src/transaction_preparator/error.rs | 8 +++- magicblock-config/src/lib.rs | 4 +- .../src/blockstore_processor/mod.rs | 2 +- magicblock-ledger/src/database/db.rs | 4 +- magicblock-ledger/src/database/rocks_db.rs | 10 ++-- magicblock-ledger/src/store/api.rs | 22 ++++----- .../src/instruction.rs | 4 +- magicblock-rpc-client/src/lib.rs | 30 +++++++----- magicblock-rpc-client/src/utils.rs | 14 +++--- magicblock-table-mania/src/lookup_table_rc.rs | 4 +- magicblock-task-scheduler/src/errors.rs | 13 ++++- magicblock-validator-admin/src/claim_fees.rs | 4 +- programs/guinea/src/lib.rs | 2 +- rust-toolchain.toml | 2 +- test-integration/rust-toolchain.toml | 2 + test-kit/src/lib.rs | 2 +- tools/ledger-stats/src/accounts.rs | 2 +- tools/ledger-stats/src/transaction_details.rs | 12 ++--- 39 files changed, 203 insertions(+), 132 deletions(-) create mode 100644 test-integration/rust-toolchain.toml diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 542564349..e2bacff76 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -23,7 +23,7 @@ jobs: - uses: ./magicblock-validator/.github/actions/setup-build-env with: build_cache_key_name: "magicblock-validator-ci-lint-v002" - 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 }} diff --git a/.github/workflows/ci-test-integration.yml b/.github/workflows/ci-test-integration.yml index a6db40549..00b9dfbc1 100644 --- a/.github/workflows/ci-test-integration.yml +++ b/.github/workflows/ci-test-integration.yml @@ -24,7 +24,7 @@ jobs: - 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 }} diff --git a/.github/workflows/ci-test-unit.yml b/.github/workflows/ci-test-unit.yml index 2996543d7..433456867 100644 --- a/.github/workflows/ci-test-unit.yml +++ b/.github/workflows/ci-test-unit.yml @@ -23,7 +23,7 @@ jobs: - uses: ./magicblock-validator/.github/actions/setup-build-env with: build_cache_key_name: "magicblock-validator-ci-test-unit-v000" - 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 }} diff --git a/.github/workflows/deploy-testnet-by-pr-comment.yml b/.github/workflows/deploy-testnet-by-pr-comment.yml index 7ee7269ea..a692bb189 100644 --- a/.github/workflows/deploy-testnet-by-pr-comment.yml +++ b/.github/workflows/deploy-testnet-by-pr-comment.yml @@ -159,4 +159,4 @@ jobs: repo: context.repo.repo, issue_number: context.payload.issue.number, body: `❌ Failed to trigger deploy for branch \`${{ steps.get_branch.outputs.branch }}\`. Make sure you have permission or use the manual deploy link in the PR comment.` - }); \ No newline at end of file + }); diff --git a/magicblock-accounts-db/src/index.rs b/magicblock-accounts-db/src/index.rs index 46cf9a32f..ddd752bf6 100644 --- a/magicblock-accounts-db/src/index.rs +++ b/magicblock-accounts-db/src/index.rs @@ -359,7 +359,7 @@ impl AccountsDbIndex { /// Obtain a wrapped cursor to query account offsets repeatedly pub(crate) fn offset_finder( &self, - ) -> AccountsDbResult { + ) -> AccountsDbResult> { let txn = self.env.begin_ro_txn()?; AccountOffsetFinder::new(&self.accounts, txn) } diff --git a/magicblock-accounts-db/src/lib.rs b/magicblock-accounts-db/src/lib.rs index 83a908171..a8ad3668c 100644 --- a/magicblock-accounts-db/src/lib.rs +++ b/magicblock-accounts-db/src/lib.rs @@ -186,7 +186,7 @@ impl AccountsDb { &self, program: &Pubkey, filter: F, - ) -> AccountsDbResult> + ) -> AccountsDbResult> where F: Fn(&AccountSharedData) -> bool + 'static, { @@ -246,7 +246,7 @@ impl AccountsDb { pub fn set_slot(self: &Arc, slot: u64) { self.storage.set_slot(slot); - if 0 != slot % self.snapshot_frequency { + if !slot.is_multiple_of(self.snapshot_frequency) { return; } let this = self.clone(); diff --git a/magicblock-accounts/src/errors.rs b/magicblock-accounts/src/errors.rs index b5f9d9c0a..3b7e83f33 100644 --- a/magicblock-accounts/src/errors.rs +++ b/magicblock-accounts/src/errors.rs @@ -61,7 +61,13 @@ pub enum ScheduledCommitsProcessorError { #[error("RecvError: {0}")] RecvError(#[from] RecvError), #[error("CommittorSerivceError")] - CommittorSerivceError(#[from] CommittorServiceError), + CommittorSerivceError(Box), +} + +impl From for ScheduledCommitsProcessorError { + fn from(e: CommittorServiceError) -> Self { + Self::CommittorSerivceError(Box::new(e)) + } } pub type ScheduledCommitsProcessorResult< diff --git a/magicblock-api/src/errors.rs b/magicblock-api/src/errors.rs index e37ef40f9..2bd25b5a5 100644 --- a/magicblock-api/src/errors.rs +++ b/magicblock-api/src/errors.rs @@ -13,16 +13,16 @@ pub enum ApiError { RpcError(#[from] magicblock_aperture::error::RpcError), #[error("Accounts error: {0}")] - AccountsError(#[from] magicblock_accounts::errors::AccountsError), + AccountsError(Box), #[error("AccountCloner error: {0}")] - AccountClonerError(#[from] magicblock_account_cloner::AccountClonerError), + AccountClonerError(Box), #[error("Ledger error: {0}")] - LedgerError(#[from] magicblock_ledger::errors::LedgerError), + LedgerError(Box), #[error("Chainlink error: {0}")] - ChainlinkError(#[from] magicblock_chainlink::errors::ChainlinkError), + ChainlinkError(Box), #[error("Failed to obtain balance for validator '{0}' from chain. ({1})")] FailedToObtainValidatorOnChainBalance(Pubkey, String), @@ -32,7 +32,7 @@ pub enum ApiError { #[error("CommittorServiceError")] CommittorServiceError( - #[from] magicblock_committor_service::error::CommittorServiceError, + Box, ), #[error("Failed to load programs into bank: {0}")] @@ -91,7 +91,7 @@ pub enum ApiError { #[error("TaskSchedulerServiceError")] TaskSchedulerServiceError( - #[from] magicblock_task_scheduler::TaskSchedulerError, + Box, ), #[error("Failed to sanitize transaction: {0}")] @@ -99,3 +99,39 @@ pub enum ApiError { #[from] solana_sdk::transaction::TransactionError, ), } + +impl From for ApiError { + fn from(e: magicblock_accounts::errors::AccountsError) -> Self { + Self::AccountsError(Box::new(e)) + } +} + +impl From for ApiError { + fn from(e: magicblock_account_cloner::AccountClonerError) -> Self { + Self::AccountClonerError(Box::new(e)) + } +} + +impl From for ApiError { + fn from(e: magicblock_ledger::errors::LedgerError) -> Self { + Self::LedgerError(Box::new(e)) + } +} + +impl From for ApiError { + fn from(e: magicblock_chainlink::errors::ChainlinkError) -> Self { + Self::ChainlinkError(Box::new(e)) + } +} + +impl From for ApiError { + fn from(e: magicblock_committor_service::error::CommittorServiceError) -> Self { + Self::CommittorServiceError(Box::new(e)) + } +} + +impl From for ApiError { + fn from(e: magicblock_task_scheduler::TaskSchedulerError) -> Self { + Self::TaskSchedulerServiceError(Box::new(e)) + } +} diff --git a/magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs b/magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs index 9ff65d4bc..f873e3bf5 100644 --- a/magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs +++ b/magicblock-chainlink/src/chainlink/account_still_undelegating_on_chain.rs @@ -15,7 +15,7 @@ use solana_pubkey::Pubkey; /// - `pubkey`: the account pubkey /// - `is_delegated_on_chain`: whether the account is currently delegated to us on chain /// - `remote_slot_in_bank`: the chain slot at which we last fetched and cloned state -/// of the account in our bank +/// of the account in our bank /// - `delegation_record`: the delegation record associated with the account in our bank, if found /// - `validator_auth`: the validator authority pubkey /// - returns `true` if the account is still undelegating, `false` otherwise. diff --git a/magicblock-chainlink/src/remote_account_provider/errors.rs b/magicblock-chainlink/src/remote_account_provider/errors.rs index c1ad41405..8411f4a3b 100644 --- a/magicblock-chainlink/src/remote_account_provider/errors.rs +++ b/magicblock-chainlink/src/remote_account_provider/errors.rs @@ -7,9 +7,7 @@ pub type RemoteAccountProviderResult = #[derive(Debug, Error)] pub enum RemoteAccountProviderError { #[error("Pubsub client error: {0}")] - PubsubClientError( - #[from] solana_pubsub_client::pubsub_client::PubsubClientError, - ), + PubsubClientError(Box), #[error(transparent)] JoinError(#[from] tokio::task::JoinError), @@ -88,3 +86,11 @@ pub enum RemoteAccountProviderError { )] LoaderV4StateDeserializationFailed(Pubkey, String), } + +impl From + for RemoteAccountProviderError +{ + fn from(e: solana_pubsub_client::pubsub_client::PubsubClientError) -> Self { + Self::PubsubClientError(Box::new(e)) + } +} diff --git a/magicblock-committor-program/src/state/changeset.rs b/magicblock-committor-program/src/state/changeset.rs index 5e96cbbb9..e83313391 100644 --- a/magicblock-committor-program/src/state/changeset.rs +++ b/magicblock-committor-program/src/state/changeset.rs @@ -369,7 +369,7 @@ impl CommitableAccount { 1 } else { let count = len / chunk_size as usize; - if len % chunk_size as usize > 0 { + if !len.is_multiple_of(chunk_size as usize) { count + 1 } else { count diff --git a/magicblock-committor-program/src/state/chunks.rs b/magicblock-committor-program/src/state/chunks.rs index c31629f8b..5399bb501 100644 --- a/magicblock-committor-program/src/state/chunks.rs +++ b/magicblock-committor-program/src/state/chunks.rs @@ -97,7 +97,7 @@ impl Chunks { &mut self, offset: usize, ) -> Result<(), ChunksError> { - if offset % self.chunk_size as usize != 0 { + if !offset.is_multiple_of(self.chunk_size as usize) { Err(ChunksError::InvalidOffsetError(offset, self.chunk_size)) } else { let idx = offset / self.chunk_size as usize; @@ -112,7 +112,7 @@ impl Chunks { &self, offset: usize, ) -> Result { - if offset % self.chunk_size as usize != 0 { + if !offset.is_multiple_of(self.chunk_size as usize) { return Err(ChunksError::InvalidOffsetError( offset, self.chunk_size, @@ -184,7 +184,7 @@ mod test { use super::*; impl Chunks { - pub(super) fn iter(&self) -> ChunksIter { + pub(super) fn iter(&self) -> ChunksIter<'_> { ChunksIter { chunks: self, idx: 0, diff --git a/magicblock-committor-service/src/compute_budget.rs b/magicblock-committor-service/src/compute_budget.rs index 68e81212e..0e8b24e08 100644 --- a/magicblock-committor-service/src/compute_budget.rs +++ b/magicblock-committor-service/src/compute_budget.rs @@ -59,9 +59,7 @@ impl BufferWriteChunkBudget { .checked_mul(bytes_count) .unwrap_or(u32::MAX as usize), ) - .unwrap_or(u32::MAX) - .checked_add(self.base_budget) - .unwrap_or(u32::MAX) + .unwrap_or(u32::MAX).saturating_add(self.base_budget) } pub fn instructions(&self, bytes_count: usize) -> Vec { diff --git a/magicblock-committor-service/src/error.rs b/magicblock-committor-service/src/error.rs index 2a273e06b..508972ddb 100644 --- a/magicblock-committor-service/src/error.rs +++ b/magicblock-committor-service/src/error.rs @@ -41,12 +41,12 @@ pub enum CommittorServiceError { #[error("Failed to send init changeset account: {0} ({0:?})")] FailedToSendInitChangesetAccount( - solana_rpc_client_api::client_error::Error, + Box, ), #[error("Failed to confirm init changeset account: {0} ({0:?})")] FailedToConfirmInitChangesetAccount( - solana_rpc_client_api::client_error::Error, + Box, ), #[error("Init transaction '{0}' was not confirmed")] InitChangesetAccountNotConfirmed(String), diff --git a/magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs b/magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs index 8a77ebdaf..5b1b359b7 100644 --- a/magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs +++ b/magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs @@ -361,7 +361,7 @@ where #[cfg(test)] mod tests { use std::{ - collections::{HashMap, HashSet}, + collections::HashSet, sync::{ atomic::{AtomicUsize, Ordering}, Arc, @@ -386,9 +386,6 @@ mod tests { }, intent_executor::{ error::{IntentExecutorError as ExecutorError, InternalError}, - task_info_fetcher::{ - ResetType, TaskInfoFetcher, TaskInfoFetcherResult, - }, IntentExecutionResult, }, persist::IntentPersisterImpl, @@ -821,29 +818,4 @@ mod tests { Ok(()) } } - - #[derive(Clone)] - pub struct MockInfoFetcher; - #[async_trait] - impl TaskInfoFetcher for MockInfoFetcher { - async fn fetch_next_commit_ids( - &self, - pubkeys: &[Pubkey], - ) -> TaskInfoFetcherResult> { - Ok(pubkeys.iter().map(|&k| (k, 1)).collect()) - } - - async fn fetch_rent_reimbursements( - &self, - pubkeys: &[Pubkey], - ) -> TaskInfoFetcherResult> { - Ok(pubkeys.iter().map(|_| Pubkey::new_unique()).collect()) - } - - fn peek_commit_id(&self, _pubkey: &Pubkey) -> Option { - None - } - - fn reset(&self, _: ResetType) {} - } } diff --git a/magicblock-committor-service/src/intent_executor/error.rs b/magicblock-committor-service/src/intent_executor/error.rs index f47249598..7db2e5132 100644 --- a/magicblock-committor-service/src/intent_executor/error.rs +++ b/magicblock-committor-service/src/intent_executor/error.rs @@ -22,7 +22,13 @@ pub enum InternalError { #[error("SignerError: {0}")] SignerError(#[from] SignerError), #[error("MagicBlockRpcClientError: {0}")] - MagicBlockRpcClientError(#[from] MagicBlockRpcClientError), + MagicBlockRpcClientError(Box), +} + +impl From for InternalError { + fn from(e: MagicBlockRpcClientError) -> Self { + Self::MagicBlockRpcClientError(Box::new(e)) + } } impl InternalError { @@ -144,7 +150,7 @@ pub enum TransactionStrategyExecutionError { impl From for TransactionStrategyExecutionError { fn from(value: MagicBlockRpcClientError) -> Self { - Self::InternalError(InternalError::MagicBlockRpcClientError(value)) + Self::InternalError(InternalError::from(value)) } } diff --git a/magicblock-committor-service/src/intent_executor/mod.rs b/magicblock-committor-service/src/intent_executor/mod.rs index f6c15bd56..d37346c19 100644 --- a/magicblock-committor-service/src/intent_executor/mod.rs +++ b/magicblock-committor-service/src/intent_executor/mod.rs @@ -688,7 +688,7 @@ where InternalError::MagicBlockRpcClientError(err) => { map_magicblock_client_error( &self.transaction_error_mapper, - err, + *err, ) } err => { diff --git a/magicblock-committor-service/src/intent_executor/task_info_fetcher.rs b/magicblock-committor-service/src/intent_executor/task_info_fetcher.rs index 6ec16fd95..9c1607d8c 100644 --- a/magicblock-committor-service/src/intent_executor/task_info_fetcher.rs +++ b/magicblock-committor-service/src/intent_executor/task_info_fetcher.rs @@ -14,7 +14,7 @@ use solana_pubkey::Pubkey; use solana_sdk::signature::Signature; const NUM_FETCH_RETRIES: NonZeroUsize = - unsafe { NonZeroUsize::new_unchecked(5) }; + NonZeroUsize::new(5).unwrap(); const MUTEX_POISONED_MSG: &str = "CacheTaskInfoFetcher mutex poisoned!"; #[async_trait] @@ -52,7 +52,7 @@ pub struct CacheTaskInfoFetcher { impl CacheTaskInfoFetcher { pub fn new(rpc_client: MagicblockRpcClient) -> Self { const CACHE_SIZE: NonZeroUsize = - unsafe { NonZeroUsize::new_unchecked(1000) }; + NonZeroUsize::new(1000).unwrap(); Self { rpc_client, @@ -274,7 +274,13 @@ pub enum TaskInfoFetcherError { #[error("InvalidAccountDataError for: {0}")] InvalidAccountDataError(Pubkey), #[error("MagicBlockRpcClientError: {0}")] - MagicBlockRpcClientError(#[from] MagicBlockRpcClientError), + MagicBlockRpcClientError(Box), +} + +impl From for TaskInfoFetcherError { + fn from(e: MagicBlockRpcClientError) -> Self { + Self::MagicBlockRpcClientError(Box::new(e)) + } } impl TaskInfoFetcherError { diff --git a/magicblock-committor-service/src/persist/db.rs b/magicblock-committor-service/src/persist/db.rs index 15d68c0a8..72c62bfe8 100644 --- a/magicblock-committor-service/src/persist/db.rs +++ b/magicblock-committor-service/src/persist/db.rs @@ -853,7 +853,8 @@ mod tests { fn test_set_commit_id() { let (mut db, _file) = setup_test_db(); let row = create_test_row(1, 0); - db.insert_commit_status_rows(&[row.clone()]).unwrap(); + db.insert_commit_status_rows(std::slice::from_ref(&row)) + .unwrap(); // Update commit_id db.set_commit_id(1, &row.pubkey, 100).unwrap(); @@ -867,7 +868,8 @@ mod tests { fn test_update_status_by_message() { let (mut db, _file) = setup_test_db(); let row = create_test_row(1, 0); - db.insert_commit_status_rows(&[row.clone()]).unwrap(); + db.insert_commit_status_rows(std::slice::from_ref(&row)) + .unwrap(); let new_status = CommitStatus::Pending; db.update_status_by_message(1, &row.pubkey, &new_status) @@ -881,7 +883,8 @@ mod tests { fn test_update_status_by_commit() { let (mut db, _file) = setup_test_db(); let row = create_test_row(1, 100); // Set commit_id to 100 - db.insert_commit_status_rows(&[row.clone()]).unwrap(); + db.insert_commit_status_rows(std::slice::from_ref(&row)) + .unwrap(); let new_status = CommitStatus::Succeeded(CommitStatusSignatures { commit_stage_signature: Signature::new_unique(), @@ -898,7 +901,8 @@ mod tests { fn test_set_commit_strategy() { let (mut db, _file) = setup_test_db(); let row = create_test_row(1, 100); - db.insert_commit_status_rows(&[row.clone()]).unwrap(); + db.insert_commit_status_rows(std::slice::from_ref(&row)) + .unwrap(); let new_strategy = CommitStrategy::FromBuffer; db.set_commit_strategy(100, &row.pubkey, new_strategy) diff --git a/magicblock-committor-service/src/service_ext.rs b/magicblock-committor-service/src/service_ext.rs index c0e344ce2..0023b9e23 100644 --- a/magicblock-committor-service/src/service_ext.rs +++ b/magicblock-committor-service/src/service_ext.rs @@ -225,7 +225,13 @@ pub enum CommittorServiceExtError { #[error("RecvError: {0}")] RecvError(#[from] RecvError), #[error("CommittorServiceError: {0:?}")] - CommittorServiceError(#[from] CommittorServiceError), + CommittorServiceError(Box), +} + +impl From for CommittorServiceExtError { + fn from(e: CommittorServiceError) -> Self { + Self::CommittorServiceError(Box::new(e)) + } } pub type BaseIntentCommitorExtResult = diff --git a/magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs b/magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs index 703b9f870..28a550668 100644 --- a/magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs +++ b/magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs @@ -346,7 +346,7 @@ impl DeliveryPreparator { TransactionSendError::MagicBlockRpcClientError(err) => { map_magicblock_client_error( &self.transaction_error_mapper, - err, + *err, ) } err => BufferExecutionError::TransactionSendError(err), @@ -506,7 +506,13 @@ pub enum TransactionSendError { #[error("SignerError: {0}")] SignerError(#[from] SignerError), #[error("MagicBlockRpcClientError: {0}")] - MagicBlockRpcClientError(#[from] MagicBlockRpcClientError), + MagicBlockRpcClientError(Box), +} + +impl From for TransactionSendError { + fn from(e: MagicBlockRpcClientError) -> Self { + Self::MagicBlockRpcClientError(Box::new(e)) + } } impl TransactionSendError { @@ -541,7 +547,7 @@ impl BufferExecutionError { impl From for BufferExecutionError { fn from(value: MagicBlockRpcClientError) -> Self { Self::TransactionSendError( - TransactionSendError::MagicBlockRpcClientError(value), + TransactionSendError::MagicBlockRpcClientError(Box::new(value)), ) } } @@ -557,13 +563,19 @@ pub enum InternalError { #[error("TableManiaError: {0}")] TableManiaError(#[from] TableManiaError), #[error("MagicBlockRpcClientError: {0}")] - MagicBlockRpcClientError(#[from] MagicBlockRpcClientError), + MagicBlockRpcClientError(Box), #[error("BufferExecutionError: {0}")] BufferExecutionError(#[from] BufferExecutionError), #[error("BaseTaskError: {0}")] BaseTaskError(#[from] BaseTaskError), } +impl From for InternalError { + fn from(e: MagicBlockRpcClientError) -> Self { + Self::MagicBlockRpcClientError(Box::new(e)) + } +} + impl InternalError { pub fn signature(&self) -> Option { match self { diff --git a/magicblock-committor-service/src/transaction_preparator/error.rs b/magicblock-committor-service/src/transaction_preparator/error.rs index 75772daca..f29cf3424 100644 --- a/magicblock-committor-service/src/transaction_preparator/error.rs +++ b/magicblock-committor-service/src/transaction_preparator/error.rs @@ -13,7 +13,13 @@ pub enum TransactionPreparatorError { #[error("SignerError: {0}")] SignerError(#[from] SignerError), #[error("DeliveryPreparationError: {0}")] - DeliveryPreparationError(#[from] DeliveryPreparatorError), + DeliveryPreparationError(Box), +} + +impl From for TransactionPreparatorError { + fn from(e: DeliveryPreparatorError) -> Self { + Self::DeliveryPreparationError(Box::new(e)) + } } impl TransactionPreparatorError { diff --git a/magicblock-config/src/lib.rs b/magicblock-config/src/lib.rs index f1f6f8bbe..fa6b37c02 100644 --- a/magicblock-config/src/lib.rs +++ b/magicblock-config/src/lib.rs @@ -67,7 +67,7 @@ impl ValidatorParams { /// Precedence: CLI (if set) > Environment > TOML File > Defaults pub fn try_new( args: impl Iterator, - ) -> figment::Result { + ) -> Result> { // 1. Parse CLI arguments into the "Overlay" struct let cli = CliParams::parse_from(args); @@ -91,7 +91,7 @@ impl ValidatorParams { // 5. Merge CLI "Overlay" (Highest Priority) figment = figment.merge(Serialized::from(&cli, Profile::Default)); - figment.extract() + figment.extract().map_err(Box::new) } } diff --git a/magicblock-ledger/src/blockstore_processor/mod.rs b/magicblock-ledger/src/blockstore_processor/mod.rs index 5500e4634..a4268c552 100644 --- a/magicblock-ledger/src/blockstore_processor/mod.rs +++ b/magicblock-ledger/src/blockstore_processor/mod.rs @@ -56,7 +56,7 @@ async fn replay_blocks( break; }; if log::log_enabled!(Level::Info) - && slot % PROGRESS_REPORT_INTERVAL == 0 + && slot.is_multiple_of(PROGRESS_REPORT_INTERVAL) { info!( "Processing block: {}/{}", diff --git a/magicblock-ledger/src/database/db.rs b/magicblock-ledger/src/database/db.rs index 84b62947c..4609d2db3 100644 --- a/magicblock-ledger/src/database/db.rs +++ b/magicblock-ledger/src/database/db.rs @@ -102,11 +102,11 @@ impl Database { } #[inline] - pub fn raw_iterator_cf(&self, cf: &ColumnFamily) -> DBRawIterator { + pub fn raw_iterator_cf(&self, cf: &ColumnFamily) -> DBRawIterator<'_> { self.backend.raw_iterator_cf(cf) } - pub fn batch(&self) -> WriteBatch { + pub fn batch(&self) -> WriteBatch<'_> { let write_batch = self.backend.batch(); let map = columns() .into_iter() diff --git a/magicblock-ledger/src/database/rocks_db.rs b/magicblock-ledger/src/database/rocks_db.rs index 319fda9da..296993331 100644 --- a/magicblock-ledger/src/database/rocks_db.rs +++ b/magicblock-ledger/src/database/rocks_db.rs @@ -84,7 +84,7 @@ impl Rocks { &self, cf: &ColumnFamily, key: &[u8], - ) -> LedgerResult> { + ) -> LedgerResult>> { let opt = self.db.get_pinned_cf(cf, key)?; Ok(opt) } @@ -103,7 +103,7 @@ impl Rocks { &self, cf: &ColumnFamily, keys: Vec<&[u8]>, - ) -> Vec>> { + ) -> Vec>>> { let values = self .db .batched_multi_get_cf(cf, keys, false) @@ -173,7 +173,7 @@ impl Rocks { &self, cf: &ColumnFamily, iterator_mode: IteratorMode, - ) -> DBIterator + ) -> DBIterator<'_> where C: Column, { @@ -193,7 +193,7 @@ impl Rocks { &self, cf: &ColumnFamily, iterator_mode: IteratorMode>, - ) -> DBIterator { + ) -> DBIterator<'_> { let start_key; let iterator_mode = match iterator_mode { IteratorMode::From(start_from, direction) => { @@ -206,7 +206,7 @@ impl Rocks { self.db.iterator_cf(cf, iterator_mode) } - pub fn raw_iterator_cf(&self, cf: &ColumnFamily) -> DBRawIterator { + pub fn raw_iterator_cf(&self, cf: &ColumnFamily) -> DBRawIterator<'_> { self.db.raw_iterator_cf(cf) } diff --git a/magicblock-ledger/src/store/api.rs b/magicblock-ledger/src/store/api.rs index 00a762c99..de1d0b33c 100644 --- a/magicblock-ledger/src/store/api.rs +++ b/magicblock-ledger/src/store/api.rs @@ -207,7 +207,7 @@ impl Ledger { fn check_lowest_cleanup_slot( &self, slot: Slot, - ) -> LedgerResult> { + ) -> LedgerResult> { // lowest_cleanup_slot is the last slot that was not cleaned up by LedgerCleanupService let lowest_cleanup_slot = self .lowest_cleanup_slot @@ -229,7 +229,7 @@ impl Ledger { /// consistency with slot-based delete_range. fn ensure_lowest_cleanup_slot( &self, - ) -> (std::sync::RwLockReadGuard, Slot) { + ) -> (std::sync::RwLockReadGuard<'_, Slot>, Slot) { let lowest_cleanup_slot = self .lowest_cleanup_slot .read() @@ -418,15 +418,15 @@ impl Ledger { /// the provided args. /// /// * `highest_slot` - Highest slot to consider for the search inclusive. - /// Any signatures with a slot higher than this will be ignored. - /// In the original implementation this allows ignoring signatures - /// that haven't reached a specific commitment level yet. - /// For us it will be the current slot in most cases. - /// The slot determined for `before` overrides this when provided + /// Any signatures with a slot higher than this will be ignored. + /// In the original implementation this allows ignoring signatures + /// that haven't reached a specific commitment level yet. + /// For us it will be the current slot in most cases. + /// The slot determined for `before` overrides this when provided /// - *`upper_limit_signature`* - start searching backwards from this transaction - /// signature. If not provided the search starts from the top of the highest_slot + /// signature. If not provided the search starts from the top of the highest_slot /// - *`lower_limit_signature`* - search backwards until this transaction signature, - /// if found before limit is reached + /// if found before limit is reached /// - *`limit`* - maximum number of signatures to return (max: 1000) /// /// ## Example @@ -852,7 +852,7 @@ impl Ledger { /// * `signature` - Signature of the transaction /// * `slot` - Slot at which the transaction was confirmed /// * `transaction` - Transaction to be written, we take a SanititizedTransaction here - /// since that is what we provide Geyser as well + /// since that is what we provide Geyser as well /// * `status` - status of the transaction pub fn write_transaction( &self, @@ -1046,7 +1046,7 @@ impl Ledger { /// /// - `iterator_mode` - The iterator mode to use for the search, defaults to [`IteratorMode::Start`] /// - `success` - If true, only successful transactions are returned, - /// otherwise only failed ones + /// otherwise only failed ones pub fn iter_transaction_statuses( &self, iterator_mode: Option>, diff --git a/magicblock-magic-program-api/src/instruction.rs b/magicblock-magic-program-api/src/instruction.rs index 65ec33ccf..a137815b8 100644 --- a/magicblock-magic-program-api/src/instruction.rs +++ b/magicblock-magic-program-api/src/instruction.rs @@ -26,7 +26,7 @@ pub enum MagicBlockInstruction { /// # Account references /// - **0.** `[WRITE, SIGNER]` Payer requesting the commit to be scheduled /// - **1.** `[WRITE]` Magic Context Account containing to which we store - /// the scheduled commits + /// the scheduled commits /// - **2..n** `[]` Accounts to be committed ScheduleCommit, @@ -43,7 +43,7 @@ pub enum MagicBlockInstruction { /// # Account references /// - **0.** `[WRITE, SIGNER]` Payer requesting the commit to be scheduled /// - **1.** `[WRITE]` Magic Context Account containing to which we store - /// the scheduled commits + /// the scheduled commits /// - **2..n** `[]` Accounts to be committed and undelegated ScheduleCommitAndUndelegate, diff --git a/magicblock-rpc-client/src/lib.rs b/magicblock-rpc-client/src/lib.rs index f7fcd7ce2..2cb33de95 100644 --- a/magicblock-rpc-client/src/lib.rs +++ b/magicblock-rpc-client/src/lib.rs @@ -50,19 +50,19 @@ pub const SEND_TRANSACTION_CONFIG: RpcSendTransactionConfig = #[derive(Debug, thiserror::Error)] pub enum MagicBlockRpcClientError { #[error("RPC Client error: {0}")] - RpcClientError(#[from] solana_rpc_client_api::client_error::Error), + RpcClientError(Box), #[error("Error getting blockhash: {0} ({0:?})")] - GetLatestBlockhash(solana_rpc_client_api::client_error::Error), + GetLatestBlockhash(Box), #[error("Error getting slot: {0} ({0:?})")] - GetSlot(solana_rpc_client_api::client_error::Error), + GetSlot(Box), #[error("Error deserializing lookup table: {0}")] LookupTableDeserialize(solana_sdk::instruction::InstructionError), #[error("Error sending transaction: {0} ({0:?})")] - SendTransaction(solana_rpc_client_api::client_error::Error), + SendTransaction(Box), #[error("Error getting signature status for: {0} {1}")] CannotGetTransactionSignatureStatus(Signature, String), @@ -76,6 +76,12 @@ pub enum MagicBlockRpcClientError { SentTransactionError(TransactionError, Signature), } +impl From for MagicBlockRpcClientError { + fn from(e: solana_rpc_client_api::client_error::Error) -> Self { + Self::RpcClientError(Box::new(e)) + } +} + impl MagicBlockRpcClientError { /// Returns the signature of the transaction that caused the error /// if available. @@ -242,14 +248,14 @@ impl MagicblockRpcClient { self.client .get_latest_blockhash() .await - .map_err(MagicBlockRpcClientError::GetLatestBlockhash) + .map_err(|e| MagicBlockRpcClientError::GetLatestBlockhash(Box::new(e))) } pub async fn get_slot(&self) -> MagicBlockRpcClientResult { self.client .get_slot() .await - .map_err(MagicBlockRpcClientError::GetSlot) + .map_err(|e| MagicBlockRpcClientError::GetSlot(Box::new(e))) } pub async fn get_account( @@ -270,7 +276,7 @@ impl MagicblockRpcClient { _ => err, }, }; - Err(MagicBlockRpcClientError::RpcClientError(err)) + Err(MagicBlockRpcClientError::RpcClientError(Box::new(err))) } pub async fn get_multiple_accounts( &self, @@ -308,9 +314,7 @@ impl MagicblockRpcClient { for result in chunked_results { match result { Ok(accs) => results.extend(accs.value), - Err(err) => { - return Err(MagicBlockRpcClientError::RpcClientError(err)) - } + Err(err) => return Err(err.into()), } } Ok(results) @@ -352,7 +356,7 @@ impl MagicblockRpcClient { self.client .request_airdrop(pubkey, lamports) .await - .map_err(MagicBlockRpcClientError::RpcClientError) + .map_err(|e| MagicBlockRpcClientError::RpcClientError(Box::new(e))) } pub fn commitment(&self) -> CommitmentConfig { @@ -399,7 +403,7 @@ impl MagicblockRpcClient { .client .send_transaction_with_config(tx, SEND_TRANSACTION_CONFIG) .await - .map_err(MagicBlockRpcClientError::SendTransaction)?; + .map_err(|e| MagicBlockRpcClientError::SendTransaction(Box::new(e)))?; let MagicBlockSendTransactionConfig::SendAndConfirm { wait_for_processed_level, @@ -577,7 +581,7 @@ impl MagicblockRpcClient { self.client .get_transaction_with_config(signature, config) .await - .map_err(MagicBlockRpcClientError::RpcClientError) + .map_err(|e| MagicBlockRpcClientError::RpcClientError(Box::new(e))) } pub fn get_logs_from_transaction( diff --git a/magicblock-rpc-client/src/utils.rs b/magicblock-rpc-client/src/utils.rs index 95aba1789..e2d22ee7f 100644 --- a/magicblock-rpc-client/src/utils.rs +++ b/magicblock-rpc-client/src/utils.rs @@ -112,13 +112,13 @@ where } } MagicBlockRpcClientError::RpcClientError(err) => { - match try_map_client_error(transaction_error_mapper, err) { + match try_map_client_error(transaction_error_mapper, *err) { Ok(mapped_err) => mapped_err, Err(original) => MagicBlockRpcClientError::RpcClientError(original).into() } } MagicBlockRpcClientError::SendTransaction(err) => { - match try_map_client_error(transaction_error_mapper, err) { + match try_map_client_error(transaction_error_mapper, *err) { Ok(mapped_err) => mapped_err, Err(original) => MagicBlockRpcClientError::SendTransaction(original).into() } @@ -143,7 +143,7 @@ where pub fn try_map_client_error( transaction_error_mapper: &TxMap, err: solana_rpc_client_api::client_error::Error, -) -> Result +) -> Result> where TxMap: TransactionErrorMapper, { @@ -152,10 +152,10 @@ where transaction_error_mapper .try_map(transaction_err, None) .map_err(|transaction_err| { - solana_rpc_client_api::client_error::Error { + Box::new(solana_rpc_client_api::client_error::Error { request: err.request, kind: ErrorKind::TransactionError(transaction_err), - } + }) }) } err_kind @ (ErrorKind::Reqwest(_) @@ -165,10 +165,10 @@ where | ErrorKind::SigningError(_) | ErrorKind::Custom(_) | ErrorKind::Io(_)) => { - Err(solana_rpc_client_api::client_error::Error { + Err(Box::new(solana_rpc_client_api::client_error::Error { request: err.request, kind: err_kind, - }) + })) } } } diff --git a/magicblock-table-mania/src/lookup_table_rc.rs b/magicblock-table-mania/src/lookup_table_rc.rs index 2a245c387..c3b76cba5 100644 --- a/magicblock-table-mania/src/lookup_table_rc.rs +++ b/magicblock-table-mania/src/lookup_table_rc.rs @@ -172,9 +172,7 @@ impl fmt::Display for LookupTableRc { } => { let comma_separated_pubkeys = pubkeys .read() - .expect("pubkeys rwlock poisoned") - .iter() - .map(|(key, _)| key.to_string()) + .expect("pubkeys rwlock poisoned").keys().map(|key| key.to_string()) .collect::>() .join(", "); let comma_separated_sigs = extend_signatures diff --git a/magicblock-task-scheduler/src/errors.rs b/magicblock-task-scheduler/src/errors.rs index e76cea504..ba20a9adb 100644 --- a/magicblock-task-scheduler/src/errors.rs +++ b/magicblock-task-scheduler/src/errors.rs @@ -10,8 +10,7 @@ pub enum TaskSchedulerError { #[error(transparent)] Pubsub( - #[from] - solana_pubsub_client::nonblocking::pubsub_client::PubsubClientError, + Box, ), #[error(transparent)] @@ -44,3 +43,13 @@ pub enum TaskSchedulerError { #[error("Task {0} already exists and is owned by {1}, not {2}")] UnauthorizedReplacing(i64, String, String), } + +impl From + for TaskSchedulerError +{ + fn from( + e: solana_pubsub_client::nonblocking::pubsub_client::PubsubClientError, + ) -> Self { + Self::Pubsub(Box::new(e)) + } +} diff --git a/magicblock-validator-admin/src/claim_fees.rs b/magicblock-validator-admin/src/claim_fees.rs index 18815e43e..8658e16ec 100644 --- a/magicblock-validator-admin/src/claim_fees.rs +++ b/magicblock-validator-admin/src/claim_fees.rs @@ -81,7 +81,7 @@ async fn claim_fees(url: String) -> Result<(), MagicBlockRpcClientError> { let latest_blockhash = rpc_client .get_latest_blockhash() .await - .map_err(MagicBlockRpcClientError::GetLatestBlockhash)?; + .map_err(|e| MagicBlockRpcClientError::GetLatestBlockhash(Box::new(e)))?; let tx = Transaction::new_signed_with_payer( &[ix], @@ -93,7 +93,7 @@ async fn claim_fees(url: String) -> Result<(), MagicBlockRpcClientError> { rpc_client .send_and_confirm_transaction(&tx) .await - .map_err(MagicBlockRpcClientError::SendTransaction)?; + .map_err(|e| MagicBlockRpcClientError::SendTransaction(Box::new(e)))?; info!("Successfully claimed validator fees"); diff --git a/programs/guinea/src/lib.rs b/programs/guinea/src/lib.rs index 322ca4cc3..453e168dd 100644 --- a/programs/guinea/src/lib.rs +++ b/programs/guinea/src/lib.rs @@ -160,7 +160,7 @@ fn cancel_task( vec![AccountMeta::new(*payer_info.key, true)], ); - invoke(&ix, &[payer_info.clone()])?; + invoke(&ix, std::slice::from_ref(payer_info))?; Ok(()) } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index fcb78ec56..d6d338197 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.84.1" +channel = "1.91.1" diff --git a/test-integration/rust-toolchain.toml b/test-integration/rust-toolchain.toml new file mode 100644 index 000000000..d6d338197 --- /dev/null +++ b/test-integration/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.91.1" diff --git a/test-kit/src/lib.rs b/test-kit/src/lib.rs index c5572c140..c0d992a5c 100644 --- a/test-kit/src/lib.rs +++ b/test-kit/src/lib.rs @@ -291,7 +291,7 @@ impl ExecutionTestEnv { } } - pub fn get_payer(&self) -> CommitableAccount { + pub fn get_payer(&self) -> CommitableAccount<'_> { self.get_account(self.payer.pubkey()) } } diff --git a/tools/ledger-stats/src/accounts.rs b/tools/ledger-stats/src/accounts.rs index 412c46d63..743a9ec50 100644 --- a/tools/ledger-stats/src/accounts.rs +++ b/tools/ledger-stats/src/accounts.rs @@ -124,7 +124,7 @@ pub fn print_accounts( }); all.into_iter() .filter(|acc| { - if !owner.map_or(true, |owner| acc.owner.eq(&owner)) { + if !owner.is_none_or(|owner| acc.owner.eq(&owner)) { return false; } if filters.contains(&FilterAccounts::Executable) diff --git a/tools/ledger-stats/src/transaction_details.rs b/tools/ledger-stats/src/transaction_details.rs index bc41b69c2..d4c15e61b 100644 --- a/tools/ledger-stats/src/transaction_details.rs +++ b/tools/ledger-stats/src/transaction_details.rs @@ -54,12 +54,12 @@ pub(crate) fn print_transaction_details( status_meta.pre_token_balances.as_ref().map_or_else( || "None".to_string(), |b| { - b.is_empty().then(|| "None".to_string()).unwrap_or_else(|| { + if b.is_empty() { "None".to_string() } else { { b.iter() .map(|b| b.ui_token_amount.amount.to_string()) .collect::>() .join(" | ") - }) + } } }, ); @@ -67,24 +67,24 @@ pub(crate) fn print_transaction_details( status_meta.post_token_balances.as_ref().map_or_else( || "None".to_string(), |b| { - b.is_empty().then(|| "None".to_string()).unwrap_or_else(|| { + if b.is_empty() { "None".to_string() } else { { b.iter() .map(|b| b.ui_token_amount.amount.to_string()) .collect::>() .join(" | ") - }) + } } }, ); let rewards = status_meta.rewards.as_ref().map_or_else( || "None".to_string(), |r| { - r.is_empty().then(|| "None".to_string()).unwrap_or_else(|| { + if r.is_empty() { "None".to_string() } else { { r.iter() .map(|r| r.lamports.to_formatted_string(&Locale::en)) .collect::>() .join(" | ") - }) + } } }, ); From fd7d33b7611d2d4e2da80ca004a131caff9af0cb Mon Sep 17 00:00:00 2001 From: Babur Makhmudov Date: Tue, 2 Dec 2025 16:37:24 +0400 Subject: [PATCH 2/4] fix: fmt --- magicblock-api/src/errors.rs | 8 +++- .../src/remote_account_provider/errors.rs | 4 +- .../src/compute_budget.rs | 3 +- .../src/intent_executor/task_info_fetcher.rs | 6 +-- magicblock-rpc-client/src/lib.rs | 15 +++--- magicblock-table-mania/src/lookup_table_rc.rs | 4 +- magicblock-task-scheduler/src/errors.rs | 4 +- magicblock-validator-admin/src/claim_fees.rs | 8 ++-- test-integration/Cargo.lock | 17 +++++++ tools/ledger-stats/src/transaction_details.rs | 48 ++++++++++++------- 10 files changed, 79 insertions(+), 38 deletions(-) diff --git a/magicblock-api/src/errors.rs b/magicblock-api/src/errors.rs index 2bd25b5a5..771511f00 100644 --- a/magicblock-api/src/errors.rs +++ b/magicblock-api/src/errors.rs @@ -124,8 +124,12 @@ impl From for ApiError { } } -impl From for ApiError { - fn from(e: magicblock_committor_service::error::CommittorServiceError) -> Self { +impl From + for ApiError +{ + fn from( + e: magicblock_committor_service::error::CommittorServiceError, + ) -> Self { Self::CommittorServiceError(Box::new(e)) } } diff --git a/magicblock-chainlink/src/remote_account_provider/errors.rs b/magicblock-chainlink/src/remote_account_provider/errors.rs index 8411f4a3b..43aee9230 100644 --- a/magicblock-chainlink/src/remote_account_provider/errors.rs +++ b/magicblock-chainlink/src/remote_account_provider/errors.rs @@ -7,7 +7,9 @@ pub type RemoteAccountProviderResult = #[derive(Debug, Error)] pub enum RemoteAccountProviderError { #[error("Pubsub client error: {0}")] - PubsubClientError(Box), + PubsubClientError( + Box, + ), #[error(transparent)] JoinError(#[from] tokio::task::JoinError), diff --git a/magicblock-committor-service/src/compute_budget.rs b/magicblock-committor-service/src/compute_budget.rs index 0e8b24e08..a4a2579bc 100644 --- a/magicblock-committor-service/src/compute_budget.rs +++ b/magicblock-committor-service/src/compute_budget.rs @@ -59,7 +59,8 @@ impl BufferWriteChunkBudget { .checked_mul(bytes_count) .unwrap_or(u32::MAX as usize), ) - .unwrap_or(u32::MAX).saturating_add(self.base_budget) + .unwrap_or(u32::MAX) + .saturating_add(self.base_budget) } pub fn instructions(&self, bytes_count: usize) -> Vec { diff --git a/magicblock-committor-service/src/intent_executor/task_info_fetcher.rs b/magicblock-committor-service/src/intent_executor/task_info_fetcher.rs index 9c1607d8c..febfaf693 100644 --- a/magicblock-committor-service/src/intent_executor/task_info_fetcher.rs +++ b/magicblock-committor-service/src/intent_executor/task_info_fetcher.rs @@ -13,8 +13,7 @@ use magicblock_rpc_client::{MagicBlockRpcClientError, MagicblockRpcClient}; use solana_pubkey::Pubkey; use solana_sdk::signature::Signature; -const NUM_FETCH_RETRIES: NonZeroUsize = - NonZeroUsize::new(5).unwrap(); +const NUM_FETCH_RETRIES: NonZeroUsize = NonZeroUsize::new(5).unwrap(); const MUTEX_POISONED_MSG: &str = "CacheTaskInfoFetcher mutex poisoned!"; #[async_trait] @@ -51,8 +50,7 @@ pub struct CacheTaskInfoFetcher { impl CacheTaskInfoFetcher { pub fn new(rpc_client: MagicblockRpcClient) -> Self { - const CACHE_SIZE: NonZeroUsize = - NonZeroUsize::new(1000).unwrap(); + const CACHE_SIZE: NonZeroUsize = NonZeroUsize::new(1000).unwrap(); Self { rpc_client, diff --git a/magicblock-rpc-client/src/lib.rs b/magicblock-rpc-client/src/lib.rs index 2cb33de95..adb66cf0b 100644 --- a/magicblock-rpc-client/src/lib.rs +++ b/magicblock-rpc-client/src/lib.rs @@ -76,7 +76,9 @@ pub enum MagicBlockRpcClientError { SentTransactionError(TransactionError, Signature), } -impl From for MagicBlockRpcClientError { +impl From + for MagicBlockRpcClientError +{ fn from(e: solana_rpc_client_api::client_error::Error) -> Self { Self::RpcClientError(Box::new(e)) } @@ -245,10 +247,9 @@ impl MagicblockRpcClient { pub async fn get_latest_blockhash( &self, ) -> MagicBlockRpcClientResult { - self.client - .get_latest_blockhash() - .await - .map_err(|e| MagicBlockRpcClientError::GetLatestBlockhash(Box::new(e))) + self.client.get_latest_blockhash().await.map_err(|e| { + MagicBlockRpcClientError::GetLatestBlockhash(Box::new(e)) + }) } pub async fn get_slot(&self) -> MagicBlockRpcClientResult { @@ -403,7 +404,9 @@ impl MagicblockRpcClient { .client .send_transaction_with_config(tx, SEND_TRANSACTION_CONFIG) .await - .map_err(|e| MagicBlockRpcClientError::SendTransaction(Box::new(e)))?; + .map_err(|e| { + MagicBlockRpcClientError::SendTransaction(Box::new(e)) + })?; let MagicBlockSendTransactionConfig::SendAndConfirm { wait_for_processed_level, diff --git a/magicblock-table-mania/src/lookup_table_rc.rs b/magicblock-table-mania/src/lookup_table_rc.rs index c3b76cba5..68854536f 100644 --- a/magicblock-table-mania/src/lookup_table_rc.rs +++ b/magicblock-table-mania/src/lookup_table_rc.rs @@ -172,7 +172,9 @@ impl fmt::Display for LookupTableRc { } => { let comma_separated_pubkeys = pubkeys .read() - .expect("pubkeys rwlock poisoned").keys().map(|key| key.to_string()) + .expect("pubkeys rwlock poisoned") + .keys() + .map(|key| key.to_string()) .collect::>() .join(", "); let comma_separated_sigs = extend_signatures diff --git a/magicblock-task-scheduler/src/errors.rs b/magicblock-task-scheduler/src/errors.rs index ba20a9adb..fe281077d 100644 --- a/magicblock-task-scheduler/src/errors.rs +++ b/magicblock-task-scheduler/src/errors.rs @@ -10,7 +10,9 @@ pub enum TaskSchedulerError { #[error(transparent)] Pubsub( - Box, + Box< + solana_pubsub_client::nonblocking::pubsub_client::PubsubClientError, + >, ), #[error(transparent)] diff --git a/magicblock-validator-admin/src/claim_fees.rs b/magicblock-validator-admin/src/claim_fees.rs index 8658e16ec..fbac74d1a 100644 --- a/magicblock-validator-admin/src/claim_fees.rs +++ b/magicblock-validator-admin/src/claim_fees.rs @@ -78,10 +78,10 @@ async fn claim_fees(url: String) -> Result<(), MagicBlockRpcClientError> { let ix = validator_claim_fees(validator, None); - let latest_blockhash = rpc_client - .get_latest_blockhash() - .await - .map_err(|e| MagicBlockRpcClientError::GetLatestBlockhash(Box::new(e)))?; + let latest_blockhash = + rpc_client.get_latest_blockhash().await.map_err(|e| { + MagicBlockRpcClientError::GetLatestBlockhash(Box::new(e)) + })?; let tx = Transaction::new_signed_with_payer( &[ix], diff --git a/test-integration/Cargo.lock b/test-integration/Cargo.lock index eb535057c..fb4cba1ef 100644 --- a/test-integration/Cargo.lock +++ b/test-integration/Cargo.lock @@ -63,6 +63,20 @@ dependencies = [ "zeroize", ] +[[package]] +name = "agave-geyser-plugin-interface" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df63ffb691b27f0253e893d083126cbe98a6b1ace29108992310f323f1ac50b0" +dependencies = [ + "log", + "solana-clock", + "solana-signature", + "solana-transaction", + "solana-transaction-status", + "thiserror 2.0.12", +] + [[package]] name = "agave-transaction-view" version = "2.2.1" @@ -3584,6 +3598,7 @@ dependencies = [ name = "magicblock-aperture" version = "0.3.1" dependencies = [ + "agave-geyser-plugin-interface", "arc-swap", "base64 0.21.7", "bincode", @@ -3594,6 +3609,7 @@ dependencies = [ "http-body-util", "hyper 1.6.0", "hyper-util", + "libloading 0.8.8", "log", "magicblock-account-cloner", "magicblock-accounts-db", @@ -3625,6 +3641,7 @@ dependencies = [ "solana-transaction-status", "solana-transaction-status-client-types", "sonic-rs", + "thiserror 1.0.69", "tokio", "tokio-util 0.7.15", ] diff --git a/tools/ledger-stats/src/transaction_details.rs b/tools/ledger-stats/src/transaction_details.rs index d4c15e61b..1bdd42b15 100644 --- a/tools/ledger-stats/src/transaction_details.rs +++ b/tools/ledger-stats/src/transaction_details.rs @@ -54,12 +54,16 @@ pub(crate) fn print_transaction_details( status_meta.pre_token_balances.as_ref().map_or_else( || "None".to_string(), |b| { - if b.is_empty() { "None".to_string() } else { { - b.iter() - .map(|b| b.ui_token_amount.amount.to_string()) - .collect::>() - .join(" | ") - } } + if b.is_empty() { + "None".to_string() + } else { + { + b.iter() + .map(|b| b.ui_token_amount.amount.to_string()) + .collect::>() + .join(" | ") + } + } }, ); @@ -67,24 +71,32 @@ pub(crate) fn print_transaction_details( status_meta.post_token_balances.as_ref().map_or_else( || "None".to_string(), |b| { - if b.is_empty() { "None".to_string() } else { { - b.iter() - .map(|b| b.ui_token_amount.amount.to_string()) - .collect::>() - .join(" | ") - } } + if b.is_empty() { + "None".to_string() + } else { + { + b.iter() + .map(|b| b.ui_token_amount.amount.to_string()) + .collect::>() + .join(" | ") + } + } }, ); let rewards = status_meta.rewards.as_ref().map_or_else( || "None".to_string(), |r| { - if r.is_empty() { "None".to_string() } else { { - r.iter() - .map(|r| r.lamports.to_formatted_string(&Locale::en)) - .collect::>() - .join(" | ") - } } + if r.is_empty() { + "None".to_string() + } else { + { + r.iter() + .map(|r| r.lamports.to_formatted_string(&Locale::en)) + .collect::>() + .join(" | ") + } + } }, ); From aaba678f72b1c15939697dcdde739b937445a18f Mon Sep 17 00:00:00 2001 From: Babur Makhmudov Date: Tue, 2 Dec 2025 17:38:15 +0400 Subject: [PATCH 3/4] fix: clippy warnings in integration tests --- magicblock-committor-program/src/lib.rs | 2 ++ .../src/state/changeset.rs | 2 +- .../src/state/chunks.rs | 4 ++-- test-integration/Cargo.lock | 17 ----------------- .../programs/flexi-counter/src/processor.rs | 2 +- .../programs/schedulecommit/src/utils/mod.rs | 4 ++-- .../client/src/schedule_commit_context.rs | 2 +- .../test-scenarios/tests/01_commits.rs | 1 + .../tests/test_ix_commit_local.rs | 2 +- test-integration/test-runner/src/env_config.rs | 4 ++-- .../test-tools/src/integration_test_context.rs | 10 ++++++++++ test-integration/test-tools/src/transactions.rs | 5 +++++ 12 files changed, 28 insertions(+), 27 deletions(-) diff --git a/magicblock-committor-program/src/lib.rs b/magicblock-committor-program/src/lib.rs index f1f5958de..5664b22eb 100644 --- a/magicblock-committor-program/src/lib.rs +++ b/magicblock-committor-program/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(clippy::manual_is_multiple_of)] + use solana_pubkey::declare_id; pub mod consts; pub mod error; diff --git a/magicblock-committor-program/src/state/changeset.rs b/magicblock-committor-program/src/state/changeset.rs index e83313391..672403435 100644 --- a/magicblock-committor-program/src/state/changeset.rs +++ b/magicblock-committor-program/src/state/changeset.rs @@ -369,7 +369,7 @@ impl CommitableAccount { 1 } else { let count = len / chunk_size as usize; - if !len.is_multiple_of(chunk_size as usize) { + if len % chunk_size as usize != 0 { count + 1 } else { count diff --git a/magicblock-committor-program/src/state/chunks.rs b/magicblock-committor-program/src/state/chunks.rs index 5399bb501..173667789 100644 --- a/magicblock-committor-program/src/state/chunks.rs +++ b/magicblock-committor-program/src/state/chunks.rs @@ -97,7 +97,7 @@ impl Chunks { &mut self, offset: usize, ) -> Result<(), ChunksError> { - if !offset.is_multiple_of(self.chunk_size as usize) { + if offset % self.chunk_size as usize != 0 { Err(ChunksError::InvalidOffsetError(offset, self.chunk_size)) } else { let idx = offset / self.chunk_size as usize; @@ -112,7 +112,7 @@ impl Chunks { &self, offset: usize, ) -> Result { - if !offset.is_multiple_of(self.chunk_size as usize) { + if offset % self.chunk_size as usize != 0 { return Err(ChunksError::InvalidOffsetError( offset, self.chunk_size, diff --git a/test-integration/Cargo.lock b/test-integration/Cargo.lock index fb4cba1ef..eb535057c 100644 --- a/test-integration/Cargo.lock +++ b/test-integration/Cargo.lock @@ -63,20 +63,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "agave-geyser-plugin-interface" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df63ffb691b27f0253e893d083126cbe98a6b1ace29108992310f323f1ac50b0" -dependencies = [ - "log", - "solana-clock", - "solana-signature", - "solana-transaction", - "solana-transaction-status", - "thiserror 2.0.12", -] - [[package]] name = "agave-transaction-view" version = "2.2.1" @@ -3598,7 +3584,6 @@ dependencies = [ name = "magicblock-aperture" version = "0.3.1" dependencies = [ - "agave-geyser-plugin-interface", "arc-swap", "base64 0.21.7", "bincode", @@ -3609,7 +3594,6 @@ dependencies = [ "http-body-util", "hyper 1.6.0", "hyper-util", - "libloading 0.8.8", "log", "magicblock-account-cloner", "magicblock-accounts-db", @@ -3641,7 +3625,6 @@ dependencies = [ "solana-transaction-status", "solana-transaction-status-client-types", "sonic-rs", - "thiserror 1.0.69", "tokio", "tokio-util 0.7.15", ] diff --git a/test-integration/programs/flexi-counter/src/processor.rs b/test-integration/programs/flexi-counter/src/processor.rs index 54220eeed..47ad47cff 100644 --- a/test-integration/programs/flexi-counter/src/processor.rs +++ b/test-integration/programs/flexi-counter/src/processor.rs @@ -489,7 +489,7 @@ fn process_cancel_task( vec![AccountMeta::new(*payer_info.key, true)], ); - invoke(&ix, &[payer_info.clone()])?; + invoke(&ix, std::slice::from_ref(payer_info))?; Ok(()) } diff --git a/test-integration/programs/schedulecommit/src/utils/mod.rs b/test-integration/programs/schedulecommit/src/utils/mod.rs index 7de5b1250..659e37842 100644 --- a/test-integration/programs/schedulecommit/src/utils/mod.rs +++ b/test-integration/programs/schedulecommit/src/utils/mod.rs @@ -86,7 +86,7 @@ pub fn allocate_account_and_assign_owner( size.try_into().unwrap(), ), // 0. `[WRITE, SIGNER]` New account - &[account_info.clone()], + std::slice::from_ref(account_info), &[signer_seeds], )?; @@ -95,7 +95,7 @@ pub fn allocate_account_and_assign_owner( invoke_signed( &system_instruction::assign(account_info.key, owner), // 0. `[WRITE, SIGNER]` Assigned account public key - &[account_info.clone()], + std::slice::from_ref(account_info), &[signer_seeds], )?; diff --git a/test-integration/schedulecommit/client/src/schedule_commit_context.rs b/test-integration/schedulecommit/client/src/schedule_commit_context.rs index de5383e8b..ac30d9aa7 100644 --- a/test-integration/schedulecommit/client/src/schedule_commit_context.rs +++ b/test-integration/schedulecommit/client/src/schedule_commit_context.rs @@ -283,7 +283,7 @@ impl ScheduleCommitTestContext { self.ephem_client().get_latest_blockhash().unwrap() } - pub fn fields(&self) -> ScheduleCommitTestContextFields { + pub fn fields(&self) -> ScheduleCommitTestContextFields<'_> { ScheduleCommitTestContextFields { payer_chain: &self.payer_chain, payer_ephem: &self.payer_ephem, diff --git a/test-integration/schedulecommit/test-scenarios/tests/01_commits.rs b/test-integration/schedulecommit/test-scenarios/tests/01_commits.rs index 8a4015a95..959e5718b 100644 --- a/test-integration/schedulecommit/test-scenarios/tests/01_commits.rs +++ b/test-integration/schedulecommit/test-scenarios/tests/01_commits.rs @@ -244,6 +244,7 @@ fn init_and_delegate_player( (player, player_pda) } +#[allow(clippy::result_large_err)] fn schedule_commit_tx( ctx: &IntegrationTestContext, payer: &Keypair, diff --git a/test-integration/test-committor-service/tests/test_ix_commit_local.rs b/test-integration/test-committor-service/tests/test_ix_commit_local.rs index a4fdc04ea..6aed3a4bd 100644 --- a/test-integration/test-committor-service/tests/test_ix_commit_local.rs +++ b/test-integration/test-committor-service/tests/test_ix_commit_local.rs @@ -708,7 +708,7 @@ fn validate_account( let matches_undelegation = acc.owner().eq(&expected_owner); let matches_all = matches_data && matches_undelegation; - if !matches_all && remaining_tries % 4 == 0 { + if !matches_all && remaining_tries.is_multiple_of(4) { if !matches_data { trace!( "Account ({}) data {} != {} || {} != {}", diff --git a/test-integration/test-runner/src/env_config.rs b/test-integration/test-runner/src/env_config.rs index 7ab9fff54..92b82d69a 100644 --- a/test-integration/test-runner/src/env_config.rs +++ b/test-integration/test-runner/src/env_config.rs @@ -52,14 +52,14 @@ impl TestConfigViaEnvVars { pub fn setup_devnet(&self, test_name: &str) -> bool { self.validators_only .as_ref() - .map_or(true, |setup| setup.devnet()) + .is_none_or(|setup| setup.devnet()) && self.include_test(test_name) } pub fn setup_ephem(&self, test_name: &str) -> bool { self.validators_only .as_ref() - .map_or(true, |setup| setup.ephem()) + .is_none_or(|setup| setup.ephem()) && self.include_test(test_name) } } diff --git a/test-integration/test-tools/src/integration_test_context.rs b/test-integration/test-tools/src/integration_test_context.rs index 48ae3a911..23761b027 100644 --- a/test-integration/test-tools/src/integration_test_context.rs +++ b/test-integration/test-tools/src/integration_test_context.rs @@ -667,6 +667,7 @@ impl IntegrationTestContext { )); } + #[allow(clippy::result_large_err)] pub fn confirm_transaction_chain( &self, sig: &Signature, @@ -683,6 +684,7 @@ impl IntegrationTestContext { ) } + #[allow(clippy::result_large_err)] pub fn confirm_transaction_ephem( &self, sig: &Signature, @@ -699,6 +701,7 @@ impl IntegrationTestContext { ) } + #[allow(clippy::result_large_err)] pub fn send_transaction_ephem( &self, tx: &mut Transaction, @@ -715,6 +718,7 @@ impl IntegrationTestContext { ) } + #[allow(clippy::result_large_err)] pub fn send_transaction_ephem_with_preflight( &self, tx: &mut Transaction, @@ -731,6 +735,7 @@ impl IntegrationTestContext { ) } + #[allow(clippy::result_large_err)] pub fn send_transaction_chain( &self, tx: &mut Transaction, @@ -747,6 +752,7 @@ impl IntegrationTestContext { ) } + #[allow(clippy::result_large_err)] pub fn send_instructions_with_payer_chain( &self, ixs: &[Instruction], @@ -848,6 +854,7 @@ impl IntegrationTestContext { }) } + #[allow(clippy::result_large_err)] pub fn send_transaction( rpc_client: &RpcClient, tx: &mut Transaction, @@ -869,6 +876,7 @@ impl IntegrationTestContext { Ok(sig) } + #[allow(clippy::result_large_err)] pub fn send_instructions_with_payer( rpc_client: &RpcClient, ixs: &[Instruction], @@ -880,6 +888,7 @@ impl IntegrationTestContext { Self::send_transaction(rpc_client, &mut tx, &[payer]) } + #[allow(clippy::result_large_err)] pub fn send_and_confirm_transaction( rpc_client: &RpcClient, tx: &mut Transaction, @@ -891,6 +900,7 @@ impl IntegrationTestContext { .map(|confirmed| (sig, confirmed)) } + #[allow(clippy::result_large_err)] pub fn send_and_confirm_instructions_with_payer( &self, rpc_client: &RpcClient, diff --git a/test-integration/test-tools/src/transactions.rs b/test-integration/test-tools/src/transactions.rs index 44c350254..38779f86e 100644 --- a/test-integration/test-tools/src/transactions.rs +++ b/test-integration/test-tools/src/transactions.rs @@ -16,6 +16,7 @@ use solana_sdk::{ use crate::conversions::stringify_simulation_result; +#[allow(clippy::result_large_err)] pub fn send_and_confirm_instructions_with_payer( rpc_client: &solana_rpc_client::rpc_client::RpcClient, ixs: &[Instruction], @@ -35,6 +36,7 @@ pub fn send_and_confirm_instructions_with_payer( .map(|confirmed| (sig, confirmed)) } +#[allow(clippy::result_large_err)] pub fn send_instructions_with_payer( rpc_client: &RpcClient, ixs: &[Instruction], @@ -47,6 +49,7 @@ pub fn send_instructions_with_payer( Ok((sig, tx)) } +#[allow(clippy::result_large_err)] pub fn send_transaction( rpc_client: &RpcClient, tx: &mut Transaction, @@ -65,6 +68,7 @@ pub fn send_transaction( Ok(sig) } +#[allow(clippy::result_large_err)] pub fn send_and_confirm_transaction( rpc_client: &RpcClient, tx: &mut Transaction, @@ -76,6 +80,7 @@ pub fn send_and_confirm_transaction( .map(|confirmed| (sig, confirmed)) } +#[allow(clippy::result_large_err)] pub fn confirm_transaction( sig: &Signature, rpc_client: &RpcClient, From 18c9fcc629c331733334541c310aa767c790384f Mon Sep 17 00:00:00 2001 From: Babur Makhmudov Date: Wed, 3 Dec 2025 18:31:26 +0400 Subject: [PATCH 4/4] fix: address review comments --- test-integration/Cargo.lock | 80 +++++++++---------- .../test-scenarios/tests/01_commits.rs | 3 +- .../src/integration_test_context.rs | 9 +-- .../test-tools/src/transactions.rs | 7 +- 4 files changed, 46 insertions(+), 53 deletions(-) diff --git a/test-integration/Cargo.lock b/test-integration/Cargo.lock index eb535057c..223f7f9e6 100644 --- a/test-integration/Cargo.lock +++ b/test-integration/Cargo.lock @@ -2304,10 +2304,10 @@ dependencies = [ [[package]] name = "guinea" -version = "0.3.1" +version = "0.4.1" dependencies = [ "bincode", - "magicblock-magic-program-api 0.3.1", + "magicblock-magic-program-api 0.4.1", "serde", "solana-program", ] @@ -3514,7 +3514,7 @@ dependencies = [ [[package]] name = "magicblock-account-cloner" -version = "0.3.1" +version = "0.4.1" dependencies = [ "async-trait", "bincode", @@ -3525,7 +3525,7 @@ dependencies = [ "magicblock-config", "magicblock-core", "magicblock-ledger", - "magicblock-magic-program-api 0.3.1", + "magicblock-magic-program-api 0.4.1", "magicblock-program", "magicblock-rpc-client", "rand 0.8.5", @@ -3537,7 +3537,7 @@ dependencies = [ [[package]] name = "magicblock-accounts" -version = "0.3.1" +version = "0.4.1" dependencies = [ "async-trait", "futures-util", @@ -3550,7 +3550,7 @@ dependencies = [ "magicblock-core", "magicblock-delegation-program", "magicblock-ledger", - "magicblock-magic-program-api 0.3.1", + "magicblock-magic-program-api 0.4.1", "magicblock-metrics", "magicblock-processor", "magicblock-program", @@ -3565,7 +3565,7 @@ dependencies = [ [[package]] name = "magicblock-accounts-db" -version = "0.3.1" +version = "0.4.1" dependencies = [ "lmdb-rkv", "log", @@ -3582,7 +3582,7 @@ dependencies = [ [[package]] name = "magicblock-aperture" -version = "0.3.1" +version = "0.4.1" dependencies = [ "arc-swap", "base64 0.21.7", @@ -3631,7 +3631,7 @@ dependencies = [ [[package]] name = "magicblock-api" -version = "0.3.1" +version = "0.4.1" dependencies = [ "anyhow", "bincode", @@ -3652,7 +3652,7 @@ dependencies = [ "magicblock-core", "magicblock-delegation-program", "magicblock-ledger", - "magicblock-magic-program-api 0.3.1", + "magicblock-magic-program-api 0.4.1", "magicblock-metrics", "magicblock-processor", "magicblock-program", @@ -3665,7 +3665,7 @@ dependencies = [ "solana-rpc", "solana-rpc-client", "solana-sdk", - "solana-svm 2.2.1 (git+https://github.com/magicblock-labs/magicblock-svm.git?rev=86c2cb0f)", + "solana-svm 2.2.1 (git+https://github.com/magicblock-labs/magicblock-svm.git?rev=6f74a99)", "solana-transaction", "tempfile", "thiserror 1.0.69", @@ -3675,7 +3675,7 @@ dependencies = [ [[package]] name = "magicblock-chainlink" -version = "0.3.1" +version = "0.4.1" dependencies = [ "arc-swap", "async-trait", @@ -3687,7 +3687,7 @@ dependencies = [ "magicblock-config", "magicblock-core", "magicblock-delegation-program", - "magicblock-magic-program-api 0.3.1", + "magicblock-magic-program-api 0.4.1", "magicblock-metrics", "serde_json", "solana-account", @@ -3712,7 +3712,7 @@ dependencies = [ [[package]] name = "magicblock-committor-program" -version = "0.3.1" +version = "0.4.1" dependencies = [ "borsh 1.5.7", "borsh-derive 1.5.7", @@ -3726,7 +3726,7 @@ dependencies = [ [[package]] name = "magicblock-committor-service" -version = "0.3.1" +version = "0.4.1" dependencies = [ "async-trait", "base64 0.21.7", @@ -3758,7 +3758,7 @@ dependencies = [ [[package]] name = "magicblock-config" -version = "0.3.1" +version = "0.4.1" dependencies = [ "bs58", "clap 4.5.41", @@ -3777,11 +3777,11 @@ dependencies = [ [[package]] name = "magicblock-core" -version = "0.3.1" +version = "0.4.1" dependencies = [ "bincode", "flume", - "magicblock-magic-program-api 0.3.1", + "magicblock-magic-program-api 0.4.1", "serde", "solana-account", "solana-account-decoder", @@ -3818,7 +3818,7 @@ dependencies = [ [[package]] name = "magicblock-ledger" -version = "0.3.1" +version = "0.4.1" dependencies = [ "arc-swap", "bincode", @@ -3838,8 +3838,8 @@ dependencies = [ "solana-measure", "solana-metrics", "solana-sdk", - "solana-storage-proto 0.3.1", - "solana-svm 2.2.1 (git+https://github.com/magicblock-labs/magicblock-svm.git?rev=86c2cb0f)", + "solana-storage-proto 0.4.1", + "solana-svm 2.2.1 (git+https://github.com/magicblock-labs/magicblock-svm.git?rev=6f74a99)", "solana-timings", "solana-transaction-status", "thiserror 1.0.69", @@ -3860,7 +3860,7 @@ dependencies = [ [[package]] name = "magicblock-magic-program-api" -version = "0.3.1" +version = "0.4.1" dependencies = [ "bincode", "serde", @@ -3869,7 +3869,7 @@ dependencies = [ [[package]] name = "magicblock-metrics" -version = "0.3.1" +version = "0.4.1" dependencies = [ "http-body-util", "hyper 1.6.0", @@ -3883,7 +3883,7 @@ dependencies = [ [[package]] name = "magicblock-processor" -version = "0.3.1" +version = "0.4.1" dependencies = [ "bincode", "log", @@ -3906,7 +3906,7 @@ dependencies = [ "solana-pubkey", "solana-rent-collector", "solana-sdk-ids", - "solana-svm 2.2.1 (git+https://github.com/magicblock-labs/magicblock-svm.git?rev=86c2cb0f)", + "solana-svm 2.2.1 (git+https://github.com/magicblock-labs/magicblock-svm.git?rev=6f74a99)", "solana-svm-transaction", "solana-system-program", "solana-transaction", @@ -3917,12 +3917,12 @@ dependencies = [ [[package]] name = "magicblock-program" -version = "0.3.1" +version = "0.4.1" dependencies = [ "bincode", "lazy_static", "magicblock-core", - "magicblock-magic-program-api 0.3.1", + "magicblock-magic-program-api 0.4.1", "magicblock-metrics", "num-derive", "num-traits", @@ -3935,7 +3935,7 @@ dependencies = [ [[package]] name = "magicblock-rpc-client" -version = "0.3.1" +version = "0.4.1" dependencies = [ "log", "solana-rpc-client", @@ -3949,7 +3949,7 @@ dependencies = [ [[package]] name = "magicblock-table-mania" -version = "0.3.1" +version = "0.4.1" dependencies = [ "ed25519-dalek", "log", @@ -3967,7 +3967,7 @@ dependencies = [ [[package]] name = "magicblock-task-scheduler" -version = "0.3.1" +version = "0.4.1" dependencies = [ "bincode", "chrono", @@ -3983,7 +3983,7 @@ dependencies = [ "solana-program", "solana-pubsub-client", "solana-sdk", - "solana-svm 2.2.1 (git+https://github.com/magicblock-labs/magicblock-svm.git?rev=86c2cb0f)", + "solana-svm 2.2.1 (git+https://github.com/magicblock-labs/magicblock-svm.git?rev=6f74a99)", "solana-timings", "thiserror 1.0.69", "tokio", @@ -3992,7 +3992,7 @@ dependencies = [ [[package]] name = "magicblock-validator-admin" -version = "0.3.1" +version = "0.4.1" dependencies = [ "anyhow", "log", @@ -4009,7 +4009,7 @@ dependencies = [ [[package]] name = "magicblock-version" -version = "0.3.1" +version = "0.4.1" dependencies = [ "git-version", "rustc_version", @@ -4934,7 +4934,7 @@ dependencies = [ "bincode", "borsh 1.5.7", "ephemeral-rollups-sdk", - "magicblock-magic-program-api 0.3.1", + "magicblock-magic-program-api 0.4.1", "serde", "solana-program", ] @@ -4958,7 +4958,7 @@ dependencies = [ "borsh 1.5.7", "ephemeral-rollups-sdk", "magicblock-delegation-program", - "magicblock-magic-program-api 0.3.1", + "magicblock-magic-program-api 0.4.1", "solana-program", ] @@ -5915,7 +5915,7 @@ dependencies = [ "integration-test-tools", "log", "magicblock-core", - "magicblock-magic-program-api 0.3.1", + "magicblock-magic-program-api 0.4.1", "program-schedulecommit", "schedulecommit-client", "solana-program", @@ -5931,7 +5931,7 @@ version = "0.0.0" dependencies = [ "integration-test-tools", "magicblock-core", - "magicblock-magic-program-api 0.3.1", + "magicblock-magic-program-api 0.4.1", "program-schedulecommit", "program-schedulecommit-security", "schedulecommit-client", @@ -9105,7 +9105,7 @@ dependencies = [ [[package]] name = "solana-storage-proto" -version = "0.3.1" +version = "0.4.1" dependencies = [ "bincode", "bs58", @@ -9238,7 +9238,7 @@ dependencies = [ [[package]] name = "solana-svm" version = "2.2.1" -source = "git+https://github.com/magicblock-labs/magicblock-svm.git?rev=86c2cb0f#86c2cb0f2d92c6e92757e951a8f27757fef3aaea" +source = "git+https://github.com/magicblock-labs/magicblock-svm.git?rev=6f74a99#6f74a994c6797c979b1afdf52f91675182a1bf8a" dependencies = [ "ahash 0.8.12", "log", @@ -10607,7 +10607,7 @@ dependencies = [ [[package]] name = "test-kit" -version = "0.3.1" +version = "0.4.1" dependencies = [ "env_logger 0.11.8", "guinea", diff --git a/test-integration/schedulecommit/test-scenarios/tests/01_commits.rs b/test-integration/schedulecommit/test-scenarios/tests/01_commits.rs index 959e5718b..8f07d51a7 100644 --- a/test-integration/schedulecommit/test-scenarios/tests/01_commits.rs +++ b/test-integration/schedulecommit/test-scenarios/tests/01_commits.rs @@ -1,3 +1,5 @@ +#![allow(clippy::result_large_err)] + use integration_test_tools::{run_test, IntegrationTestContext}; use log::*; use program_schedulecommit::{ @@ -244,7 +246,6 @@ fn init_and_delegate_player( (player, player_pda) } -#[allow(clippy::result_large_err)] fn schedule_commit_tx( ctx: &IntegrationTestContext, payer: &Keypair, diff --git a/test-integration/test-tools/src/integration_test_context.rs b/test-integration/test-tools/src/integration_test_context.rs index 23761b027..fcfc346e5 100644 --- a/test-integration/test-tools/src/integration_test_context.rs +++ b/test-integration/test-tools/src/integration_test_context.rs @@ -1,3 +1,5 @@ +#![allow(clippy::result_large_err)] + use std::{str::FromStr, thread::sleep, time::Duration}; use anyhow::{Context, Result}; @@ -718,7 +720,6 @@ impl IntegrationTestContext { ) } - #[allow(clippy::result_large_err)] pub fn send_transaction_ephem_with_preflight( &self, tx: &mut Transaction, @@ -735,7 +736,6 @@ impl IntegrationTestContext { ) } - #[allow(clippy::result_large_err)] pub fn send_transaction_chain( &self, tx: &mut Transaction, @@ -752,7 +752,6 @@ impl IntegrationTestContext { ) } - #[allow(clippy::result_large_err)] pub fn send_instructions_with_payer_chain( &self, ixs: &[Instruction], @@ -854,7 +853,6 @@ impl IntegrationTestContext { }) } - #[allow(clippy::result_large_err)] pub fn send_transaction( rpc_client: &RpcClient, tx: &mut Transaction, @@ -876,7 +874,6 @@ impl IntegrationTestContext { Ok(sig) } - #[allow(clippy::result_large_err)] pub fn send_instructions_with_payer( rpc_client: &RpcClient, ixs: &[Instruction], @@ -888,7 +885,6 @@ impl IntegrationTestContext { Self::send_transaction(rpc_client, &mut tx, &[payer]) } - #[allow(clippy::result_large_err)] pub fn send_and_confirm_transaction( rpc_client: &RpcClient, tx: &mut Transaction, @@ -900,7 +896,6 @@ impl IntegrationTestContext { .map(|confirmed| (sig, confirmed)) } - #[allow(clippy::result_large_err)] pub fn send_and_confirm_instructions_with_payer( &self, rpc_client: &RpcClient, diff --git a/test-integration/test-tools/src/transactions.rs b/test-integration/test-tools/src/transactions.rs index 38779f86e..b7cd1da1d 100644 --- a/test-integration/test-tools/src/transactions.rs +++ b/test-integration/test-tools/src/transactions.rs @@ -1,3 +1,5 @@ +#![allow(clippy::result_large_err)] + use std::{thread::sleep, time::Duration}; use log::*; @@ -16,7 +18,6 @@ use solana_sdk::{ use crate::conversions::stringify_simulation_result; -#[allow(clippy::result_large_err)] pub fn send_and_confirm_instructions_with_payer( rpc_client: &solana_rpc_client::rpc_client::RpcClient, ixs: &[Instruction], @@ -36,7 +37,6 @@ pub fn send_and_confirm_instructions_with_payer( .map(|confirmed| (sig, confirmed)) } -#[allow(clippy::result_large_err)] pub fn send_instructions_with_payer( rpc_client: &RpcClient, ixs: &[Instruction], @@ -49,7 +49,6 @@ pub fn send_instructions_with_payer( Ok((sig, tx)) } -#[allow(clippy::result_large_err)] pub fn send_transaction( rpc_client: &RpcClient, tx: &mut Transaction, @@ -68,7 +67,6 @@ pub fn send_transaction( Ok(sig) } -#[allow(clippy::result_large_err)] pub fn send_and_confirm_transaction( rpc_client: &RpcClient, tx: &mut Transaction, @@ -80,7 +78,6 @@ pub fn send_and_confirm_transaction( .map(|confirmed| (sig, confirmed)) } -#[allow(clippy::result_large_err)] pub fn confirm_transaction( sig: &Signature, rpc_client: &RpcClient,