Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
654 changes: 297 additions & 357 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,16 @@ heck = "0.5"
hex = "0.4"
hex-literal = "0.4"
hmac = "0.12"
http = "1.3"
hyper = "1.7"
iced = "0.13"
# Note: we need this fix - https://github.com/iced-rs/iced_aw/pull/329
# TODO: switch back to a released version of iced_aw once the fix is released (need version > 0.12)
iced_aw = { git = "https://github.com/iced-rs/iced_aw", branch = "main" }
iced_fonts = "0.1"
indoc = "2.0"
itertools = "0.14"
jsonrpsee = { version = "0.22", default-features = false }
jsonrpsee = { version = "0.26", default-features = false }
lazy_static = "1.4"
libtest-mimic = "0.8"
log = "0.4"
Expand All @@ -207,6 +209,7 @@ reedline = "0.38"
ref-cast = "1.0"
regex = "1.10"
replace_with = "0.1"
reqwest = "0.12"
rfd = { version = "0.15", default-features = false }
ripemd = "0.1"
rlimit = "0.10"
Expand Down Expand Up @@ -243,8 +246,8 @@ tokio-socks = "0.5"
tokio-stream = "0.1"
tokio-util = { version = "0.7", default-features = false }
toml = "0.8"
tower = "0.4"
tower-http-axum = { package = "tower-http", version = "0.5" }
tower = "0.5"
tower-http = "0.5"
hickory-client = "0.24"
hickory-server = "0.24"
zeroize = "1.5"
Expand Down
2 changes: 1 addition & 1 deletion api-server/stack-test-suite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async-trait.workspace = true
axum.workspace = true
hex.workspace = true
libtest-mimic.workspace = true
reqwest = "0.11"
reqwest.workspace = true
serde.workspace = true
serde_json.workspace = true
tokio = { workspace = true, features = ["full"] }
Expand Down
2 changes: 1 addition & 1 deletion api-server/web-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
thiserror.workspace = true
tokio = { workspace = true }
tower-http-axum = { workspace = true, features = ["cors"] }
tower-http = { workspace = true, features = ["cors"] }
2 changes: 1 addition & 1 deletion api-server/web-server/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use axum::{http::Method, response::IntoResponse, routing::get, Json, Router};
use serde_json::json;
use std::sync::Arc;
use tokio::net::TcpListener;
use tower_http_axum::cors::{AllowMethods, Any, CorsLayer};
use tower_http::cors::{AllowMethods, Any, CorsLayer};

#[allow(clippy::unused_async)]
async fn bad_request() -> Result<(), ApiServerWebServerError> {
Expand Down
10 changes: 3 additions & 7 deletions chainstate/launcher/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,12 @@ use chainstate::ChainstateConfig;

/// Storage type to use
#[must_use]
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq, Default)]
pub enum StorageBackendConfig {
#[default]
Lmdb,
InMemory,
}

impl Default for StorageBackendConfig {
fn default() -> Self {
Self::Lmdb
}
InMemory,
}

