Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e497660
Use polkadot-v0.9.43 substrate and frontier deps
dmitrylavrenov Mar 7, 2024
8c8606d
[substrate-apply] pallet-*: frame: Enable GenesisConfig in no_std #14108
dmitrylavrenov Mar 13, 2024
9ee6824
[substrate-apply] humanode-runtime: Benchmark pallet sudo (#13880)
dmitrylavrenov Mar 13, 2024
ed3fd71
[substrate-apply] humanode-runtime: Create benchmark for the system::…
dmitrylavrenov Mar 13, 2024
6e906c5
Fix db_config_dir path extraction
dmitrylavrenov Mar 13, 2024
a3d15f8
[substrate-apply] humanode-peer:service: Prepare sc-network for Proto…
dmitrylavrenov Mar 13, 2024
45b6861
[substrate-apply] humanode-peer:cli:config: rpc server: break legacy …
dmitrylavrenov Mar 13, 2024
b0da921
[substrate-apply] pallet-*: BREAKING - Try-runtime: Use proper error …
dmitrylavrenov Mar 18, 2024
5151c7b
Use own sudo weights
dmitrylavrenov Mar 20, 2024
99e1a96
Fix rpc url http port in ts tests
dmitrylavrenov Mar 20, 2024
33bb86b
Fix features snapshot
dmitrylavrenov Oct 22, 2024
f69cd5d
Rerun benchmarks
dmitrylavrenov Oct 22, 2024
30bcf87
Fix help stdout fixtures
dmitrylavrenov Oct 22, 2024
b6f1006
Run missed migrations
dmitrylavrenov Oct 31, 2024
dfe9c55
Properly use GetStorageVersion changes
dmitrylavrenov Nov 21, 2024
f386b37
Fix fmt
dmitrylavrenov Nov 21, 2024
56f70c4
Use Vec from sp_std
dmitrylavrenov Dec 4, 2024
6d9f59f
Use fully qualify syntax for try-runtime usage
dmitrylavrenov Dec 4, 2024
8ff20d7
Use TryRuntimeError at bioauth migrations
dmitrylavrenov Feb 19, 2025
28b1904
Unify TryRuntime usage
dmitrylavrenov Feb 19, 2025
2a8d7d8
Properly handle rpc_port at rpc_url_from_params
dmitrylavrenov Feb 19, 2025
f5e49a4
Use TryRuntimeError at evm-nonces-recovery migrations
dmitrylavrenov Feb 20, 2025
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
1,913 changes: 488 additions & 1,425 deletions Cargo.lock

Large diffs are not rendered by default.

178 changes: 89 additions & 89 deletions Cargo.toml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions crates/evm-nonces-recovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

use core::marker::PhantomData;

#[cfg(feature = "try-runtime")]
use frame_support::sp_std::vec::Vec;
use frame_support::{
log::{error, info},
pallet_prelude::*,
sp_std::collections::btree_set::BTreeSet,
traits::OnRuntimeUpgrade,
};
#[cfg(feature = "try-runtime")]
use frame_support::{sp_runtime::TryRuntimeError, sp_std::vec::Vec};
use pallet_evm::AccountCodes;
use pallet_evm_system::{Account, AccountInfo, Pallet};
use rlp::RlpStream;
Expand Down Expand Up @@ -76,13 +76,13 @@ where
}

#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, &'static str> {
fn pre_upgrade() -> Result<Vec<u8>, TryRuntimeError> {
let accounts = <Account<R>>::iter().collect();
Ok(PreUpgradeState::<R> { accounts }.encode())
}

