diff --git a/Cargo.toml b/Cargo.toml index 4ea5e85956..5829d99221 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ members = [ resolver = "2" [workspace.package] -rust-version = "1.85" +rust-version = "1.87" license = "MPL-2.0" edition = "2024" diff --git a/consensus/CHANGELOG.md b/consensus/CHANGELOG.md index 6947c5e344..f4788a0c11 100644 --- a/consensus/CHANGELOG.md +++ b/consensus/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Update to edition 2024 -- Update MSRV to 1.85 +- Update MSRV to 1.87 ### Fixed diff --git a/consensus/src/execution_ctx.rs b/consensus/src/execution_ctx.rs index 13c9420f55..877b6ab20b 100644 --- a/consensus/src/execution_ctx.rs +++ b/consensus/src/execution_ctx.rs @@ -424,25 +424,25 @@ impl<'a, T: Operations + 'static, DB: Database> ExecutionCtx<'a, T, DB> { ) { let step = StepName::Ratification.to_step(msg_iteration); - if let Some(committee) = self.iter_ctx.committees.get_committee(step) { - if self.am_member(committee) { - debug!( - event = "Cast past vote", - step = "Ratification", - mode = "emergency", - round = self.round_update.round, - iter = msg_iteration - ); + if let Some(committee) = self.iter_ctx.committees.get_committee(step) + && self.am_member(committee) + { + debug!( + event = "Cast past vote", + step = "Ratification", + mode = "emergency", + round = self.round_update.round, + iter = msg_iteration + ); - // Should we collect our own vote? - let _msg = RatificationStep::try_vote( - &self.round_update, - msg_iteration, - validation, - self.outbound.clone(), - ) - .await; - } + // Should we collect our own vote? + let _msg = RatificationStep::try_vote( + &self.round_update, + msg_iteration, + validation, + self.outbound.clone(), + ) + .await; } } @@ -587,17 +587,15 @@ impl<'a, T: Operations + 'static, DB: Database> ExecutionCtx<'a, T, DB> { // same round/step. Err(ConsensusError::FutureEvent) => { const SRC: &str = "inbound future message"; - if !same_prev_hash { - if let Some(signer) = msg.get_signer() { - if !self - .provisioners - .eligibles(msg.header.round) - .any(|(p, _)| p == &signer) - { - log_msg("discarded msg (not eligible)", SRC, &msg); - return None; - } - } + if !same_prev_hash + && let Some(signer) = msg.get_signer() + && !self + .provisioners + .eligibles(msg.header.round) + .any(|(p, _)| p == &signer) + { + log_msg("discarded msg (not eligible)", SRC, &msg); + return None; } // We verify message signatures only for the next 10 round diff --git a/consensus/src/validation/handler.rs b/consensus/src/validation/handler.rs index bd837a43a1..f3cd746c86 100644 --- a/consensus/src/validation/handler.rs +++ b/consensus/src/validation/handler.rs @@ -228,31 +228,31 @@ impl MsgHandler for ValidationHandler { committee: &Committee, generator: Option, ) -> Result { - if is_emergency_iter(msg.header.iteration) { - if let Payload::ValidationQuorum(vq) = msg.payload { - if !vq.result.vote().is_valid() { - return Err(ConsensusError::InvalidMsgType); - }; - - let vr = vq.result; - - // Store ValidationResult - debug!( - event = "Store ValidationResult", - info = ?vq.header, - src = "ValidationQuorum" - ); + if is_emergency_iter(msg.header.iteration) + && let Payload::ValidationQuorum(vq) = msg.payload + { + if !vq.result.vote().is_valid() { + return Err(ConsensusError::InvalidMsgType); + }; - self.db - .lock() - .await - .store_validation_result(&vq.header, &vr) - .await; + let vr = vq.result; - // Extract the ValidationResult and return it as msg - let vr_msg = vr.into(); - return Ok(StepOutcome::Ready(vr_msg)); - } + // Store ValidationResult + debug!( + event = "Store ValidationResult", + info = ?vq.header, + src = "ValidationQuorum" + ); + + self.db + .lock() + .await + .store_validation_result(&vq.header, &vr) + .await; + + // Extract the ValidationResult and return it as msg + let vr_msg = vr.into(); + return Ok(StepOutcome::Ready(vr_msg)); } let p = Self::unwrap_msg(msg)?; diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 49b4233700..b397a40200 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update to edition 2024 - Replace nightly `cfg_eval`/`serde_as` with stable `serde(with)` attributes - Remove nightly `#![feature(cfg_eval)]` and `#![feature(const_fn_floating_point_arithmetic)]` -- Update MSRV to 1.85 +- Update MSRV to 1.87 ### Added diff --git a/core/src/transfer.rs b/core/src/transfer.rs index 6c378a5453..c32f66c9e6 100644 --- a/core/src/transfer.rs +++ b/core/src/transfer.rs @@ -507,10 +507,10 @@ impl Transaction { } let min_charge = self.blob_charge(gas_per_blob); - if let Some(min_charge) = min_charge { - if self.gas_limit() < min_charge { - return Err(TxPreconditionError::BlobLowLimit(min_charge)); - } + if let Some(min_charge) = min_charge + && self.gas_limit() < min_charge + { + return Err(TxPreconditionError::BlobLowLimit(min_charge)); } Ok(min_charge) } diff --git a/core/src/transfer/moonlight.rs b/core/src/transfer/moonlight.rs index e7e1999e77..7cd8c11067 100644 --- a/core/src/transfer/moonlight.rs +++ b/core/src/transfer/moonlight.rs @@ -137,10 +137,10 @@ impl Transaction { sender_sk: &AccountSecretKey, payload: Payload, ) -> Result { - if let Some(TransactionData::Memo(memo)) = payload.data.as_ref() { - if memo.len() > MAX_MEMO_SIZE { - return Err(Error::MemoTooLarge(memo.len())); - } + if let Some(TransactionData::Memo(memo)) = payload.data.as_ref() + && memo.len() > MAX_MEMO_SIZE + { + return Err(Error::MemoTooLarge(memo.len())); } let digest = payload.signature_message(); diff --git a/core/src/transfer/phoenix.rs b/core/src/transfer/phoenix.rs index 4e772ce960..b166e0b00f 100644 --- a/core/src/transfer/phoenix.rs +++ b/core/src/transfer/phoenix.rs @@ -127,10 +127,10 @@ impl Transaction { ) -> Result { let data = data.map(Into::into); - if let Some(TransactionData::Memo(memo)) = data.as_ref() { - if memo.len() > MAX_MEMO_SIZE { - return Err(Error::MemoTooLarge(memo.len())); - } + if let Some(TransactionData::Memo(memo)) = data.as_ref() + && memo.len() > MAX_MEMO_SIZE + { + return Err(Error::MemoTooLarge(memo.len())); } let sender_pk = PublicKey::from(sender_sk); diff --git a/data-drivers/data-driver/CHANGELOG.md b/data-drivers/data-driver/CHANGELOG.md index f3d59c8dd4..0d5e0568fd 100644 --- a/data-drivers/data-driver/CHANGELOG.md +++ b/data-drivers/data-driver/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Update to edition 2024 +- Update MSRV to 1.87 ## [0.3.1] - 2026-02-11 diff --git a/node-data/CHANGELOG.md b/node-data/CHANGELOG.md index 848935e52a..0063721b0e 100644 --- a/node-data/CHANGELOG.md +++ b/node-data/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update to edition 2024 - Replace `serde_as` with stable `serde(with)` attributes -- Update MSRV to 1.85 +- Update MSRV to 1.87 ## [1.4.0] - 2025-11-06 diff --git a/node/CHANGELOG.md b/node/CHANGELOG.md index 8a6c394983..5ace4be726 100644 --- a/node/CHANGELOG.md +++ b/node/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update to edition 2024 - Replace `serde_as` with stable `serde(with)` attributes - Remove unused lifetime in `fetch_unfinalized_events_by_hash` -- Update MSRV to 1.85 +- Update MSRV to 1.87 ## [1.4.2] - 2025-12-13 diff --git a/node/src/archive/transformer.rs b/node/src/archive/transformer.rs index e49323f29c..9d26d711ac 100644 --- a/node/src/archive/transformer.rs +++ b/node/src/archive/transformer.rs @@ -239,12 +239,12 @@ fn record_flows( handle_inflow(moonlight_event.sender); } - if let Some((key, amt)) = refund { - if amt > 0 { - // We rely on the fact, that refund only - // exists if different from sender - handle_inflow(key); - } + if let Some((key, amt)) = refund + && amt > 0 + { + // We rely on the fact, that refund only + // exists if different from sender + handle_inflow(key); } } (Some(receiver), None) => { diff --git a/node/src/chain.rs b/node/src/chain.rs index a2ea0bc368..842b5d7909 100644 --- a/node/src/chain.rs +++ b/node/src/chain.rs @@ -187,18 +187,18 @@ impl // from a peer only after explicit request (on demand). match fsm.on_block_event(*blk, msg.metadata.clone()).await { Ok(res) => { - if let Some(accepted_blk) = res { + if let Some(accepted_blk) = res + && is_emergency_block(accepted_blk.header().iteration) + { // Repropagate Emergency Blocks // We already know it's valid because we accepted it - if is_emergency_block(accepted_blk.header().iteration){ - // We build a new `msg` to avoid cloning `blk` when - // passing it to `on_block_event`. - // We copy the metadata to keep the original ray_id. - let mut eb_msg = Message::from(accepted_blk); - eb_msg.metadata = msg.metadata; - if let Err(e) = network.read().await.broadcast(&eb_msg).await { - warn!("Unable to re-broadcast Emergency Block: {e}"); - } + // We build a new `msg` to avoid cloning `blk` when + // passing it to `on_block_event`. + // We copy the metadata to keep the original ray_id. + let mut eb_msg = Message::from(accepted_blk); + eb_msg.metadata = msg.metadata; + if let Err(e) = network.read().await.broadcast(&eb_msg).await { + warn!("Unable to re-broadcast Emergency Block: {e}"); } } } @@ -221,10 +221,10 @@ impl // Handle quorum messages from Consensus layer. // If the associated candidate block already exists, // the winner block will be compiled and redirected to the Acceptor. - if let Payload::Quorum(quorum) = &msg.payload { - if let RatificationResult::Success(_) = quorum.att.result { - fsm.on_success_quorum(quorum, msg.metadata.clone()).await; - } + if let Payload::Quorum(quorum) = &msg.payload + && let RatificationResult::Success(_) = quorum.att.result + { + fsm.on_success_quorum(quorum, msg.metadata.clone()).await; } if let Payload::GetResource(res) = &msg.payload { diff --git a/node/src/chain/consensus.rs b/node/src/chain/consensus.rs index f12e19f93e..201518a43e 100644 --- a/node/src/chain/consensus.rs +++ b/node/src/chain/consensus.rs @@ -173,10 +173,10 @@ impl Task { } pub(crate) fn abort(&mut self) { - if let Some((_, cancel_chan)) = self.running_task.take() { - if cancel_chan.send(0).is_err() { - warn!("Unable to send cancel for abort") - }; + if let Some((_, cancel_chan)) = self.running_task.take() + && cancel_chan.send(0).is_err() + { + warn!("Unable to send cancel for abort"); } } diff --git a/node/src/chain/fsm.rs b/node/src/chain/fsm.rs index f8a1339dc2..e2543003dc 100644 --- a/node/src/chain/fsm.rs +++ b/node/src/chain/fsm.rs @@ -195,11 +195,10 @@ impl SimpleFSM { // unless it's an Emergency Blocks, which have no Attestation if !Self::is_block_attested(&blk) && !is_emergency_block(blk.header().iteration) + && let Err(err) = self.attach_blk_att(&mut blk) { - if let Err(err) = self.attach_blk_att(&mut blk) { - warn!(event = "block discarded", ?err); - return Ok(None); - } + warn!(event = "block discarded", ?err); + return Ok(None); } let fsm_res = match &mut self.curr { @@ -364,12 +363,11 @@ impl SimpleFSM { // Check if we already accepted this block if let Ok(blk_exists) = db.read().await.view(|t| t.block_exists(&candidate)) + && blk_exists { - if blk_exists { - warn!("skipping Quorum for known block"); - return; - } - }; + warn!("skipping Quorum for known block"); + return; + } let quorum_blk = if quorum_height > tip_height + 1 { // Quorum from future diff --git a/node/src/chain/fsm/insync.rs b/node/src/chain/fsm/insync.rs index b0b09a8276..f293e1edc2 100644 --- a/node/src/chain/fsm/insync.rs +++ b/node/src/chain/fsm/insync.rs @@ -340,11 +340,11 @@ impl InSyncImpl { } pub async fn on_heartbeat(&mut self) -> anyhow::Result { - if let Some(pre_sync) = &mut self.presync { - if pre_sync.expiry <= Instant::now() { - // Reset presync if it timed out - self.presync = None; - } + if let Some(pre_sync) = &mut self.presync + && pre_sync.expiry <= Instant::now() + { + // Reset presync if it timed out + self.presync = None; } Ok(false) diff --git a/node/src/chain/fsm/outofsync.rs b/node/src/chain/fsm/outofsync.rs index e4fd6d3e54..31b3cefe8a 100644 --- a/node/src/chain/fsm/outofsync.rs +++ b/node/src/chain/fsm/outofsync.rs @@ -344,27 +344,26 @@ impl } // If we almost dequeued all requested blocks (2/3) - if self.last_request < current_height + (MAX_BLOCKS_TO_REQUEST / 3) { - if let Some(last_request) = self.request_pool_missing_blocks().await - { - self.last_request = last_request - } + if self.last_request < current_height + (MAX_BLOCKS_TO_REQUEST / 3) + && let Some(last_request) = self.request_pool_missing_blocks().await + { + self.last_request = last_request; } // if the pool is full, check if the new block has higher priority - if pool_len >= MAX_POOL_BLOCKS_SIZE { - if let Some(entry) = self.pool.last_entry() { - let stored_height = *entry.key(); - if stored_height > block_height { - debug!( - event = "block removed", - block_height, stored_height, pool_len, - ); - entry.remove(); - } else { - debug!(event = "block skipped", block_height, pool_len); - return Ok(false); - } + if pool_len >= MAX_POOL_BLOCKS_SIZE + && let Some(entry) = self.pool.last_entry() + { + let stored_height = *entry.key(); + if stored_height > block_height { + debug!( + event = "block removed", + block_height, stored_height, pool_len, + ); + entry.remove(); + } else { + debug!(event = "block skipped", block_height, pool_len); + return Ok(false); } } diff --git a/node/src/chain/fsm/stalled.rs b/node/src/chain/fsm/stalled.rs index febd388b6f..97b82d7ee0 100644 --- a/node/src/chain/fsm/stalled.rs +++ b/node/src/chain/fsm/stalled.rs @@ -209,17 +209,16 @@ impl StalledChainFSM { } async fn on_heartbeat_in_stalled(&mut self) { - if let State::Stalled(timestamp) = self.state { - if timestamp + STALLED_TIMEOUT < node_data::get_current_timestamp() - { - let _ = self.request_missing_blocks().await.map_err(|e| { - error!("Error in request_missing_blocks: {:?}", e); - }); - - self.state_transition(State::Stalled( - node_data::get_current_timestamp(), - )); - } + if let State::Stalled(timestamp) = self.state + && timestamp + STALLED_TIMEOUT < node_data::get_current_timestamp() + { + let _ = self.request_missing_blocks().await.map_err(|e| { + error!("Error in request_missing_blocks: {:?}", e); + }); + + self.state_transition(State::Stalled( + node_data::get_current_timestamp(), + )); } } diff --git a/node/src/databroker.rs b/node/src/databroker.rs index fc198b857e..1b32b268f6 100644 --- a/node/src/databroker.rs +++ b/node/src/databroker.rs @@ -357,45 +357,45 @@ impl DataBrokerSrv { debug!(event = "handle_inv", ?i); match i.inv_type { InvType::BlockFromHeight => { - if let InvParam::Height(height) = &i.param { - if db.block_by_height(*height)?.is_none() { - inv.add_block_from_height(*height); - } + if let InvParam::Height(height) = &i.param + && db.block_by_height(*height)?.is_none() + { + inv.add_block_from_height(*height); } } InvType::BlockFromHash => { - if let InvParam::Hash(hash) = &i.param { - if db.block(hash)?.is_none() { - inv.add_block_from_hash(*hash); - } + if let InvParam::Hash(hash) = &i.param + && db.block(hash)?.is_none() + { + inv.add_block_from_hash(*hash); } } InvType::CandidateFromHash => { - if let InvParam::Hash(hash) = &i.param { - if db.candidate(hash)?.is_none() { - inv.add_candidate_from_hash(*hash); - } + if let InvParam::Hash(hash) = &i.param + && db.candidate(hash)?.is_none() + { + inv.add_candidate_from_hash(*hash); } } InvType::MempoolTx => { - if let InvParam::Hash(tx_id) = &i.param { - if db.mempool_tx(*tx_id)?.is_none() { - inv.add_tx_id(*tx_id); - } + if let InvParam::Hash(tx_id) = &i.param + && db.mempool_tx(*tx_id)?.is_none() + { + inv.add_tx_id(*tx_id); } } InvType::CandidateFromIteration => { - if let InvParam::Iteration(ch) = &i.param { - if db.candidate_by_iteration(ch)?.is_none() { - inv.add_candidate_from_iteration(*ch); - } + if let InvParam::Iteration(ch) = &i.param + && db.candidate_by_iteration(ch)?.is_none() + { + inv.add_candidate_from_iteration(*ch); } } InvType::ValidationResult => { - if let InvParam::Iteration(ch) = &i.param { - if db.validation_result(ch)?.is_none() { - inv.add_validation_result(*ch); - } + if let InvParam::Iteration(ch) = &i.param + && db.validation_result(ch)?.is_none() + { + inv.add_validation_result(*ch); } } } diff --git a/node/src/mempool.rs b/node/src/mempool.rs index 599bc2aa3b..46830104c8 100644 --- a/node/src/mempool.rs +++ b/node/src/mempool.rs @@ -312,16 +312,14 @@ impl MempoolSrv { }? } - if disable_3rd_party { - if let Some(call) = tx.inner.call() { - if call.contract != TRANSFER_CONTRACT - && call.contract != STAKE_CONTRACT - { - Err(TxAcceptanceError::Generic(anyhow::anyhow!( - "3rd party contracts are not enabled in the VM" - )))?; - } - } + if disable_3rd_party + && let Some(call) = tx.inner.call() + && call.contract != TRANSFER_CONTRACT + && call.contract != STAKE_CONTRACT + { + Err(TxAcceptanceError::Generic(anyhow::anyhow!( + "3rd party contracts are not enabled in the VM" + )))?; } // Check deployment tx @@ -453,11 +451,9 @@ impl MempoolSrv { events.push(TransactionEvent::Included(tx)); - if !replaced { - if let Some(to_delete) = tx_to_delete { - for deleted in db.delete_mempool_tx(to_delete, true)? { - events.push(TransactionEvent::Removed(deleted)); - } + if !replaced && let Some(to_delete) = tx_to_delete { + for deleted in db.delete_mempool_tx(to_delete, true)? { + events.push(TransactionEvent::Removed(deleted)); } } // Persist transaction in mempool storage diff --git a/rusk-profile/CHANGELOG.md b/rusk-profile/CHANGELOG.md index 1161d5d4a4..20b81ca110 100644 --- a/rusk-profile/CHANGELOG.md +++ b/rusk-profile/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update MSRV to 1.87 + ## [1.4.0] - 2025-11-06 ### Added diff --git a/rusk-profile/src/circuit.rs b/rusk-profile/src/circuit.rs index 48d8d173d5..0100591007 100644 --- a/rusk-profile/src/circuit.rs +++ b/rusk-profile/src/circuit.rs @@ -73,13 +73,13 @@ impl Circuit { metadata: Metadata::from_stored(&id)?, }; - if let Some(result) = circuit.check_id() { - if !result { - return Err(io::Error::new( - ErrorKind::InvalidData, - "The stored circuit id is incorrect", - )); - } + if let Some(result) = circuit.check_id() + && !result + { + return Err(io::Error::new( + ErrorKind::InvalidData, + "The stored circuit id is incorrect", + )); } Ok(circuit) diff --git a/rusk-prover/CHANGELOG.md b/rusk-prover/CHANGELOG.md index 40a97ee48f..2cdcfe9bad 100644 --- a/rusk-prover/CHANGELOG.md +++ b/rusk-prover/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update MSRV to 1.87 + ## [1.3.0] - 2025-04-17 ### Changed diff --git a/rusk-recovery/CHANGELOG.md b/rusk-recovery/CHANGELOG.md index 278f8a957a..e9eec6f873 100644 --- a/rusk-recovery/CHANGELOG.md +++ b/rusk-recovery/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update to edition 2024 - Update `cargo_toml` dependency to 0.22 -- Update MSRV to 1.85 +- Update MSRV to 1.87 ### Fixed diff --git a/rusk-recovery/src/state/http.rs b/rusk-recovery/src/state/http.rs index 79a439ee9d..dcc0211c7c 100644 --- a/rusk-recovery/src/state/http.rs +++ b/rusk-recovery/src/state/http.rs @@ -31,10 +31,11 @@ where if sc.is_success() { return Ok(buffer); } - if sc.is_redirect() && redirect_left > 1 { - if let Some(uri) = response.headers().get("location") { - return download_with_redirect(uri, redirect_left - 1); - } + if sc.is_redirect() + && redirect_left > 1 + && let Some(uri) = response.headers().get("location") + { + return download_with_redirect(uri, redirect_left - 1); } Err(format!("State download error: {response:?}").into()) diff --git a/rusk-test/CHANGELOG.md b/rusk-test/CHANGELOG.md index be423bb57e..e8150ab07b 100644 --- a/rusk-test/CHANGELOG.md +++ b/rusk-test/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update MSRV to 1.87 + ## [1.4.4-rc.0] - 2026-02-11 ### Added diff --git a/rusk-wallet/CHANGELOG.md b/rusk-wallet/CHANGELOG.md index 6e29d2417a..f71b7f3375 100644 --- a/rusk-wallet/CHANGELOG.md +++ b/rusk-wallet/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update to edition 2024 - Replace `serde_as` with stable `serde(with)` attributes -- Update MSRV to 1.85 +- Update MSRV to 1.87 ### Added diff --git a/rusk-wallet/src/bin/command/history.rs b/rusk-wallet/src/bin/command/history.rs index eb2cb88561..fcd0967dab 100644 --- a/rusk-wallet/src/bin/command/history.rs +++ b/rusk-wallet/src/bin/command/history.rs @@ -201,17 +201,16 @@ pub(crate) async fn transaction_from_notes( let note_creator = moonlight_history.json .iter() .find_map(|history_info| history_info.events.iter().find_map(|event| { - if let BlockData::ConvertEvent(ref event) = event.data { - if let WithdrawReceiver::Phoenix(receiver_address) = event.receiver { - if decoded_note.note.stealth_address() == &receiver_address { - // The note is the output of a moonlight - // to phoenix conversion. - let tx = txs.iter().find(|block_tx| { - block_tx.id == history_info.origin - }).expect("The transaction should be in this list since it's the list of all transactions at its block height."); - return Some(tx); - } - } + if let BlockData::ConvertEvent(ref event) = event.data + && let WithdrawReceiver::Phoenix(receiver_address) = event.receiver + && decoded_note.note.stealth_address() == &receiver_address + { + // The note is the output of a moonlight + // to phoenix conversion. + let tx = txs.iter().find(|block_tx| { + block_tx.id == history_info.origin + }).expect("The transaction should be in this list since it's the list of all transactions at its block height."); + return Some(tx); } None })) diff --git a/rusk-wallet/src/bin/io/status.rs b/rusk-wallet/src/bin/io/status.rs index c7742a78b7..b091592faa 100644 --- a/rusk-wallet/src/bin/io/status.rs +++ b/rusk-wallet/src/bin/io/status.rs @@ -62,7 +62,7 @@ impl InteractiveStatus { // flush_buffer_to_stdout let printed_len = line.len() + 2; let (mut num_lines, a_partially_filled_line) = - (printed_len / width, printed_len % width != 0); + (printed_len / width, !printed_len.is_multiple_of(width)); if a_partially_filled_line { num_lines += 1; } diff --git a/rusk-wallet/src/wallet/transaction.rs b/rusk-wallet/src/wallet/transaction.rs index 3facb83841..962c327821 100644 --- a/rusk-wallet/src/wallet/transaction.rs +++ b/rusk-wallet/src/wallet/transaction.rs @@ -287,10 +287,10 @@ impl Wallet { let stake_pk = self.public_key(profile_idx)?; let stake_owner_idx = match self.find_stake_owner_idx(stake_pk).await { Ok(state_idx) => { - if let Some(owner_idx) = owner_idx { - if state_idx != owner_idx { - return Err(Error::Unauthorized); - } + if let Some(owner_idx) = owner_idx + && state_idx != owner_idx + { + return Err(Error::Unauthorized); } state_idx } @@ -368,10 +368,10 @@ impl Wallet { let stake_owner_idx = match self.find_stake_owner_idx(stake_pk).await { Ok(state_idx) => { - if let Some(owner_idx) = owner_idx { - if state_idx != owner_idx { - return Err(Error::Unauthorized); - } + if let Some(owner_idx) = owner_idx + && state_idx != owner_idx + { + return Err(Error::Unauthorized); } state_idx } diff --git a/rusk/CHANGELOG.md b/rusk/CHANGELOG.md index c49d97238b..950c7ec5ad 100644 --- a/rusk/CHANGELOG.md +++ b/rusk/CHANGELOG.md @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Replace `serde_as` with stable `serde(with)` attributes - Gate driver module behind `chain` feature - Replace `anyhow` with typed `HttpError` in HTTP handlers for correct status codes [#2944] -- Update MSRV to 1.85 +- Update MSRV to 1.87 ### Added diff --git a/rusk/src/lib/http/chain.rs b/rusk/src/lib/http/chain.rs index 8c61ca648d..b073c8b8bf 100644 --- a/rusk/src/lib/http/chain.rs +++ b/rusk/src/lib/http/chain.rs @@ -284,7 +284,7 @@ impl RuskNode { let median_gas_price = { let mid = gas_prices.len() / 2; - if gas_prices.len() % 2 == 0 { + if gas_prices.len().is_multiple_of(2) { (gas_prices[mid - 1] + gas_prices[mid]) / 2 } else { gas_prices[mid] diff --git a/rusk/src/lib/node/events.rs b/rusk/src/lib/node/events.rs index a70028cf1d..e18690d0b1 100644 --- a/rusk/src/lib/node/events.rs +++ b/rusk/src/lib/node/events.rs @@ -32,10 +32,10 @@ impl _: Arc>, ) -> anyhow::Result { loop { - if let Some(msg) = self.node_receiver.recv().await { - if let Err(e) = self.rues_sender.send(msg.clone().into()) { - error!("Cannot send to rues {e:?}"); - } + if let Some(msg) = self.node_receiver.recv().await + && let Err(e) = self.rues_sender.send(msg.clone().into()) + { + error!("Cannot send to rues {e:?}"); } } } diff --git a/rusk/src/lib/node/rusk.rs b/rusk/src/lib/node/rusk.rs index fffa6928b4..147d49e557 100644 --- a/rusk/src/lib/node/rusk.rs +++ b/rusk/src/lib/node/rusk.rs @@ -166,15 +166,15 @@ impl Rusk { while let Some(unspent_tx) = unblocked_txs.pop_front().or_else(|| mempool_txs.next()) { - if let Some(timeout) = self.vm_config.generation_timeout { - if started.elapsed() > timeout { - info!( - event = "Stop creating state transition", - reason = "timeout expired", - ?timeout - ); - break; - } + if let Some(timeout) = self.vm_config.generation_timeout + && started.elapsed() > timeout + { + info!( + event = "Stop creating state transition", + reason = "timeout expired", + ?timeout + ); + break; } // Limit execution to the block transactions limit diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 8989c7ac10..39fc568224 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "stable" +channel = "1.93" components = ["rust-src", "rustfmt", "cargo", "clippy"] targets = ["wasm32-unknown-unknown"] diff --git a/vm/CHANGELOG.md b/vm/CHANGELOG.md index 5511bb5360..96af1b5c51 100644 --- a/vm/CHANGELOG.md +++ b/vm/CHANGELOG.md @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Change `lru` dependency to `0.16.3` -- Update MSRV to 1.85 +- Update MSRV to 1.87 ## [1.4.3] - 2026-01-07 diff --git a/vm/src/execute.rs b/vm/src/execute.rs index e160a3bcee..64280b04f9 100644 --- a/vm/src/execute.rs +++ b/vm/src/execute.rs @@ -93,16 +93,14 @@ pub fn execute( }? } - if config.disable_3rd_party { - if let Some(call) = tx.call() { - if call.contract != TRANSFER_CONTRACT - && call.contract != STAKE_CONTRACT - { - return Err(Error::Panic( - "3rd party contracts are not enabled in the VM".into(), - )); - } - } + if config.disable_3rd_party + && let Some(call) = tx.call() + && call.contract != TRANSFER_CONTRACT + && call.contract != STAKE_CONTRACT + { + return Err(Error::Panic( + "3rd party contracts are not enabled in the VM".into(), + )); } let blob_min_charge = tx @@ -140,10 +138,10 @@ pub fn execute( // If this is a blob transaction, ensure the gas spent is at least the // minimum charge. - if let Some(blob_min_charge) = blob_min_charge { - if receipt.gas_spent < blob_min_charge { - receipt.gas_spent = blob_min_charge; - } + if let Some(blob_min_charge) = blob_min_charge + && receipt.gas_spent < blob_min_charge + { + receipt.gas_spent = blob_min_charge; } // Ensure all gas is consumed if there's an error in the contract call diff --git a/wallet-core/CHANGELOG.md b/wallet-core/CHANGELOG.md index 3eed699b8c..0d60be02ee 100644 --- a/wallet-core/CHANGELOG.md +++ b/wallet-core/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update to edition 2024 - Gate `try_trait_v2` feature behind wasm target - Use nightly toolchain with `panic=immediate-abort` for WASM builds -- Update MSRV to 1.85 +- Update MSRV to 1.87 ## [1.4.0] - 2025-11-06