impl StorageBackendConfig {
Expand Down
4 changes: 2 additions & 2 deletions chainstate/test-framework/src/random_tx_maker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1379,14 +1379,14 @@ impl<'a> RandomTxMaker<'a> {
PrivateKey::new_from_rng(rng, KeyKind::Secp256k1Schnorr);

*dummy_pool_id = pool_id;
*pool_data = Box::new(StakePoolData::new(
**pool_data = StakePoolData::new(
pool_data.pledge(),
Destination::PublicKey(staker_pk),
vrf_pk,
Destination::AnyoneCanSpend,
pool_data.margin_ratio_per_thousand(),
pool_data.cost_per_block(),
));
);
let _ = pos_accounting_cache
.create_pool(pool_id, pool_data.as_ref().clone().into())
.unwrap();
Expand Down
12 changes: 6 additions & 6 deletions common/src/address/dehexify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ use super::hexified::HexifiedAddress;

#[allow(clippy::let_and_return)]
pub fn dehexify_all_addresses(conf: &ChainConfig, input: &str) -> String {
let result = HexifiedAddress::<Destination>::replace_with_address(conf, input).to_string();
let result = HexifiedAddress::<PoolId>::replace_with_address(conf, &result).to_string();
let result = HexifiedAddress::<DelegationId>::replace_with_address(conf, &result).to_string();
let result = HexifiedAddress::<TokenId>::replace_with_address(conf, &result).to_string();
let result = HexifiedAddress::<OrderId>::replace_with_address(conf, &result).to_string();
let result = HexifiedAddress::<VRFPublicKey>::replace_with_address(conf, &result).to_string();
let result = HexifiedAddress::<Destination>::replace_with_address(conf, input).clone();
let result = HexifiedAddress::<PoolId>::replace_with_address(conf, &result).clone();
let result = HexifiedAddress::<DelegationId>::replace_with_address(conf, &result).clone();
let result = HexifiedAddress::<TokenId>::replace_with_address(conf, &result).clone();
let result = HexifiedAddress::<OrderId>::replace_with_address(conf, &result).clone();
let result = HexifiedAddress::<VRFPublicKey>::replace_with_address(conf, &result).clone();

result
}
Expand Down
2 changes: 1 addition & 1 deletion common/src/chain/transaction/output/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl TextSummary for TxOutput {
NftIssuance::V0(iss1) => {
let md = &iss1.metadata;
let creator = match &md.creator {
Some(c) => hex::encode(c.public_key.encode()).to_string(),
Some(c) => hex::encode(c.public_key.encode()).clone(),
None => "Unspecified".to_string(),
};
format!(
Expand Down
6 changes: 3 additions & 3 deletions crypto/src/key/hdkd/child_number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ mod test {
#[case(0, false)]
#[case(1, false)]
#[case(1234567, false)]
#[case(u32::MAX & (!0x80000000 - 1), false)]
#[case(u32::MAX & !0x80000000, false)]
#[case(u32::MAX & (!0x80000000 + 1), true)]
#[case(!0x80000000 - 1, false)]
#[case(!0x80000000, false)]
#[case(!0x80000000 + 1, true)]
#[case(u32::MAX - 1, true)]
#[case(u32::MAX, true)]
fn create_child_number(#[case] encoded_num: u32, #[case] is_hardened: bool) {
Expand Down
2 changes: 2 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ allow = [
"BSD-3-Clause",
"BSL-1.0",
"CC0-1.0",
"CDLA-Permissive-2.0",
"ISC",
"MIT",
"MPL-2.0",
Expand Down Expand Up @@ -47,4 +48,5 @@ db-urls = [ "https://github.com/RustSec/advisory-db" ]
yanked = "warn"
ignore = [
"RUSTSEC-2024-0436", # "paste" is no longer maintained
"RUSTSEC-2025-0141", # "bincode" is no longer maintained
]
2 changes: 1 addition & 1 deletion mempool/src/pool/tests/orphans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ async fn diamond_graph(#[case] seed: Seed, #[case] insertion_plan: Vec<(usize, u

let tx3 = make_tx(&mut rng, &[(tx1_outpt, 0), (tx2_outpt, 0)], &[90_000_000]);

let txs = vec![tx0, tx1, tx2, tx3];
let txs = [tx0, tx1, tx2, tx3];
let tx_ids: Vec<_> = txs.iter().map(|tx| tx.transaction().get_id()).collect();

// Set up mempool and execute the insertion plan
Expand Down
2 changes: 1 addition & 1 deletion node-gui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ fn view(state: &GuiState) -> Element<'_, Message> {
column![
iced::widget::text("Mintlayer-core node initialization failed".to_string())
.size(header_font_size),
iced::widget::text(message.to_string()).size(text_font_size)
iced::widget::text(message.clone()).size(text_font_size)
]
}
InitializationInterruptionReason::DataDirCleanedUp => {
Expand Down
11 changes: 8 additions & 3 deletions p2p/src/peer_manager/tests/connections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,14 @@ async fn connection_timeout_rpc_notified<T>(
)
.unwrap();

logging::spawn_in_current_span(async move {
peer_manager.run().await.unwrap();
});
logging::spawn_in_current_span(
// Rust 1.92 thinks that the unwrap call here is unreachable, even though the function
// returns a normal error.
#[allow(unreachable_code)]
async move {
peer_manager.run().await.unwrap();
},
);

let (response_sender, response_receiver) = oneshot_nofail::channel();
peer_mgr_event_sender
Expand Down
11 changes: 8 additions & 3 deletions p2p/src/peer_manager/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,14 @@ where
{
let (peer_manager, peer_mgr_event_sender, shutdown_sender, subscribers_sender) =
make_peer_manager_custom::<T>(transport, addr, chain_config, p2p_config, time_getter).await;
logging::spawn_in_current_span(async move {
peer_manager.run().await.unwrap();
});
logging::spawn_in_current_span(
// Rust 1.92 thinks that the unwrap call here is unreachable, even though the function
// returns a normal error.
#[allow(unreachable_code)]
async move {
peer_manager.run().await.unwrap();
},
);
(peer_mgr_event_sender, shutdown_sender, subscribers_sender)
}

Expand Down
8 changes: 3 additions & 5 deletions rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ utils-networking = { path = "../utils/networking" }
anyhow.workspace = true
async-trait.workspace = true
base64.workspace = true
http.workspace = true
hyper.workspace = true
jsonrpsee = { workspace = true, features = ["server", "server-core", "http-client", "ws-client", "macros"] }
serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true
tower = { workspace = true, features = ["util"] }

# This we keep here, and not in the workspace, because it comes from jsonrpsee and requires an older version
tower-http = { version = "0.4", features = ["auth", "set-header"] }
http = "0.2"
hyper = "0.14"
tower-http = { workspace = true, features = ["auth", "set-header"] }

[dev-dependencies]
test-utils = { path = "../test-utils" }
Expand Down
16 changes: 12 additions & 4 deletions rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ use std::{net::SocketAddr, path::PathBuf};
use base64::Engine;
use http::{header, HeaderValue};
use jsonrpsee::{
http_client::{transport::HttpBackend, HttpClient, HttpClientBuilder},
core::middleware::RpcServiceBuilder,
http_client::{transport::HttpBackend, HttpClient, HttpClientBuilder, RpcService},
server::{ServerBuilder, ServerHandle},
};

Expand Down Expand Up @@ -109,7 +110,9 @@ impl Builder {
};

let mut module = jsonrpsee::RpcModule::new(());
module.register_method(method_list_name, move |_params, &()| method_names.clone())?;
module.register_method(method_list_name, move |_params, &(), _extensions| {
method_names.clone()
})?;
Ok(module)
}
}
Expand Down Expand Up @@ -223,7 +226,7 @@ impl<T> MakeHeaderValue<T> for RpcAuthData {
}
}

pub type RpcHttpClient = HttpClient<SetRequestHeader<HttpBackend, RpcAuthData>>;
pub type RpcHttpClient = HttpClient<RpcService<SetRequestHeader<HttpBackend, RpcAuthData>>>;

pub fn new_http_client(
host: impl AsRef<str>,
Expand All @@ -234,7 +237,12 @@ pub fn new_http_client(
rpc_auth,
));

HttpClientBuilder::default().set_http_middleware(middleware).build(host)
HttpClientBuilder::default()
// Note: by default (i.e. without calling `set_rpc_middleware`) `HttpClientBuilder` wraps
// the produced `RpcService` into `RpcLogger`, which we don't need.
.set_rpc_middleware(RpcServiceBuilder::default())
.set_http_middleware(middleware)
.build(host)
}

pub type RpcWsClient = jsonrpsee::ws_client::WsClient;
Expand Down
5 changes: 3 additions & 2 deletions rpc/src/rpc_auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ use crypto::{
kdf::{argon2::Argon2Config, hash_password, verify_password, KdfConfig, KdfResult},
util::eq::SliceEqualityCheckMethod,
};
use hyper::{Body, Request, Response};
use hyper::{Request, Response};
use jsonrpsee::server::HttpBody;
use logging::log;
use randomness::make_true_rng;
use tower_http::validate_request::ValidateRequest;
Expand Down Expand Up @@ -102,7 +103,7 @@ impl RpcAuth {
}

impl<B> ValidateRequest<B> for RpcAuth {
type ResponseBody = Body;
type ResponseBody = HttpBody;

fn validate(&mut self, request: &mut Request<B>) -> Result<(), Response<Self::ResponseBody>> {
use jsonrpsee::types;
Expand Down
2 changes: 1 addition & 1 deletion rpc/src/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ pub enum Error {
}

/// Subscription method reply type
pub type Reply = Result<(), jsonrpsee::core::StringError>;
pub type Reply = Result<(), jsonrpsee::core::SubscriptionError>;
3 changes: 2 additions & 1 deletion storage/lmdb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ logging = { path = '../../logging' }
storage-core = { path = '../core' }
utils = { path = '../../utils' }

lmdb-mintlayer = { git = 'https://github.com/mintlayer/lmdb-rs-mintlayer.git', tag = 'v0.16.2' }
# Commit "Fix off_t overflow on Windows"
lmdb-mintlayer = { git = 'https://github.com/mintlayer/lmdb-rs-mintlayer.git', rev = '88d9f2bd49399f75ca1baa1537b2387252f9b5db' }

[dev-dependencies]
rstest.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion wallet/src/signer/tests/generic_fixed_signature_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ pub fn test_fixed_signatures_generic2<MkS, S>(
let account2_dest2 = new_dest_from_account(&mut account2, &mut db_tx, KeyPurpose::Change);
let account2_pk2 = find_pub_key_for_pkh_dest(&account2_dest2, &account2).clone();

let utxos = vec![
let utxos = [
TxOutput::Transfer(
OutputValue::Coin(Amount::from_atoms(1000)),
account1_dest4.clone(),
Expand Down
2 changes: 1 addition & 1 deletion wallet/wallet-cli-commands/src/command_handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ where
)
})
.collect();
Ok(ConsoleCommand::Print(delegations.join("\n").to_string()))
Ok(ConsoleCommand::Print(delegations.join("\n").clone()))
}

WalletCommand::ListCreatedBlocksIds => {
Expand Down