#[cfg(feature = "try-runtime")]
fn post_upgrade(state: Vec<u8>) -> Result<(), &'static str> {
fn post_upgrade(state: Vec<u8>) -> Result<(), TryRuntimeError> {
let PreUpgradeState::<R> {
accounts: prev_accounts,
} = Decode::decode(&mut state.as_slice())
Expand Down
1 change: 1 addition & 0 deletions crates/humanode-peer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ sc-consensus = { workspace = true }
sc-consensus-babe = { workspace = true }
sc-consensus-grandpa = { workspace = true }
sc-executor = { workspace = true }
sc-network = { workspace = true }
sc-service = { workspace = true }
sc-telemetry = { workspace = true }
sc-transaction-pool = { workspace = true }
Expand Down
31 changes: 10 additions & 21 deletions crates/humanode-peer/src/cli/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ pub trait CliConfigurationExt: SubstrateCliConfigurationProvider {
.unwrap_or_default();

let bioauth_flow = self.bioauth_params().map(|params| {
let rpc_http_port = substrate.rpc_http.map(|v| v.port());
let rpc_ws_port = substrate.rpc_ws.map(|v| v.port());
let rpc_url = rpc_url_from_params(params, rpc_http_port, rpc_ws_port);
let rpc_port = substrate.rpc_addr.map(|v| v.port());
let rpc_url = rpc_url_from_params(params, rpc_port);

configuration::BioauthFlow {
rpc_url_resolver: Default::default(),
Expand Down Expand Up @@ -124,11 +123,7 @@ impl<T: sc_cli::CliConfiguration> SubstrateCliConfigurationProvider for T {
}

/// Construct an RPC URL from the bioauth flow params and an RPC endpoint port.
fn rpc_url_from_params(
params: &BioauthFlowParams,
rpc_http_port: Option<u16>,
rpc_ws_port: Option<u16>,
) -> RpcUrl {
fn rpc_url_from_params(params: &BioauthFlowParams, rpc_port: Option<u16>) -> RpcUrl {
if let Some(val) = &params.rpc_url {
return RpcUrl::Set(val.clone());
}
Expand All @@ -138,7 +133,7 @@ fn rpc_url_from_params(
if params.rpc_url_ngrok_detect {
let ws_rpc_endpoint_port = match params.rpc_url_scheme_preference {
// If there's no preference - try switching to WebSocket if it's available.
RpcUrlSchemePreference::NoPreference | RpcUrlSchemePreference::Ws => rpc_ws_port,
RpcUrlSchemePreference::NoPreference | RpcUrlSchemePreference::Ws => rpc_port,
RpcUrlSchemePreference::Http => None,
};
return RpcUrl::DetectFromNgrok {
Expand All @@ -147,25 +142,19 @@ fn rpc_url_from_params(
};
}

match (
&params.rpc_url_scheme_preference,
rpc_http_port,
rpc_ws_port,
) {
match (&params.rpc_url_scheme_preference, rpc_port) {
// Try WebSocket first if the user has no preference.
(RpcUrlSchemePreference::Ws | RpcUrlSchemePreference::NoPreference, _, Some(port)) => {
(RpcUrlSchemePreference::Ws | RpcUrlSchemePreference::NoPreference, Some(port)) => {
RpcUrl::LocalhostWithPort {
rpc_endpoint_port: port,
scheme: "ws",
}
}
// Try HTTP second if the user has no preference.
(RpcUrlSchemePreference::Http | RpcUrlSchemePreference::NoPreference, Some(port), _) => {
RpcUrl::LocalhostWithPort {
rpc_endpoint_port: port,
scheme: "http",
}
}
(RpcUrlSchemePreference::Http, Some(port)) => RpcUrl::LocalhostWithPort {
rpc_endpoint_port: port,
scheme: "http",
},
// If everything fails - fallback to unset.
_ => RpcUrl::Unset,
}
Expand Down
12 changes: 2 additions & 10 deletions crates/humanode-peer/src/service/frontier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,15 @@ use std::{path::Path, sync::Arc};

use fc_storage::OverrideHandle;
use humanode_runtime::opaque::Block;
use sc_cli::SubstrateCli;
use sc_client_api::backend::Backend;
use sc_service::{BasePath, Configuration};
use sc_service::Configuration;

use super::{FrontierBackend, FullClient, ServiceError};
use crate::configuration::{self, FrontierBackendType};

/// Create frontier dir.
pub fn db_config_dir(config: &sc_service::Configuration) -> std::path::PathBuf {
config
.base_path
.as_ref()
.map(|base_path| base_path.config_dir(config.chain_spec.id()))
.unwrap_or_else(|| {
BasePath::from_project("", "", &crate::cli::Root::executable_name())
.config_dir(config.chain_spec.id())
})
config.base_path.config_dir(config.chain_spec.id())
}

/// Create frontier backend.
Expand Down
13 changes: 6 additions & 7 deletions crates/humanode-peer/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ pub async fn new_full(config: Configuration) -> Result<TaskManager, ServiceError
),
} = new_partial(&config)?;
let Configuration {
substrate: mut config,
substrate: config,
bioauth_flow: bioauth_flow_config,
ethereum_rpc: ethereum_rpc_config,
..
Expand All @@ -245,12 +245,10 @@ pub async fn new_full(config: Configuration) -> Result<TaskManager, ServiceError
&config.chain_spec,
);

config
.network
.extra_sets
.push(sc_consensus_grandpa::grandpa_peers_set_config(
grandpa_protocol_name.clone(),
));
let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network);
net_config.add_notification_protocol(sc_consensus_grandpa::grandpa_peers_set_config(
grandpa_protocol_name.clone(),
));

let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new(
Arc::clone(&backend),
Expand Down Expand Up @@ -297,6 +295,7 @@ pub async fn new_full(config: Configuration) -> Result<TaskManager, ServiceError
let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
net_config,
client: Arc::clone(&client),
transaction_pool: Arc::clone(&transaction_pool),
spawn_handle: task_manager.spawn_handle(),
Expand Down
1 change: 1 addition & 0 deletions crates/humanode-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ runtime-benchmarks = [
"pallet-humanode-session/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-sudo/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-token-claims/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
Expand Down
Loading
Loading