From 495b4480d2484828cd1b014135d4dcf5ee3502bb Mon Sep 17 00:00:00 2001 From: MOZGIII Date: Tue, 7 Oct 2025 08:09:03 +0400 Subject: [PATCH 01/11] Integrate pallet-fixed-validators-set with pallet-humanode-session --- Cargo.lock | 1 + crates/pallet-humanode-session/Cargo.toml | 4 +++ crates/pallet-humanode-session/src/lib.rs | 39 ++++++++++++++++++++-- crates/pallet-humanode-session/src/mock.rs | 11 ++++++ 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e7d0b106..f59bc76d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6398,6 +6398,7 @@ dependencies = [ "mockall", "pallet-bioauth", "pallet-bootnodes", + "pallet-fixed-validators-set", "pallet-session", "parity-scale-codec", "scale-info", diff --git a/crates/pallet-humanode-session/Cargo.toml b/crates/pallet-humanode-session/Cargo.toml index cf63d823b..2a980a264 100644 --- a/crates/pallet-humanode-session/Cargo.toml +++ b/crates/pallet-humanode-session/Cargo.toml @@ -7,6 +7,7 @@ publish = false [dependencies] pallet-bioauth = { path = "../pallet-bioauth", default-features = false } pallet-bootnodes = { path = "../pallet-bootnodes", default-features = false } +pallet-fixed-validators-set = { path = "../pallet-fixed-validators-set", default-features = false } codec = { workspace = true, features = ["derive"] } frame-benchmarking = { workspace = true, optional = true } @@ -30,11 +31,13 @@ runtime-benchmarks = [ "frame-system/runtime-benchmarks", "pallet-bioauth/runtime-benchmarks", "pallet-bootnodes/runtime-benchmarks", + "pallet-fixed-validators-set/runtime-benchmarks", "sp-runtime/runtime-benchmarks", ] std = [ "pallet-bioauth/std", "pallet-bootnodes/std", + "pallet-fixed-validators-set/std", "codec/std", "frame-support/std", "frame-system/std", @@ -50,6 +53,7 @@ try-runtime = [ "frame-system/try-runtime", "pallet-bioauth/try-runtime", "pallet-bootnodes/try-runtime", + "pallet-fixed-validators-set/try-runtime", "pallet-session/try-runtime", "sp-runtime/try-runtime", ] diff --git a/crates/pallet-humanode-session/src/lib.rs b/crates/pallet-humanode-session/src/lib.rs index e7d2299d6..59a164d47 100644 --- a/crates/pallet-humanode-session/src/lib.rs +++ b/crates/pallet-humanode-session/src/lib.rs @@ -47,6 +47,7 @@ pub mod pallet { + pallet_session::Config + pallet_bioauth::Config + pallet_bootnodes::Config + + pallet_fixed_validators_set::Config { /// The type for converting the key that `pallet_bioauth` uses into the key that session /// requires. @@ -59,12 +60,19 @@ pub mod pallet { /// The type for converting the key that bootnodes use into the key that session requires. type BootnodeIdOf: Convert<::BootnodeId, Self::AccountId>; + /// The type for converting the key that fixed validators set use into the key that session + /// requires. + type FixedValidatorsSetIdOf: Convert<::ValidatorId, Self::AccountId>; + /// The max amount of bootnodes contributing to the session validators. type MaxBootnodeValidators: Get; /// The max amount of bioauth-powered session validators. type MaxBioauthValidators: Get; + /// The max amount of fix validator set validators. + type MaxFixedValidatorsSetValidators: Get; + /// The maximum number of banned accounts. type MaxBannedAccounts: Get; @@ -194,11 +202,15 @@ pub mod pallet { codec::Encode, codec::Decode, )] -pub enum Identification { +pub enum Identification { /// The validator is a bootnode. Bootnode(Bootnode), + /// The validator is bioauthenticated. Bioauth(Bioauth), + + /// The validator is from a fixed set. + FixedValidatorsSet(FixedValidatorsSet), } /// The bioauth authentication type for a given config. @@ -210,8 +222,12 @@ pub type BioauthAuthenticationFor = pallet_bioauth::Authentication< /// The bootnode id type for a given config. pub type BootnodeIdFor = ::BootnodeId; +/// The fixed validator set validator id type for a given config. +pub type FixedValidatorsSetIdFor = ::ValidatorId; + /// The identification type for a given config. -pub type IdentificationFor = Identification, BioauthAuthenticationFor>; +pub type IdentificationFor = + Identification, BioauthAuthenticationFor, FixedValidatorsSetIdFor>; /// The identification tuple type for a given config. pub type IdentificationTupleFor = (::AccountId, IdentificationFor); @@ -241,7 +257,24 @@ impl Pallet { .map(|account_id| (account_id, Identification::Bioauth(authentication))) }); - bootnodes.chain(bioauth_active_authentications) + let fixed_validators = >::validators() + .into_inner() + .into_iter() + .take( + T::MaxFixedValidatorsSetValidators::get() + .try_into() + .unwrap(), + ) + .map(move |id| { + ( + T::FixedValidatorsSetIdOf::convert(id.clone()), + Identification::FixedValidatorsSet(id), + ) + }); + + bootnodes + .chain(bioauth_active_authentications) + .chain(fixed_validators) } /// Clears and re-populates the [`SessionIdentities`] for a given session with the entries. diff --git a/crates/pallet-humanode-session/src/mock.rs b/crates/pallet-humanode-session/src/mock.rs index b92632df5..64f981a88 100644 --- a/crates/pallet-humanode-session/src/mock.rs +++ b/crates/pallet-humanode-session/src/mock.rs @@ -34,6 +34,7 @@ frame_support::construct_runtime!( System: frame_system, Bootnodes: pallet_bootnodes, Bioauth: pallet_bioauth, + FixedValidatorsSet: pallet_fixed_validators_set, Session: pallet_session, Historical: pallet_session_historical, HumanodeSession: pallet_humanode_session, @@ -72,6 +73,13 @@ impl pallet_bootnodes::Config for Test { type MaxBootnodes = ConstU32<3>; } +impl pallet_fixed_validators_set::Config for Test { + type RuntimeEvent = RuntimeEvent; + type ValidatorId = AccountId; + type MaxValidators = ::MaxAuthentications; + type WeightInfo = (); +} + #[derive(PartialEq, Eq, Default, Clone, Encode, Decode, Hash, Debug, TypeInfo)] pub struct MockOpaqueAuthTicket; @@ -210,8 +218,11 @@ impl pallet_session::historical::Config for Test { impl pallet_humanode_session::Config for Test { type ValidatorPublicKeyOf = IdentityValidatorIdOf; type BootnodeIdOf = sp_runtime::traits::Identity; + type FixedValidatorsSetIdOf = sp_runtime::traits::Identity; type MaxBootnodeValidators = ::MaxBootnodes; type MaxBioauthValidators = ::MaxAuthentications; + type MaxFixedValidatorsSetValidators = + ::MaxValidators; type MaxBannedAccounts = ::MaxAuthentications; type WeightInfo = (); } From c36260ce6eb49715ecee69bd47078a144956400b Mon Sep 17 00:00:00 2001 From: MOZGIII Date: Tue, 7 Oct 2025 08:34:24 +0400 Subject: [PATCH 02/11] Integrate pallet-fixed-validators-set into pallet-humanode-offences --- Cargo.lock | 1 + crates/pallet-humanode-offences/Cargo.toml | 3 +++ crates/pallet-humanode-offences/src/lib.rs | 5 +++-- crates/pallet-humanode-offences/src/mock.rs | 11 +++++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f59bc76d1..ed5e7398d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6379,6 +6379,7 @@ dependencies = [ "mockall", "pallet-bioauth", "pallet-bootnodes", + "pallet-fixed-validators-set", "pallet-humanode-session", "pallet-session", "parity-scale-codec", diff --git a/crates/pallet-humanode-offences/Cargo.toml b/crates/pallet-humanode-offences/Cargo.toml index a949d8353..913e24c06 100644 --- a/crates/pallet-humanode-offences/Cargo.toml +++ b/crates/pallet-humanode-offences/Cargo.toml @@ -16,6 +16,7 @@ sp-staking = { workspace = true } [dev-dependencies] pallet-bootnodes = { path = "../pallet-bootnodes" } +pallet-fixed-validators-set = { path = "../pallet-fixed-validators-set" } mockall = { workspace = true } pallet-session = { workspace = true, features = ["historical"] } @@ -29,6 +30,7 @@ std = [ "frame-support/std", "frame-system/std", "pallet-bioauth/std", + "pallet-fixed-validators-set/std", "pallet-humanode-session/std", "pallet-session/std", "scale-info/std", @@ -41,6 +43,7 @@ try-runtime = [ "frame-system/try-runtime", "pallet-bioauth/try-runtime", "pallet-bootnodes/try-runtime", + "pallet-fixed-validators-set/try-runtime", "pallet-humanode-session/try-runtime", "pallet-session/try-runtime", ] diff --git a/crates/pallet-humanode-offences/src/lib.rs b/crates/pallet-humanode-offences/src/lib.rs index e636397f3..af8f7edfa 100644 --- a/crates/pallet-humanode-offences/src/lib.rs +++ b/crates/pallet-humanode-offences/src/lib.rs @@ -80,8 +80,9 @@ where pallet_humanode_session::Identification::Bioauth(authentication) => { should_be_deauthenticated.push(authentication.clone()); } - pallet_humanode_session::Identification::Bootnode(..) => { - // Never slash the bootnodes. + pallet_humanode_session::Identification::Bootnode(..) + | pallet_humanode_session::Identification::FixedValidatorsSet(..) => { + // Never slash the bootnodes or the fixed set validators. } } } diff --git a/crates/pallet-humanode-offences/src/mock.rs b/crates/pallet-humanode-offences/src/mock.rs index 4d9ebebee..5ebc5a865 100644 --- a/crates/pallet-humanode-offences/src/mock.rs +++ b/crates/pallet-humanode-offences/src/mock.rs @@ -35,6 +35,7 @@ frame_support::construct_runtime!( System: frame_system, Bootnodes: pallet_bootnodes, Bioauth: pallet_bioauth, + FixedValidatorsSet: pallet_fixed_validators_set, Session: pallet_session, Historical: pallet_session_historical, HumanodeSession: pallet_humanode_session, @@ -74,6 +75,13 @@ impl pallet_bootnodes::Config for Test { type MaxBootnodes = ConstU32<3>; } +impl pallet_fixed_validators_set::Config for Test { + type RuntimeEvent = RuntimeEvent; + type ValidatorId = AccountId; + type MaxValidators = ::MaxAuthentications; + type WeightInfo = (); +} + #[derive(PartialEq, Eq, Default, Clone, Encode, Decode, Hash, Debug, TypeInfo)] pub struct MockOpaqueAuthTicket; @@ -208,8 +216,11 @@ impl pallet_session::historical::Config for Test { impl pallet_humanode_session::Config for Test { type ValidatorPublicKeyOf = (); type BootnodeIdOf = sp_runtime::traits::Identity; + type FixedValidatorsSetIdOf = sp_runtime::traits::Identity; type MaxBootnodeValidators = ::MaxBootnodes; type MaxBioauthValidators = ::MaxAuthentications; + type MaxFixedValidatorsSetValidators = + ::MaxValidators; type MaxBannedAccounts = ::MaxAuthentications; type WeightInfo = (); } From 9a5cc915c48216efec31894a9ea4492a2adb7645 Mon Sep 17 00:00:00 2001 From: MOZGIII Date: Tue, 7 Oct 2025 08:40:47 +0400 Subject: [PATCH 03/11] Integrate pallet-fixed-validators-set into humanode-runtime --- Cargo.lock | 1 + crates/humanode-runtime/Cargo.toml | 4 ++++ crates/humanode-runtime/src/benchmarking.rs | 9 +++++++++ crates/humanode-runtime/src/lib.rs | 12 ++++++++++++ .../humanode-runtime/src/tests/claims_and_vesting.rs | 3 +++ crates/humanode-runtime/src/tests/genesis_config.rs | 5 ++++- 6 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index ed5e7398d..dd04e664a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3949,6 +3949,7 @@ dependencies = [ "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", "pallet-evm-system", + "pallet-fixed-validators-set", "pallet-grandpa", "pallet-humanode-offences", "pallet-humanode-session", diff --git a/crates/humanode-runtime/Cargo.toml b/crates/humanode-runtime/Cargo.toml index f239afaac..c65c6c8a2 100644 --- a/crates/humanode-runtime/Cargo.toml +++ b/crates/humanode-runtime/Cargo.toml @@ -32,6 +32,7 @@ pallet-ethereum-chain-id = { path = "../pallet-ethereum-chain-id", default-featu pallet-evm-accounts-mapping = { path = "../pallet-evm-accounts-mapping", default-features = false } pallet-evm-balances = { path = "../pallet-evm-balances", default-features = false } pallet-evm-system = { path = "../pallet-evm-system", default-features = false } +pallet-fixed-validators-set = { path = "../pallet-fixed-validators-set", default-features = false } pallet-humanode-offences = { path = "../pallet-humanode-offences", default-features = false } pallet-humanode-session = { path = "../pallet-humanode-session", default-features = false } pallet-native-to-evm-swap = { path = "../pallet-native-to-evm-swap", default-features = false } @@ -131,6 +132,7 @@ runtime-benchmarks = [ "pallet-ethereum/runtime-benchmarks", "pallet-evm-accounts-mapping/runtime-benchmarks", "pallet-evm/runtime-benchmarks", + "pallet-fixed-validators-set/runtime-benchmarks", "pallet-grandpa/runtime-benchmarks", "pallet-humanode-session/runtime-benchmarks", "pallet-im-online/runtime-benchmarks", @@ -192,6 +194,7 @@ std = [ "pallet-evm/std", "pallet-evm-balances/std", "pallet-evm-system/std", + "pallet-fixed-validators-set/std", "pallet-grandpa/std", "pallet-humanode-offences/std", "pallet-humanode-session/std", @@ -264,6 +267,7 @@ try-runtime = [ "pallet-evm/try-runtime", "pallet-evm-balances/try-runtime", "pallet-evm-system/try-runtime", + "pallet-fixed-validators-set/try-runtime", "pallet-grandpa/try-runtime", "pallet-humanode-offences/try-runtime", "pallet-humanode-session/try-runtime", diff --git a/crates/humanode-runtime/src/benchmarking.rs b/crates/humanode-runtime/src/benchmarking.rs index 736c772fe..817f0e161 100644 --- a/crates/humanode-runtime/src/benchmarking.rs +++ b/crates/humanode-runtime/src/benchmarking.rs @@ -205,6 +205,15 @@ impl pallet_vesting::benchmarking::SchedulingDriver for vesting::SchedulingDrive } } +impl pallet_fixed_validators_set::benchmarking::Interface for Runtime { + fn provide_validator_id( + account_index: u32, + ) -> ::ValidatorId { + let account_index_bytes = account_index.to_le_bytes(); + AccountId::new(keccak_256(&account_index_bytes)) + } +} + impl pallet_humanode_session::benchmarking::Interface for Runtime { fn provide_account_id(account_index: u32) -> ::AccountId { let account_index_bytes = account_index.to_le_bytes(); diff --git a/crates/humanode-runtime/src/lib.rs b/crates/humanode-runtime/src/lib.rs index c2d5199ba..1abe97893 100644 --- a/crates/humanode-runtime/src/lib.rs +++ b/crates/humanode-runtime/src/lib.rs @@ -563,11 +563,21 @@ impl pallet_bootnodes::Config for Runtime { type MaxBootnodes = ConstU32<16>; } +impl pallet_fixed_validators_set::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type ValidatorId = AccountId; + type MaxValidators = ConstU32; /* same amount in theory */ + type WeightInfo = (); // TODO: bench +} + impl pallet_humanode_session::Config for Runtime { type ValidatorPublicKeyOf = IdentityValidatorIdOf; type BootnodeIdOf = sp_runtime::traits::Identity; + type FixedValidatorsSetIdOf = sp_runtime::traits::Identity; type MaxBootnodeValidators = ::MaxBootnodes; type MaxBioauthValidators = ::MaxAuthentications; + type MaxFixedValidatorsSetValidators = + ::MaxValidators; type MaxBannedAccounts = ::MaxAuthentications; type WeightInfo = weights::pallet_humanode_session::WeightInfo; } @@ -855,6 +865,7 @@ construct_runtime!( DummyPrecompilesCode: pallet_dummy_precompiles_code = 38, HumanodeOffences: pallet_humanode_offences = 39, NativeToEvmSwap: pallet_native_to_evm_swap = 40, + FixedValidatorsSet: pallet_fixed_validators_set = 41, } ); @@ -1041,6 +1052,7 @@ mod benches { [pallet_vesting, Vesting] [pallet_humanode_session, HumanodeSession] [pallet_native_to_evm_swap, NativeToEvmSwap] + [pallet_fixed_validators_set, FixedValidatorsSet] ); } diff --git a/crates/humanode-runtime/src/tests/claims_and_vesting.rs b/crates/humanode-runtime/src/tests/claims_and_vesting.rs index 3b7ada193..d5c8c99c6 100644 --- a/crates/humanode-runtime/src/tests/claims_and_vesting.rs +++ b/crates/humanode-runtime/src/tests/claims_and_vesting.rs @@ -249,6 +249,9 @@ fn prepare_genesis_json(token_claims: &str, token_claim_pot_balance: u128) -> St "bootnodes": {{ "bootnodes": ["5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"] }}, + "fixedValidatorsSet": {{ + "validators": [] + }}, "bioauth": {{ "robonodePublicKey": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "consumedAuthTicketNonces": [], diff --git a/crates/humanode-runtime/src/tests/genesis_config.rs b/crates/humanode-runtime/src/tests/genesis_config.rs index 02e5d6788..f617fc765 100644 --- a/crates/humanode-runtime/src/tests/genesis_config.rs +++ b/crates/humanode-runtime/src/tests/genesis_config.rs @@ -14,6 +14,9 @@ fn works() { "bootnodes": { "bootnodes": ["5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"] }, + "fixedValidatorsSet": { + "validators": [] + }, "bioauth": { "robonodePublicKey": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "consumedAuthTicketNonces": [], @@ -132,7 +135,7 @@ fn unknown_field() { `ethereumChainId`, `sudo`, `grandpa`, `ethereum`, `evm`, \ `imOnline`, `evmAccountsMapping`, `tokenClaims`, `nativeToEvmSwapBridgePot`, \ `evmToNativeSwapBridgePot`, `balancedCurrencySwapBridgesInitializer`, \ - `dummyPrecompilesCode` at line 1 column 6" + `dummyPrecompilesCode`, `fixedValidatorsSet` at line 1 column 6" ); } From 870e4ddddb6bfba3674dad71378182938683248f Mon Sep 17 00:00:00 2001 From: MOZGIII Date: Tue, 7 Oct 2025 09:00:05 +0400 Subject: [PATCH 04/11] Integrate pallet-fixed-validators-set into humanode-peer --- crates/humanode-peer/src/chain_spec.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/humanode-peer/src/chain_spec.rs b/crates/humanode-peer/src/chain_spec.rs index ab31217b2..282040566 100644 --- a/crates/humanode-peer/src/chain_spec.rs +++ b/crates/humanode-peer/src/chain_spec.rs @@ -6,9 +6,9 @@ use hex_literal::hex; use humanode_runtime::{ opaque::SessionKeys, robonode, token_claims::types::ClaimInfo, AccountId, BabeConfig, Balance, BalancesConfig, BioauthConfig, BootnodesConfig, ChainPropertiesConfig, EVMConfig, - EthereumAddress, EthereumChainIdConfig, EthereumConfig, EvmAccountId, GenesisConfig, - GrandpaConfig, ImOnlineConfig, SessionConfig, Signature, SudoConfig, SystemConfig, - TokenClaimsConfig, WASM_BINARY, + EthereumAddress, EthereumChainIdConfig, EthereumConfig, EvmAccountId, FixedValidatorsSetConfig, + GenesisConfig, GrandpaConfig, ImOnlineConfig, SessionConfig, Signature, SudoConfig, + SystemConfig, TokenClaimsConfig, WASM_BINARY, }; use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use sc_chain_spec_derive::{ChainSpecExtension, ChainSpecGroup}; @@ -343,6 +343,9 @@ fn testnet_genesis( consumed_auth_ticket_nonces: BoundedVec::default(), active_authentications: BoundedVec::default(), }, + fixed_validators_set: FixedValidatorsSetConfig { + validators: BoundedVec::default(), + }, chain_properties: ChainPropertiesConfig { ss58_prefix: SS58_PREFIX, }, From 55902e4ba906d8a89fb60425969aaabbd91a1859 Mon Sep 17 00:00:00 2001 From: MOZGIII Date: Tue, 7 Oct 2025 09:14:58 +0400 Subject: [PATCH 05/11] Recompute the benches --- crates/humanode-runtime/assets/benchmark.json | 377 ++++++++++-------- .../src/weights/frame_system.rs | 22 +- crates/humanode-runtime/src/weights/mod.rs | 1 + .../src/weights/pallet_balances.rs | 16 +- .../src/weights/pallet_bioauth.rs | 20 +- .../weights/pallet_evm_accounts_mapping.rs | 4 +- .../weights/pallet_fixed_validators_set.rs | 22 + .../src/weights/pallet_humanode_session.rs | 10 +- .../src/weights/pallet_im_online.rs | 14 +- .../src/weights/pallet_multisig.rs | 40 +- .../src/weights/pallet_native_to_evm_swap.rs | 4 +- .../src/weights/pallet_sudo.rs | 8 +- .../src/weights/pallet_timestamp.rs | 2 +- .../src/weights/pallet_token_claims.rs | 8 +- .../src/weights/pallet_utility.rs | 10 +- .../src/weights/pallet_vesting.rs | 8 +- 16 files changed, 309 insertions(+), 257 deletions(-) create mode 100644 crates/humanode-runtime/src/weights/pallet_fixed_validators_set.rs diff --git a/crates/humanode-runtime/assets/benchmark.json b/crates/humanode-runtime/assets/benchmark.json index da8ce7b1c..48d2638ac 100644 --- a/crates/humanode-runtime/assets/benchmark.json +++ b/crates/humanode-runtime/assets/benchmark.json @@ -165,7 +165,7 @@ ] ], "extrinsic_time": 0, - "storage_root_time": 0, + "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -219,7 +219,7 @@ ] ], "extrinsic_time": 0, - "storage_root_time": 1000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -234,7 +234,7 @@ ] ], "extrinsic_time": 0, - "storage_root_time": 1000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -282,8 +282,8 @@ "time_results": [ { "components": [], - "extrinsic_time": 13775000, - "storage_root_time": 1000, + "extrinsic_time": 13786000, + "storage_root_time": 2000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -294,8 +294,8 @@ "db_results": [ { "components": [], - "extrinsic_time": 14298000, - "storage_root_time": 34000, + "extrinsic_time": 13608000, + "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -331,7 +331,7 @@ 100 ] ], - "extrinsic_time": 3747000, + "extrinsic_time": 3751000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -349,7 +349,7 @@ ] ], "extrinsic_time": 0, - "storage_root_time": 1000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -363,8 +363,8 @@ 100 ] ], - "extrinsic_time": 3752000, - "storage_root_time": 1000, + "extrinsic_time": 4047000, + "storage_root_time": 2000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -385,7 +385,7 @@ 0 ] ], - "extrinsic_time": 2000, + "extrinsic_time": 1000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -400,7 +400,7 @@ 3932160 ] ], - "extrinsic_time": 316000, + "extrinsic_time": 385000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -418,7 +418,7 @@ ] ], "extrinsic_time": 2000, - "storage_root_time": 1000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -432,8 +432,8 @@ 3932160 ] ], - "extrinsic_time": 315000, - "storage_root_time": 0, + "extrinsic_time": 424000, + "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -469,8 +469,8 @@ 3932160 ] ], - "extrinsic_time": 4392000, - "storage_root_time": 2000, + "extrinsic_time": 4080000, + "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -486,7 +486,7 @@ 0 ] ], - "extrinsic_time": 5000, + "extrinsic_time": 6000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -501,7 +501,7 @@ 3932160 ] ], - "extrinsic_time": 3882000, + "extrinsic_time": 4034000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -518,7 +518,7 @@ "time_results": [ { "components": [], - "extrinsic_time": 3000, + "extrinsic_time": 4000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -531,7 +531,7 @@ { "components": [], "extrinsic_time": 4000, - "storage_root_time": 0, + "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, "writes": 2, @@ -547,7 +547,7 @@ "time_results": [ { "components": [], - "extrinsic_time": 71462000, + "extrinsic_time": 70623000, "storage_root_time": 2000, "reads": 0, "repeat_reads": 0, @@ -559,8 +559,8 @@ "db_results": [ { "components": [], - "extrinsic_time": 70938000, - "storage_root_time": 2000, + "extrinsic_time": 73046000, + "storage_root_time": 4000, "reads": 1, "repeat_reads": 0, "writes": 2, @@ -596,8 +596,8 @@ 1000 ] ], - "extrinsic_time": 595000, - "storage_root_time": 0, + "extrinsic_time": 593000, + "storage_root_time": 2000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -628,7 +628,7 @@ 1000 ] ], - "extrinsic_time": 586000, + "extrinsic_time": 602000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -665,8 +665,8 @@ 1000 ] ], - "extrinsic_time": 635000, - "storage_root_time": 2000, + "extrinsic_time": 509000, + "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -697,7 +697,7 @@ 1000 ] ], - "extrinsic_time": 515000, + "extrinsic_time": 485000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -720,7 +720,7 @@ ] ], "extrinsic_time": 4000, - "storage_root_time": 1000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -734,7 +734,7 @@ 1000 ] ], - "extrinsic_time": 1126000, + "extrinsic_time": 1145000, "storage_root_time": 2000, "reads": 0, "repeat_reads": 0, @@ -757,7 +757,7 @@ "repeat_reads": 0, "writes": 0, "repeat_writes": 0, - "proof_size": 149 + "proof_size": 182 }, { "components": [ @@ -766,8 +766,8 @@ 1000 ] ], - "extrinsic_time": 1521000, - "storage_root_time": 1000, + "extrinsic_time": 1851000, + "storage_root_time": 3000, "reads": 1000, "repeat_reads": 0, "writes": 1000, @@ -803,7 +803,7 @@ 1 ] ], - "extrinsic_time": 77000, + "extrinsic_time": 78000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -820,8 +820,8 @@ 0 ] ], - "extrinsic_time": 78000, - "storage_root_time": 0, + "extrinsic_time": 81000, + "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -836,7 +836,7 @@ ] ], "extrinsic_time": 78000, - "storage_root_time": 1000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -852,7 +852,7 @@ "time_results": [ { "components": [], - "extrinsic_time": 35000, + "extrinsic_time": 37000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -864,7 +864,7 @@ "db_results": [ { "components": [], - "extrinsic_time": 47000, + "extrinsic_time": 46000, "storage_root_time": 1000, "reads": 2, "repeat_reads": 11, @@ -893,7 +893,7 @@ "db_results": [ { "components": [], - "extrinsic_time": 26000, + "extrinsic_time": 25000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 5, @@ -922,7 +922,7 @@ "db_results": [ { "components": [], - "extrinsic_time": 12000, + "extrinsic_time": 11000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 3, @@ -969,7 +969,7 @@ { "components": [], "extrinsic_time": 38000, - "storage_root_time": 0, + "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -980,7 +980,7 @@ "db_results": [ { "components": [], - "extrinsic_time": 48000, + "extrinsic_time": 50000, "storage_root_time": 1000, "reads": 3, "repeat_reads": 22, @@ -997,7 +997,7 @@ "time_results": [ { "components": [], - "extrinsic_time": 25000, + "extrinsic_time": 24000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1009,7 +1009,7 @@ "db_results": [ { "components": [], - "extrinsic_time": 32000, + "extrinsic_time": 31000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 5, @@ -1026,8 +1026,8 @@ "time_results": [ { "components": [], - "extrinsic_time": 10000, - "storage_root_time": 1000, + "extrinsic_time": 11000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -1060,7 +1060,7 @@ 1 ] ], - "extrinsic_time": 11000, + "extrinsic_time": 10000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1075,7 +1075,7 @@ 1000 ] ], - "extrinsic_time": 8072000, + "extrinsic_time": 7975000, "storage_root_time": 2000, "reads": 0, "repeat_reads": 0, @@ -1092,7 +1092,7 @@ 1 ] ], - "extrinsic_time": 13000, + "extrinsic_time": 12000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 2, @@ -1107,8 +1107,8 @@ 1000 ] ], - "extrinsic_time": 9916000, - "storage_root_time": 2000, + "extrinsic_time": 9957000, + "storage_root_time": 4000, "reads": 1000, "repeat_reads": 2000, "writes": 1000, @@ -1133,8 +1133,8 @@ 30719999 ] ], - "extrinsic_time": 3210608000, - "storage_root_time": 7000, + "extrinsic_time": 3682028000, + "storage_root_time": 8000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -1152,8 +1152,8 @@ 30719999 ] ], - "extrinsic_time": 3138216000, - "storage_root_time": 6000, + "extrinsic_time": 4262157000, + "storage_root_time": 7000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -1171,7 +1171,7 @@ 0 ] ], - "extrinsic_time": 119000, + "extrinsic_time": 123000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1190,8 +1190,8 @@ 30719999 ] ], - "extrinsic_time": 3428794000, - "storage_root_time": 8000, + "extrinsic_time": 3518236000, + "storage_root_time": 10000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -1211,8 +1211,8 @@ 30719999 ] ], - "extrinsic_time": 4110994000, - "storage_root_time": 7000, + "extrinsic_time": 4792308000, + "storage_root_time": 10000, "reads": 4, "repeat_reads": 0, "writes": 2, @@ -1230,8 +1230,8 @@ 30719999 ] ], - "extrinsic_time": 4316421000, - "storage_root_time": 7000, + "extrinsic_time": 4669606000, + "storage_root_time": 8000, "reads": 4, "repeat_reads": 0, "writes": 2, @@ -1249,7 +1249,7 @@ 0 ] ], - "extrinsic_time": 125000, + "extrinsic_time": 127000, "storage_root_time": 1000, "reads": 4, "repeat_reads": 0, @@ -1268,7 +1268,7 @@ 30719999 ] ], - "extrinsic_time": 4738035000, + "extrinsic_time": 5044279000, "storage_root_time": 7000, "reads": 4, "repeat_reads": 0, @@ -1290,7 +1290,7 @@ 0 ] ], - "extrinsic_time": 3000, + "extrinsic_time": 4000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1305,7 +1305,7 @@ 3072 ] ], - "extrinsic_time": 2000, + "extrinsic_time": 3000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1337,7 +1337,7 @@ 3072 ] ], - "extrinsic_time": 3000, + "extrinsic_time": 4000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1360,7 +1360,7 @@ ] ], "extrinsic_time": 6000, - "storage_root_time": 0, + "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -1374,7 +1374,7 @@ 3072 ] ], - "extrinsic_time": 97000, + "extrinsic_time": 99000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1391,7 +1391,7 @@ 0 ] ], - "extrinsic_time": 9000, + "extrinsic_time": 8000, "storage_root_time": 1000, "reads": 2, "repeat_reads": 1, @@ -1406,7 +1406,7 @@ 3072 ] ], - "extrinsic_time": 122000, + "extrinsic_time": 103000, "storage_root_time": 1000, "reads": 2, "repeat_reads": 0, @@ -1423,7 +1423,7 @@ "time_results": [ { "components": [], - "extrinsic_time": 52000, + "extrinsic_time": 54000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1435,7 +1435,7 @@ "db_results": [ { "components": [], - "extrinsic_time": 61000, + "extrinsic_time": 58000, "storage_root_time": 1000, "reads": 4, "repeat_reads": 0, @@ -1457,7 +1457,7 @@ 0 ] ], - "extrinsic_time": 75000, + "extrinsic_time": 76000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1489,7 +1489,7 @@ 0 ] ], - "extrinsic_time": 75000, + "extrinsic_time": 77000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1521,7 +1521,7 @@ "time_results": [ { "components": [], - "extrinsic_time": 2000, + "extrinsic_time": 3000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1559,7 +1559,7 @@ 100 ] ], - "extrinsic_time": 83000, + "extrinsic_time": 86000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1578,7 +1578,7 @@ 100 ] ], - "extrinsic_time": 154000, + "extrinsic_time": 118000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1597,7 +1597,7 @@ 1 ] ], - "extrinsic_time": 110000, + "extrinsic_time": 94000, "storage_root_time": 2000, "reads": 0, "repeat_reads": 0, @@ -1616,8 +1616,8 @@ 100 ] ], - "extrinsic_time": 124000, - "storage_root_time": 2000, + "extrinsic_time": 146000, + "storage_root_time": 3000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -1637,7 +1637,7 @@ 100 ] ], - "extrinsic_time": 90000, + "extrinsic_time": 163000, "storage_root_time": 1000, "reads": 5, "repeat_reads": 4, @@ -1656,8 +1656,8 @@ 100 ] ], - "extrinsic_time": 221000, - "storage_root_time": 3000, + "extrinsic_time": 146000, + "storage_root_time": 2000, "reads": 4, "repeat_reads": 2, "writes": 1, @@ -1675,7 +1675,7 @@ 1 ] ], - "extrinsic_time": 134000, + "extrinsic_time": 112000, "storage_root_time": 2000, "reads": 4, "repeat_reads": 2, @@ -1694,7 +1694,7 @@ 100 ] ], - "extrinsic_time": 171000, + "extrinsic_time": 155000, "storage_root_time": 2000, "reads": 4, "repeat_reads": 2, @@ -1748,7 +1748,7 @@ 0 ] ], - "extrinsic_time": 10000, + "extrinsic_time": 9000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1763,7 +1763,7 @@ 10000 ] ], - "extrinsic_time": 10000, + "extrinsic_time": 9000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1789,7 +1789,7 @@ 10000 ] ], - "extrinsic_time": 31000, + "extrinsic_time": 30000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1809,7 +1809,7 @@ ] ], "extrinsic_time": 34000, - "storage_root_time": 1000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -1827,7 +1827,7 @@ 0 ] ], - "extrinsic_time": 24000, + "extrinsic_time": 27000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1846,7 +1846,7 @@ 10000 ] ], - "extrinsic_time": 35000, + "extrinsic_time": 34000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1867,7 +1867,7 @@ 10000 ] ], - "extrinsic_time": 41000, + "extrinsic_time": 36000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, @@ -1886,7 +1886,7 @@ 10000 ] ], - "extrinsic_time": 47000, + "extrinsic_time": 40000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, @@ -1905,8 +1905,8 @@ 0 ] ], - "extrinsic_time": 30000, - "storage_root_time": 1000, + "extrinsic_time": 59000, + "storage_root_time": 3000, "reads": 1, "repeat_reads": 0, "writes": 1, @@ -1924,7 +1924,7 @@ 10000 ] ], - "extrinsic_time": 40000, + "extrinsic_time": 41000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, @@ -1950,7 +1950,7 @@ 10000 ] ], - "extrinsic_time": 23000, + "extrinsic_time": 24000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -1969,7 +1969,7 @@ 10000 ] ], - "extrinsic_time": 27000, + "extrinsic_time": 28000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2008,7 +2008,7 @@ ] ], "extrinsic_time": 27000, - "storage_root_time": 1000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -2047,8 +2047,8 @@ 10000 ] ], - "extrinsic_time": 31000, - "storage_root_time": 1000, + "extrinsic_time": 45000, + "storage_root_time": 2000, "reads": 1, "repeat_reads": 0, "writes": 1, @@ -2066,7 +2066,7 @@ 0 ] ], - "extrinsic_time": 20000, + "extrinsic_time": 21000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, @@ -2085,7 +2085,7 @@ 10000 ] ], - "extrinsic_time": 30000, + "extrinsic_time": 31000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, @@ -2111,7 +2111,7 @@ 10000 ] ], - "extrinsic_time": 33000, + "extrinsic_time": 32000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2130,7 +2130,7 @@ 10000 ] ], - "extrinsic_time": 53000, + "extrinsic_time": 39000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2149,7 +2149,7 @@ 0 ] ], - "extrinsic_time": 28000, + "extrinsic_time": 29000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2168,8 +2168,8 @@ 10000 ] ], - "extrinsic_time": 42000, - "storage_root_time": 1000, + "extrinsic_time": 43000, + "storage_root_time": 2000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -2208,7 +2208,7 @@ 10000 ] ], - "extrinsic_time": 45000, + "extrinsic_time": 47000, "storage_root_time": 1000, "reads": 2, "repeat_reads": 3, @@ -2227,7 +2227,7 @@ 0 ] ], - "extrinsic_time": 39000, + "extrinsic_time": 37000, "storage_root_time": 1000, "reads": 2, "repeat_reads": 3, @@ -2246,8 +2246,8 @@ 10000 ] ], - "extrinsic_time": 61000, - "storage_root_time": 2000, + "extrinsic_time": 47000, + "storage_root_time": 1000, "reads": 2, "repeat_reads": 3, "writes": 2, @@ -2315,8 +2315,8 @@ 128 ] ], - "extrinsic_time": 30000, - "storage_root_time": 1000, + "extrinsic_time": 37000, + "storage_root_time": 2000, "reads": 1, "repeat_reads": 0, "writes": 1, @@ -2352,7 +2352,7 @@ 128 ] ], - "extrinsic_time": 16000, + "extrinsic_time": 17000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2369,7 +2369,7 @@ 2 ] ], - "extrinsic_time": 16000, + "extrinsic_time": 15000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, @@ -2384,7 +2384,7 @@ 128 ] ], - "extrinsic_time": 20000, + "extrinsic_time": 19000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, @@ -2407,7 +2407,7 @@ ] ], "extrinsic_time": 21000, - "storage_root_time": 1000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -2438,7 +2438,7 @@ 2 ] ], - "extrinsic_time": 26000, + "extrinsic_time": 25000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, @@ -2453,7 +2453,7 @@ 128 ] ], - "extrinsic_time": 32000, + "extrinsic_time": 31000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, @@ -2482,8 +2482,8 @@ "db_results": [ { "components": [], - "extrinsic_time": 13000, - "storage_root_time": 1000, + "extrinsic_time": 12000, + "storage_root_time": 0, "reads": 1, "repeat_reads": 1, "writes": 1, @@ -2499,7 +2499,7 @@ "time_results": [ { "components": [], - "extrinsic_time": 9000, + "extrinsic_time": 10000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2511,7 +2511,7 @@ "db_results": [ { "components": [], - "extrinsic_time": 12000, + "extrinsic_time": 15000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, @@ -2528,7 +2528,7 @@ "time_results": [ { "components": [], - "extrinsic_time": 9000, + "extrinsic_time": 10000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2540,7 +2540,7 @@ "db_results": [ { "components": [], - "extrinsic_time": 12000, + "extrinsic_time": 17000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, @@ -2558,7 +2558,7 @@ { "components": [], "extrinsic_time": 9000, - "storage_root_time": 1000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -2575,7 +2575,7 @@ "repeat_reads": 0, "writes": 1, "repeat_writes": 0, - "proof_size": 278 + "proof_size": 311 } ] }, @@ -2587,7 +2587,7 @@ { "components": [], "extrinsic_time": 4000, - "storage_root_time": 0, + "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -2615,7 +2615,7 @@ "time_results": [ { "components": [], - "extrinsic_time": 87000, + "extrinsic_time": 84000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2627,7 +2627,7 @@ "db_results": [ { "components": [], - "extrinsic_time": 101000, + "extrinsic_time": 98000, "storage_root_time": 1000, "reads": 9, "repeat_reads": 8, @@ -2645,7 +2645,7 @@ { "components": [], "extrinsic_time": 26000, - "storage_root_time": 1000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -2656,7 +2656,7 @@ "db_results": [ { "components": [], - "extrinsic_time": 31000, + "extrinsic_time": 32000, "storage_root_time": 1000, "reads": 3, "repeat_reads": 7, @@ -2674,7 +2674,7 @@ { "components": [], "extrinsic_time": 25000, - "storage_root_time": 0, + "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -2702,7 +2702,7 @@ "time_results": [ { "components": [], - "extrinsic_time": 26000, + "extrinsic_time": 25000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2714,7 +2714,7 @@ "db_results": [ { "components": [], - "extrinsic_time": 32000, + "extrinsic_time": 31000, "storage_root_time": 1000, "reads": 3, "repeat_reads": 7, @@ -2751,7 +2751,7 @@ 1000 ] ], - "extrinsic_time": 2018000, + "extrinsic_time": 1827000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2768,7 +2768,7 @@ 0 ] ], - "extrinsic_time": 4000, + "extrinsic_time": 5000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2783,7 +2783,7 @@ 1000 ] ], - "extrinsic_time": 2293000, + "extrinsic_time": 2159000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2813,7 +2813,7 @@ { "components": [], "extrinsic_time": 4000, - "storage_root_time": 1000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -2834,7 +2834,7 @@ 0 ] ], - "extrinsic_time": 4000, + "extrinsic_time": 3000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2849,7 +2849,7 @@ 1000 ] ], - "extrinsic_time": 2029000, + "extrinsic_time": 1949000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2881,7 +2881,7 @@ 1000 ] ], - "extrinsic_time": 2691000, + "extrinsic_time": 2372000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2899,7 +2899,7 @@ { "components": [], "extrinsic_time": 5000, - "storage_root_time": 0, + "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -2932,7 +2932,7 @@ 0 ] ], - "extrinsic_time": 3000, + "extrinsic_time": 4000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2947,7 +2947,7 @@ 1000 ] ], - "extrinsic_time": 2009000, + "extrinsic_time": 1798000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2964,7 +2964,7 @@ 0 ] ], - "extrinsic_time": 5000, + "extrinsic_time": 4000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -2979,8 +2979,8 @@ 1000 ] ], - "extrinsic_time": 2251000, - "storage_root_time": 1000, + "extrinsic_time": 2261000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -2996,8 +2996,8 @@ "time_results": [ { "components": [], - "extrinsic_time": 35000, - "storage_root_time": 1000, + "extrinsic_time": 29000, + "storage_root_time": 0, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -3008,7 +3008,7 @@ "db_results": [ { "components": [], - "extrinsic_time": 40000, + "extrinsic_time": 39000, "storage_root_time": 1000, "reads": 6, "repeat_reads": 3, @@ -3025,7 +3025,7 @@ "time_results": [ { "components": [], - "extrinsic_time": 31000, + "extrinsic_time": 30000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -3074,7 +3074,7 @@ 3071 ] ], - "extrinsic_time": 95000, + "extrinsic_time": 116000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -3091,13 +3091,13 @@ 0 ] ], - "extrinsic_time": 14000, + "extrinsic_time": 13000, "storage_root_time": 1000, "reads": 2, "repeat_reads": 0, "writes": 1, "repeat_writes": 0, - "proof_size": 233 + "proof_size": 266 }, { "components": [ @@ -3106,13 +3106,13 @@ 3071 ] ], - "extrinsic_time": 103000, + "extrinsic_time": 126000, "storage_root_time": 1000, "reads": 2, "repeat_reads": 0, "writes": 1, "repeat_writes": 0, - "proof_size": 98512 + "proof_size": 98545 } ] }, @@ -3128,8 +3128,8 @@ 1 ] ], - "extrinsic_time": 7000, - "storage_root_time": 0, + "extrinsic_time": 8000, + "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -3143,7 +3143,7 @@ 3072 ] ], - "extrinsic_time": 92000, + "extrinsic_time": 90000, "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, @@ -3160,13 +3160,13 @@ 1 ] ], - "extrinsic_time": 10000, + "extrinsic_time": 11000, "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, "writes": 1, "repeat_writes": 0, - "proof_size": 204 + "proof_size": 237 }, { "components": [ @@ -3175,13 +3175,13 @@ 3072 ] ], - "extrinsic_time": 96000, - "storage_root_time": 2000, + "extrinsic_time": 99000, + "storage_root_time": 1000, "reads": 1, "repeat_reads": 0, "writes": 1, "repeat_writes": 0, - "proof_size": 98480 + "proof_size": 98513 } ] }, @@ -3221,8 +3221,8 @@ "time_results": [ { "components": [], - "extrinsic_time": 70000, - "storage_root_time": 0, + "extrinsic_time": 71000, + "storage_root_time": 1000, "reads": 0, "repeat_reads": 0, "writes": 0, @@ -3233,7 +3233,7 @@ "db_results": [ { "components": [], - "extrinsic_time": 93000, + "extrinsic_time": 90000, "storage_root_time": 1000, "reads": 10, "repeat_reads": 27, @@ -3242,5 +3242,34 @@ "proof_size": 995 } ] + }, + { + "pallet": "pallet_fixed_validators_set", + "instance": "FixedValidatorsSet", + "benchmark": "update_set", + "time_results": [ + { + "components": [], + "extrinsic_time": 33000, + "storage_root_time": 1000, + "reads": 0, + "repeat_reads": 0, + "writes": 0, + "repeat_writes": 0, + "proof_size": 0 + } + ], + "db_results": [ + { + "components": [], + "extrinsic_time": 34000, + "storage_root_time": 1000, + "reads": 0, + "repeat_reads": 0, + "writes": 1, + "repeat_writes": 0, + "proof_size": 0 + } + ] } ] \ No newline at end of file diff --git a/crates/humanode-runtime/src/weights/frame_system.rs b/crates/humanode-runtime/src/weights/frame_system.rs index 0dee6b14d..ac0e18494 100644 --- a/crates/humanode-runtime/src/weights/frame_system.rs +++ b/crates/humanode-runtime/src/weights/frame_system.rs @@ -16,8 +16,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(316_000_000, 0) + // Minimum execution time: 1_000_000 picoseconds. + Weight::from_parts(385_000_000, 0) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event(_b: u32, ) -> Weight { @@ -25,14 +25,14 @@ impl frame_system::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(4_392_000_000, 0) + Weight::from_parts(4_080_000_000, 0) } fn set_heap_pages() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -40,8 +40,8 @@ impl frame_system::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 71_462_000_000 picoseconds. - Weight::from_parts(71_462_000_000, 0) + // Minimum execution time: 70_623_000_000 picoseconds. + Weight::from_parts(70_623_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -51,7 +51,7 @@ impl frame_system::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(595_000_000, 0) + Weight::from_parts(593_000_000, 0) .saturating_add(T::DbWeight::get().writes(1000)) } /// The range of component `i` is `[0, 1000]`. @@ -60,16 +60,16 @@ impl frame_system::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(635_000_000, 0) + Weight::from_parts(509_000_000, 0) .saturating_add(T::DbWeight::get().writes(1000)) } /// The range of component `p` is `[0, 1000]`. fn kill_prefix(_p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `149 + p * (69 ±0)` + // Measured: `182 + p * (69 ±0)` // Estimated: `0` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(1_126_000_000, 0) + Weight::from_parts(1_145_000_000, 0) .saturating_add(T::DbWeight::get().reads(1000)) .saturating_add(T::DbWeight::get().writes(1000)) } diff --git a/crates/humanode-runtime/src/weights/mod.rs b/crates/humanode-runtime/src/weights/mod.rs index a6ab246ef..ba3a07cf5 100644 --- a/crates/humanode-runtime/src/weights/mod.rs +++ b/crates/humanode-runtime/src/weights/mod.rs @@ -6,6 +6,7 @@ pub mod frame_system; pub mod pallet_balances; pub mod pallet_bioauth; pub mod pallet_evm_accounts_mapping; +pub mod pallet_fixed_validators_set; pub mod pallet_humanode_session; pub mod pallet_im_online; pub mod pallet_multisig; diff --git a/crates/humanode-runtime/src/weights/pallet_balances.rs b/crates/humanode-runtime/src/weights/pallet_balances.rs index 2bf54734f..1b3f4add3 100644 --- a/crates/humanode-runtime/src/weights/pallet_balances.rs +++ b/crates/humanode-runtime/src/weights/pallet_balances.rs @@ -15,8 +15,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `0` - // Minimum execution time: 35_000_000 picoseconds. - Weight::from_parts(35_000_000, 0) + // Minimum execution time: 37_000_000 picoseconds. + Weight::from_parts(37_000_000, 0) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -60,8 +60,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 25_000_000 picoseconds. - Weight::from_parts(25_000_000, 0) + // Minimum execution time: 24_000_000 picoseconds. + Weight::from_parts(24_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -69,8 +69,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `103` // Estimated: `0` - // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(10_000_000, 0) + // Minimum execution time: 11_000_000 picoseconds. + Weight::from_parts(11_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -79,8 +79,8 @@ impl pallet_balances::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0 + u * (135 ±0)` // Estimated: `0` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(8_072_000_000, 0) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(7_975_000_000, 0) .saturating_add(T::DbWeight::get().reads(1000)) .saturating_add(T::DbWeight::get().writes(1000)) } diff --git a/crates/humanode-runtime/src/weights/pallet_bioauth.rs b/crates/humanode-runtime/src/weights/pallet_bioauth.rs index afe72ff60..34807ef90 100644 --- a/crates/humanode-runtime/src/weights/pallet_bioauth.rs +++ b/crates/humanode-runtime/src/weights/pallet_bioauth.rs @@ -11,18 +11,18 @@ use sp_std::marker::PhantomData; /// Weight functions for `pallet_bioauth`. pub struct WeightInfo(PhantomData); impl pallet_bioauth::WeightInfo for WeightInfo { - /// The range of component `a` is `[0, 3071]`. /// The range of component `n` is `[0, 30719999]`. + /// The range of component `a` is `[0, 3071]`. fn authenticate(a: u32, n: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `183 + a * (40 ±0) + n * (19 ±0)` // Estimated: `0` - // Minimum execution time: 119_000_000 picoseconds. - Weight::from_parts(119_000_000, 0) - // Standard Error: 37_557_371 - .saturating_add(Weight::from_parts(9_494_887, 0).saturating_mul(a.into())) - // Standard Error: 3_754 - .saturating_add(Weight::from_parts(105_457, 0).saturating_mul(n.into())) + // Minimum execution time: 123_000_000 picoseconds. + Weight::from_parts(123_000_000, 0) + // Standard Error: 96_713_286 + .saturating_add(Weight::from_parts(27_114_099, 0).saturating_mul(a.into())) + // Standard Error: 9_668 + .saturating_add(Weight::from_parts(122_564, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -31,8 +31,8 @@ impl pallet_bioauth::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 2_000_000 picoseconds. - Weight::from_parts(3_000_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(4_000_000, 0) .saturating_add(T::DbWeight::get().writes(2)) } /// The range of component `a` is `[0, 3072]`. @@ -41,7 +41,7 @@ impl pallet_bioauth::WeightInfo for WeightInfo { // Measured: `141 + a * (40 ±0)` // Estimated: `0` // Minimum execution time: 6_000_000 picoseconds. - Weight::from_parts(97_000_000, 0) + Weight::from_parts(99_000_000, 0) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/crates/humanode-runtime/src/weights/pallet_evm_accounts_mapping.rs b/crates/humanode-runtime/src/weights/pallet_evm_accounts_mapping.rs index 9e601c29a..771936ad0 100644 --- a/crates/humanode-runtime/src/weights/pallet_evm_accounts_mapping.rs +++ b/crates/humanode-runtime/src/weights/pallet_evm_accounts_mapping.rs @@ -15,8 +15,8 @@ impl pallet_evm_accounts_mapping::WeightInfo for Weight // Proof Size summary in bytes: // Measured: `132` // Estimated: `0` - // Minimum execution time: 52_000_000 picoseconds. - Weight::from_parts(52_000_000, 0) + // Minimum execution time: 54_000_000 picoseconds. + Weight::from_parts(54_000_000, 0) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/crates/humanode-runtime/src/weights/pallet_fixed_validators_set.rs b/crates/humanode-runtime/src/weights/pallet_fixed_validators_set.rs new file mode 100644 index 000000000..d13b264ff --- /dev/null +++ b/crates/humanode-runtime/src/weights/pallet_fixed_validators_set.rs @@ -0,0 +1,22 @@ +// DO NOT EDIT! +//! Autogenerated weights for `pallet_fixed_validators_set` + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_fixed_validators_set`. +pub struct WeightInfo(PhantomData); +impl pallet_fixed_validators_set::WeightInfo for WeightInfo { + fn update_set() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 33_000_000 picoseconds. + Weight::from_parts(33_000_000, 0) + .saturating_add(T::DbWeight::get().writes(1)) + } +} diff --git a/crates/humanode-runtime/src/weights/pallet_humanode_session.rs b/crates/humanode-runtime/src/weights/pallet_humanode_session.rs index 735fe4bac..3bc947ab1 100644 --- a/crates/humanode-runtime/src/weights/pallet_humanode_session.rs +++ b/crates/humanode-runtime/src/weights/pallet_humanode_session.rs @@ -14,20 +14,20 @@ impl pallet_humanode_session::WeightInfo for WeightInfo /// The range of component `b` is `[0, 3071]`. fn ban(_b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `233 + b * (32 ±0)` + // Measured: `266 + b * (32 ±0)` // Estimated: `0` // Minimum execution time: 10_000_000 picoseconds. - Weight::from_parts(95_000_000, 0) + Weight::from_parts(116_000_000, 0) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } /// The range of component `b` is `[1, 3072]`. fn unban(_b: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `171 + b * (32 ±0)` + // Measured: `204 + b * (32 ±0)` // Estimated: `0` - // Minimum execution time: 7_000_000 picoseconds. - Weight::from_parts(92_000_000, 0) + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(90_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/crates/humanode-runtime/src/weights/pallet_im_online.rs b/crates/humanode-runtime/src/weights/pallet_im_online.rs index 221c4bfdf..d99a3b696 100644 --- a/crates/humanode-runtime/src/weights/pallet_im_online.rs +++ b/crates/humanode-runtime/src/weights/pallet_im_online.rs @@ -11,18 +11,18 @@ use sp_std::marker::PhantomData; /// Weight functions for `pallet_im_online`. pub struct WeightInfo(PhantomData); impl pallet_im_online::WeightInfo for WeightInfo { - /// The range of component `k` is `[1, 1000]`. /// The range of component `e` is `[1, 100]`. + /// The range of component `k` is `[1, 1000]`. fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `260 + k * (32 ±0)` // Estimated: `0` - // Minimum execution time: 83_000_000 picoseconds. - Weight::from_parts(53_651_014, 0) - // Standard Error: 26_006 - .saturating_add(Weight::from_parts(56_056, 0).saturating_mul(k.into())) - // Standard Error: 262_431 - .saturating_add(Weight::from_parts(292_929, 0).saturating_mul(e.into())) + // Minimum execution time: 86_000_000 picoseconds. + Weight::from_parts(47_570_115, 0) + // Standard Error: 24_272 + .saturating_add(Weight::from_parts(46_046, 0).saturating_mul(k.into())) + // Standard Error: 244_936 + .saturating_add(Weight::from_parts(383_838, 0).saturating_mul(e.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/crates/humanode-runtime/src/weights/pallet_multisig.rs b/crates/humanode-runtime/src/weights/pallet_multisig.rs index 6d7c23f9c..2560c72fb 100644 --- a/crates/humanode-runtime/src/weights/pallet_multisig.rs +++ b/crates/humanode-runtime/src/weights/pallet_multisig.rs @@ -25,42 +25,42 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `138 + s * (3 ±0)` // Estimated: `0` - // Minimum execution time: 24_000_000 picoseconds. - Weight::from_parts(20_444_444, 0) - // Standard Error: 6_873 - .saturating_add(Weight::from_parts(27_777, 0).saturating_mul(s.into())) - // Standard Error: 86 - .saturating_add(Weight::from_parts(1_050, 0).saturating_mul(z.into())) + // Minimum execution time: 27_000_000 picoseconds. + Weight::from_parts(22_936_507, 0) + // Standard Error: 0 + .saturating_add(Weight::from_parts(31_746, 0).saturating_mul(s.into())) + // Standard Error: 0 + .saturating_add(Weight::from_parts(700, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// The range of component `s` is `[3, 128]`. /// The range of component `z` is `[0, 10000]`. + /// The range of component `s` is `[3, 128]`. fn as_multi_approve(s: u32, z: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `248` // Estimated: `0` // Minimum execution time: 17_000_000 picoseconds. - Weight::from_parts(12_904_000, 0) - // Standard Error: 0 - .saturating_add(Weight::from_parts(32_000, 0).saturating_mul(s.into())) - // Standard Error: 0 - .saturating_add(Weight::from_parts(1_000, 0).saturating_mul(z.into())) + Weight::from_parts(13_416_000, 0) + // Standard Error: 6_928 + .saturating_add(Weight::from_parts(28_000, 0).saturating_mul(s.into())) + // Standard Error: 86 + .saturating_add(Weight::from_parts(1_050, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// The range of component `z` is `[0, 10000]`. /// The range of component `s` is `[2, 128]`. + /// The range of component `z` is `[0, 10000]`. fn as_multi_complete(s: u32, z: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `281 + s * (34 ±0)` // Estimated: `0` - // Minimum execution time: 28_000_000 picoseconds. - Weight::from_parts(13_269_841, 0) - // Standard Error: 75_605 - .saturating_add(Weight::from_parts(115_079, 0).saturating_mul(s.into())) - // Standard Error: 952 - .saturating_add(Weight::from_parts(1_950, 0).saturating_mul(z.into())) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(19_857_142, 0) + // Standard Error: 27_492 + .saturating_add(Weight::from_parts(71_428, 0).saturating_mul(s.into())) + // Standard Error: 346 + .saturating_add(Weight::from_parts(1_200, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } @@ -80,7 +80,7 @@ impl pallet_multisig::WeightInfo for WeightInfo { // Measured: `248` // Estimated: `0` // Minimum execution time: 12_000_000 picoseconds. - Weight::from_parts(16_000_000, 0) + Weight::from_parts(17_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/crates/humanode-runtime/src/weights/pallet_native_to_evm_swap.rs b/crates/humanode-runtime/src/weights/pallet_native_to_evm_swap.rs index 7aa686702..6d0b6aa41 100644 --- a/crates/humanode-runtime/src/weights/pallet_native_to_evm_swap.rs +++ b/crates/humanode-runtime/src/weights/pallet_native_to_evm_swap.rs @@ -24,8 +24,8 @@ impl pallet_native_to_evm_swap::WeightInfo for WeightIn // Proof Size summary in bytes: // Measured: `995` // Estimated: `0` - // Minimum execution time: 70_000_000 picoseconds. - Weight::from_parts(70_000_000, 0) + // Minimum execution time: 71_000_000 picoseconds. + Weight::from_parts(71_000_000, 0) .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(5)) } diff --git a/crates/humanode-runtime/src/weights/pallet_sudo.rs b/crates/humanode-runtime/src/weights/pallet_sudo.rs index c4e2d1283..7dfc60537 100644 --- a/crates/humanode-runtime/src/weights/pallet_sudo.rs +++ b/crates/humanode-runtime/src/weights/pallet_sudo.rs @@ -24,16 +24,16 @@ impl pallet_sudo::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `132` // Estimated: `0` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) } fn sudo_as() -> Weight { // Proof Size summary in bytes: // Measured: `132` // Estimated: `0` - // Minimum execution time: 9_000_000 picoseconds. - Weight::from_parts(9_000_000, 0) + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(10_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) } } diff --git a/crates/humanode-runtime/src/weights/pallet_timestamp.rs b/crates/humanode-runtime/src/weights/pallet_timestamp.rs index 172b19fc4..99d3e57f4 100644 --- a/crates/humanode-runtime/src/weights/pallet_timestamp.rs +++ b/crates/humanode-runtime/src/weights/pallet_timestamp.rs @@ -13,7 +13,7 @@ pub struct WeightInfo(PhantomData); impl pallet_timestamp::WeightInfo for WeightInfo { fn set() -> Weight { // Proof Size summary in bytes: - // Measured: `278` + // Measured: `311` // Estimated: `0` // Minimum execution time: 9_000_000 picoseconds. Weight::from_parts(9_000_000, 0) diff --git a/crates/humanode-runtime/src/weights/pallet_token_claims.rs b/crates/humanode-runtime/src/weights/pallet_token_claims.rs index f99a5dd9d..995331b32 100644 --- a/crates/humanode-runtime/src/weights/pallet_token_claims.rs +++ b/crates/humanode-runtime/src/weights/pallet_token_claims.rs @@ -15,8 +15,8 @@ impl pallet_token_claims::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `593` // Estimated: `0` - // Minimum execution time: 87_000_000 picoseconds. - Weight::from_parts(87_000_000, 0) + // Minimum execution time: 84_000_000 picoseconds. + Weight::from_parts(84_000_000, 0) .saturating_add(T::DbWeight::get().reads(9)) .saturating_add(T::DbWeight::get().writes(5)) } @@ -42,8 +42,8 @@ impl pallet_token_claims::WeightInfo for WeightInfo // Proof Size summary in bytes: // Measured: `264` // Estimated: `0` - // Minimum execution time: 26_000_000 picoseconds. - Weight::from_parts(26_000_000, 0) + // Minimum execution time: 25_000_000 picoseconds. + Weight::from_parts(25_000_000, 0) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) } diff --git a/crates/humanode-runtime/src/weights/pallet_utility.rs b/crates/humanode-runtime/src/weights/pallet_utility.rs index f81ee4aa4..78012fc92 100644 --- a/crates/humanode-runtime/src/weights/pallet_utility.rs +++ b/crates/humanode-runtime/src/weights/pallet_utility.rs @@ -17,7 +17,7 @@ impl pallet_utility::WeightInfo for WeightInfo { // Measured: `0` // Estimated: `0` // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(2_018_000_000, 0) + Weight::from_parts(1_827_000_000, 0) } fn as_derivative() -> Weight { // Proof Size summary in bytes: @@ -31,8 +31,8 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 4_000_000 picoseconds. - Weight::from_parts(2_029_000_000, 0) + // Minimum execution time: 3_000_000 picoseconds. + Weight::from_parts(1_949_000_000, 0) } fn dispatch_as() -> Weight { // Proof Size summary in bytes: @@ -46,7 +46,7 @@ impl pallet_utility::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 3_000_000 picoseconds. - Weight::from_parts(2_009_000_000, 0) + // Minimum execution time: 4_000_000 picoseconds. + Weight::from_parts(1_798_000_000, 0) } } diff --git a/crates/humanode-runtime/src/weights/pallet_vesting.rs b/crates/humanode-runtime/src/weights/pallet_vesting.rs index ec26eb73e..f1788e369 100644 --- a/crates/humanode-runtime/src/weights/pallet_vesting.rs +++ b/crates/humanode-runtime/src/weights/pallet_vesting.rs @@ -15,8 +15,8 @@ impl pallet_vesting::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `488` // Estimated: `0` - // Minimum execution time: 35_000_000 picoseconds. - Weight::from_parts(35_000_000, 0) + // Minimum execution time: 29_000_000 picoseconds. + Weight::from_parts(29_000_000, 0) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } @@ -24,8 +24,8 @@ impl pallet_vesting::WeightInfo for WeightInfo { // Proof Size summary in bytes: // Measured: `488` // Estimated: `0` - // Minimum execution time: 31_000_000 picoseconds. - Weight::from_parts(31_000_000, 0) + // Minimum execution time: 30_000_000 picoseconds. + Weight::from_parts(30_000_000, 0) .saturating_add(T::DbWeight::get().reads(6)) .saturating_add(T::DbWeight::get().writes(3)) } From 2d94a87cab9c9911c279b1532cfdbb6d6616bdde Mon Sep 17 00:00:00 2001 From: MOZGIII Date: Tue, 7 Oct 2025 09:36:14 +0400 Subject: [PATCH 06/11] Use computed benches --- crates/humanode-runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/humanode-runtime/src/lib.rs b/crates/humanode-runtime/src/lib.rs index 1abe97893..52b8b4739 100644 --- a/crates/humanode-runtime/src/lib.rs +++ b/crates/humanode-runtime/src/lib.rs @@ -567,7 +567,7 @@ impl pallet_fixed_validators_set::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ValidatorId = AccountId; type MaxValidators = ConstU32; /* same amount in theory */ - type WeightInfo = (); // TODO: bench + type WeightInfo = weights::pallet_fixed_validators_set::WeightInfo; } impl pallet_humanode_session::Config for Runtime { From 140c17efda641efb08df82e19e80ea11dde77716 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov <39522748+dmitrylavrenov@users.noreply.github.com> Date: Tue, 7 Oct 2025 23:10:46 +0300 Subject: [PATCH 07/11] Add more checks to verify slashing logic at a corresponding runtime test (#1620) Add more checks to verify slashin logic at a corresponding runtime test --- .../src/tests/offence_handler.rs | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/crates/humanode-runtime/src/tests/offence_handler.rs b/crates/humanode-runtime/src/tests/offence_handler.rs index 29aee19c1..afaae49bc 100644 --- a/crates/humanode-runtime/src/tests/offence_handler.rs +++ b/crates/humanode-runtime/src/tests/offence_handler.rs @@ -15,8 +15,13 @@ const INIT_BALANCE: u128 = 10u128.pow(18 + 6); /// Build test externalities from the custom genesis. /// Using this call requires manual assertions on the genesis init logic. fn new_test_ext_with() -> sp_io::TestExternalities { - let authorities = [authority_keys("Alice"), authority_keys("Bioauth-1")]; + let authorities = [ + authority_keys("Alice"), + authority_keys("Bioauth-1"), + authority_keys("FixedValidatorsSet-1"), + ]; let bootnodes = vec![account_id("Alice")]; + let fixed_validators_set = vec![account_id("FixedValidatorsSet-1")]; let endowed_accounts = [account_id("Alice"), account_id("Bob")]; let pot_accounts = vec![FeesPot::account_id()]; @@ -78,6 +83,9 @@ fn new_test_ext_with() -> sp_io::TestExternalities { .unwrap(), ..Default::default() }, + fixed_validators_set: FixedValidatorsSetConfig { + validators: fixed_validators_set.try_into().unwrap(), + }, evm: EVMConfig { accounts: { let init_genesis_account = fp_evm::GenesisAccount { @@ -118,6 +126,7 @@ fn works() { // Build the state from the config. new_test_ext_with().execute_with(move || { // Check test preconditions. + assert_eq!(Bootnodes::bootnodes(), vec![account_id("Alice")]); assert_eq!( Bioauth::active_authentications(), vec![pallet_bioauth::Authentication { @@ -125,6 +134,10 @@ fn works() { expires_at: 1000, }] ); + assert_eq!( + FixedValidatorsSet::validators(), + vec![account_id("FixedValidatorsSet-1")] + ); // Report unresponsiveness offence. HumanodeOffences::report_offence( @@ -146,6 +159,11 @@ fn works() { .unwrap(); // Assert state changes. + assert_eq!(Bootnodes::bootnodes(), vec![account_id("Alice")]); assert!(Bioauth::active_authentications().is_empty()); + assert_eq!( + FixedValidatorsSet::validators(), + vec![account_id("FixedValidatorsSet-1")] + ); }) } From cc43cebc99511d522cdcf96d0ca09d736b020842 Mon Sep 17 00:00:00 2001 From: MOZGIII Date: Wed, 8 Oct 2025 00:35:17 +0400 Subject: [PATCH 08/11] Adjust the preexisting tests to include fixed validators set --- crates/pallet-humanode-session/src/mock.rs | 8 ++++- crates/pallet-humanode-session/src/tests.rs | 40 ++++++++++++++++----- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/crates/pallet-humanode-session/src/mock.rs b/crates/pallet-humanode-session/src/mock.rs index 64f981a88..436bb0752 100644 --- a/crates/pallet-humanode-session/src/mock.rs +++ b/crates/pallet-humanode-session/src/mock.rs @@ -231,11 +231,14 @@ pub fn new_test_ext() -> sp_io::TestExternalities { let genesis_config = GenesisConfig { session: pallet_session::GenesisConfig { keys: vec![ + // Bootnodes. (42, 42, sp_runtime::testing::UintAuthorityId(42)), (43, 43, sp_runtime::testing::UintAuthorityId(43)), (44, 44, sp_runtime::testing::UintAuthorityId(44)), - // Not bootnode. + // Bioauth. (1, 1, sp_runtime::testing::UintAuthorityId(1)), + // Fixed Validators Set. + (10_001, 10_001, sp_runtime::testing::UintAuthorityId(10_001)), ], }, bootnodes: pallet_bootnodes::GenesisConfig { @@ -249,6 +252,9 @@ pub fn new_test_ext() -> sp_io::TestExternalities { .unwrap(), ..Default::default() }, + fixed_validators_set: pallet_fixed_validators_set::GenesisConfig { + validators: BoundedVec::try_from(vec![10_001]).unwrap(), + }, ..Default::default() }; diff --git a/crates/pallet-humanode-session/src/tests.rs b/crates/pallet-humanode-session/src/tests.rs index ec4294386..fb7d75782 100644 --- a/crates/pallet-humanode-session/src/tests.rs +++ b/crates/pallet-humanode-session/src/tests.rs @@ -48,9 +48,9 @@ fn basic_setup_works() { }); } -/// This test verifies that ban works in the happy path. +/// This test verifies that ban works for the bioauth validators. #[test] -fn ban_works() { +fn ban_works_on_bioauth() { new_test_ext().execute_with_ext(|_| { // Check test preconditions. assert!(>::get().is_empty()); @@ -66,6 +66,24 @@ fn ban_works() { }); } +/// This test verifies that ban works for the fixed validators set validators. +#[test] +fn ban_works_on_fixed_validators_set() { + new_test_ext().execute_with_ext(|_| { + // Check test preconditions. + assert!(>::get().is_empty()); + + // Invoke the function under test. + assert_ok!(HumanodeSession::ban(RuntimeOrigin::root(), 10_001)); + + // Assert state changes. + assert_eq!( + >::get().into_inner(), + vec![10_001].into_iter().collect::<_>() + ); + }); +} + /// This test prevents ban when the provided account is related to bootnodes. #[test] fn ban_fails_attempt_to_ban_bootnode() { @@ -157,7 +175,7 @@ fn full_ban_unban_lifecycle() { expires_at: 1000, }] ); - assert_eq!(Session::validators(), vec![42, 43, 44, 1]); + assert_eq!(Session::validators(), vec![42, 43, 44, 1, 10_001]); assert_eq!( Session::queued_keys(), vec![ @@ -165,6 +183,7 @@ fn full_ban_unban_lifecycle() { (43, sp_runtime::testing::UintAuthorityId(43)), (44, sp_runtime::testing::UintAuthorityId(44)), (1, sp_runtime::testing::UintAuthorityId(1)), + (10_001, sp_runtime::testing::UintAuthorityId(10_001)), ] ); @@ -183,7 +202,7 @@ fn full_ban_unban_lifecycle() { expires_at: 1000, }] ); - assert_eq!(Session::validators(), vec![42, 43, 44, 1]); + assert_eq!(Session::validators(), vec![42, 43, 44, 1, 10_001]); assert_eq!( Session::queued_keys(), vec![ @@ -191,6 +210,7 @@ fn full_ban_unban_lifecycle() { (43, sp_runtime::testing::UintAuthorityId(43)), (44, sp_runtime::testing::UintAuthorityId(44)), (1, sp_runtime::testing::UintAuthorityId(1)), + (10_001, sp_runtime::testing::UintAuthorityId(10_001)), ] ); @@ -211,13 +231,14 @@ fn full_ban_unban_lifecycle() { expires_at: 1000, }] ); - assert_eq!(Session::validators(), vec![42, 43, 44, 1]); + assert_eq!(Session::validators(), vec![42, 43, 44, 1, 10_001]); assert_eq!( Session::queued_keys(), vec![ (42, sp_runtime::testing::UintAuthorityId(42)), (43, sp_runtime::testing::UintAuthorityId(43)), (44, sp_runtime::testing::UintAuthorityId(44)), + (10_001, sp_runtime::testing::UintAuthorityId(10_001)), ] ); @@ -239,13 +260,14 @@ fn full_ban_unban_lifecycle() { expires_at: 1000, }] ); - assert_eq!(Session::validators(), vec![42, 43, 44]); + assert_eq!(Session::validators(), vec![42, 43, 44, 10_001]); assert_eq!( Session::queued_keys(), vec![ (42, sp_runtime::testing::UintAuthorityId(42)), (43, sp_runtime::testing::UintAuthorityId(43)), (44, sp_runtime::testing::UintAuthorityId(44)), + (10_001, sp_runtime::testing::UintAuthorityId(10_001)), ] ); @@ -266,7 +288,7 @@ fn full_ban_unban_lifecycle() { expires_at: 1000, }] ); - assert_eq!(Session::validators(), vec![42, 43, 44]); + assert_eq!(Session::validators(), vec![42, 43, 44, 10_001]); assert_eq!( Session::queued_keys(), vec![ @@ -274,6 +296,7 @@ fn full_ban_unban_lifecycle() { (43, sp_runtime::testing::UintAuthorityId(43)), (44, sp_runtime::testing::UintAuthorityId(44)), (1, sp_runtime::testing::UintAuthorityId(1)), + (10_001, sp_runtime::testing::UintAuthorityId(10_001)), ] ); @@ -292,7 +315,7 @@ fn full_ban_unban_lifecycle() { expires_at: 1000, }] ); - assert_eq!(Session::validators(), vec![42, 43, 44, 1]); + assert_eq!(Session::validators(), vec![42, 43, 44, 1, 10_001]); assert_eq!( Session::queued_keys(), vec![ @@ -300,6 +323,7 @@ fn full_ban_unban_lifecycle() { (43, sp_runtime::testing::UintAuthorityId(43)), (44, sp_runtime::testing::UintAuthorityId(44)), (1, sp_runtime::testing::UintAuthorityId(1)), + (10_001, sp_runtime::testing::UintAuthorityId(10_001)), ] ); }); From 73850c910b74d2eed3c0b42ac7bf222cb44f9ff0 Mon Sep 17 00:00:00 2001 From: MOZGIII Date: Wed, 8 Oct 2025 00:35:27 +0400 Subject: [PATCH 09/11] Add duplicates test --- crates/pallet-humanode-session/src/mock.rs | 6 +- crates/pallet-humanode-session/src/tests.rs | 106 +++++++++++++++++++- 2 files changed, 108 insertions(+), 4 deletions(-) diff --git a/crates/pallet-humanode-session/src/mock.rs b/crates/pallet-humanode-session/src/mock.rs index 436bb0752..aeeabe9c4 100644 --- a/crates/pallet-humanode-session/src/mock.rs +++ b/crates/pallet-humanode-session/src/mock.rs @@ -258,9 +258,11 @@ pub fn new_test_ext() -> sp_io::TestExternalities { ..Default::default() }; - let storage = genesis_config.build_storage().unwrap(); + new_test_ext_with(genesis_config) +} - // Make test externalities from the storage. +pub fn new_test_ext_with(genesis_config: GenesisConfig) -> sp_io::TestExternalities { + let storage = genesis_config.build_storage().unwrap(); storage.into() } diff --git a/crates/pallet-humanode-session/src/tests.rs b/crates/pallet-humanode-session/src/tests.rs index fb7d75782..787b00838 100644 --- a/crates/pallet-humanode-session/src/tests.rs +++ b/crates/pallet-humanode-session/src/tests.rs @@ -11,8 +11,8 @@ use sp_runtime::{traits::BlockNumberProvider, BoundedBTreeSet}; use crate::{ mock::{ - new_test_ext, Bioauth, HumanodeSession, MockShouldEndSession, RuntimeOrigin, Session, - System, Test, TestExternalitiesExt, + new_test_ext, new_test_ext_with, Bioauth, HumanodeSession, MockShouldEndSession, + RuntimeOrigin, Session, System, Test, TestExternalitiesExt, }, *, }; @@ -328,3 +328,105 @@ fn full_ban_unban_lifecycle() { ); }); } + +/// This test verifies that pallet session properly handles duplicates. +#[test] +fn duplicates() { + let genesis_config = mock::GenesisConfig { + session: pallet_session::GenesisConfig { + keys: vec![(1, 1, sp_runtime::testing::UintAuthorityId(1))], + }, + bootnodes: pallet_bootnodes::GenesisConfig { + bootnodes: BoundedVec::truncate_from(vec![1]), + }, + bioauth: pallet_bioauth::GenesisConfig { + active_authentications: BoundedVec::try_from(vec![pallet_bioauth::Authentication { + public_key: 1, + expires_at: 1000, + }]) + .unwrap(), + ..Default::default() + }, + fixed_validators_set: pallet_fixed_validators_set::GenesisConfig { + validators: BoundedVec::try_from(vec![1]).unwrap(), + }, + ..Default::default() + }; + new_test_ext_with(genesis_config).execute_with_ext(|_| { + // Check initial state. + assert_eq!(pallet_bootnodes::Bootnodes::::get(), vec![1]); + assert_eq!( + Bioauth::active_authentications(), + vec![pallet_bioauth::Authentication { + public_key: 1, + expires_at: 1000, + }] + ); + assert_eq!( + pallet_fixed_validators_set::Validators::::get(), + vec![1] + ); + assert_eq!(Session::validators(), vec![1]); + assert_eq!( + Session::queued_keys(), + vec![(1, sp_runtime::testing::UintAuthorityId(1)),] + ); + + // Rotate session. + rotate_session(); + + // Assert state changes. + // + // Expect that the state remains the same - just one key, no duplicates. + assert_eq!( + Bioauth::active_authentications(), + vec![pallet_bioauth::Authentication { + public_key: 1, + expires_at: 1000, + }] + ); + assert_eq!(Session::validators(), vec![1]); + assert_eq!( + Session::queued_keys(), + vec![(1, sp_runtime::testing::UintAuthorityId(1)),] + ); + + // Rotate session. + rotate_session(); + + // Assert state changes. + // + // Expect that the state remains the same again - just one key, no duplicates. + assert_eq!( + Bioauth::active_authentications(), + vec![pallet_bioauth::Authentication { + public_key: 1, + expires_at: 1000, + }] + ); + assert_eq!(Session::validators(), vec![1]); + assert_eq!( + Session::queued_keys(), + vec![(1, sp_runtime::testing::UintAuthorityId(1)),] + ); + + // Rotate session. + rotate_session(); + + // Assert state changes. + // + // Expect that the state remains the same for the third time - just one key, no duplicates. + assert_eq!( + Bioauth::active_authentications(), + vec![pallet_bioauth::Authentication { + public_key: 1, + expires_at: 1000, + }] + ); + assert_eq!(Session::validators(), vec![1]); + assert_eq!( + Session::queued_keys(), + vec![(1, sp_runtime::testing::UintAuthorityId(1)),] + ); + }); +} From 6b02a659e06661dcfe9c258903af83245168c591 Mon Sep 17 00:00:00 2001 From: MOZGIII Date: Thu, 9 Oct 2025 17:58:17 +0300 Subject: [PATCH 10/11] Perform the deduplication of the validators set (#1621) * Add dedupe utils * Implement validator deduplication based on account id and the first-in order * Fix the doc comment on the DedupeKeyExtractor::Output * Fixed doc comment on DedupeIter::dedupe_key_extractor * Apply suggestion from @dmitrylavrenov Co-authored-by: Dmitry Lavrenov <39522748+dmitrylavrenov@users.noreply.github.com> * Add a test * Remove the broken impl (doesn't work either way) --------- Co-authored-by: Dmitry Lavrenov <39522748+dmitrylavrenov@users.noreply.github.com> --- crates/pallet-humanode-session/src/lib.rs | 23 ++++ crates/pallet-humanode-session/src/utils.rs | 5 + .../src/utils/dedupe_iter.rs | 119 ++++++++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 crates/pallet-humanode-session/src/utils.rs create mode 100644 crates/pallet-humanode-session/src/utils/dedupe_iter.rs diff --git a/crates/pallet-humanode-session/src/lib.rs b/crates/pallet-humanode-session/src/lib.rs index 59a164d47..884df53f9 100644 --- a/crates/pallet-humanode-session/src/lib.rs +++ b/crates/pallet-humanode-session/src/lib.rs @@ -2,6 +2,8 @@ #![cfg_attr(not(feature = "std"), no_std)] +extern crate alloc; + #[cfg(feature = "try-runtime")] use frame_support::sp_runtime::TryRuntimeError; use frame_support::traits::{Get, StorageVersion}; @@ -21,6 +23,9 @@ pub mod benchmarking; mod mock; #[cfg(test)] mod tests; +mod utils; + +use self::utils::DedupeIteratorExt as _; /// The type representing the session index in our chain. type SessionIndex = u32; @@ -275,6 +280,7 @@ impl Pallet { bootnodes .chain(bioauth_active_authentications) .chain(fixed_validators) + .dedupe(AccountIdDedupeKey::::default()) } /// Clears and re-populates the [`SessionIdentities`] for a given session with the entries. @@ -352,3 +358,20 @@ impl sp_runtime::traits::Convert>::get(session_index, account_id) } } + +/// The dedupe key extractor that provides Account Ids from Identification Tuples. +struct AccountIdDedupeKey(core::marker::PhantomData); + +impl utils::DedupeKeyExtractor> for AccountIdDedupeKey { + type Output = ::AccountId; + + fn extract_key(&self, value: &IdentificationTupleFor) -> Self::Output { + value.0.clone() + } +} + +impl Default for AccountIdDedupeKey { + fn default() -> Self { + Self(core::marker::PhantomData) + } +} diff --git a/crates/pallet-humanode-session/src/utils.rs b/crates/pallet-humanode-session/src/utils.rs new file mode 100644 index 000000000..a5a2d98bf --- /dev/null +++ b/crates/pallet-humanode-session/src/utils.rs @@ -0,0 +1,5 @@ +//! Utilities. + +mod dedupe_iter; + +pub use self::dedupe_iter::*; diff --git a/crates/pallet-humanode-session/src/utils/dedupe_iter.rs b/crates/pallet-humanode-session/src/utils/dedupe_iter.rs new file mode 100644 index 000000000..c35606438 --- /dev/null +++ b/crates/pallet-humanode-session/src/utils/dedupe_iter.rs @@ -0,0 +1,119 @@ +//! Deduplicating iterator wrapper. + +use alloc::collections::BTreeSet; + +/// Dedupe key extraction. +/// +/// Provides a dedupe key for type `T`. +pub trait DedupeKeyExtractor { + /// The type this extractor extracts; the dedupe key. + type Output; + + /// Perform the dedupe key extraction from the given value. + fn extract_key(&self, value: &T) -> Self::Output; +} + +/// The dedupe iterator. +pub struct DedupeIter +where + Source: Iterator, + DedupeKeyExtractor: self::DedupeKeyExtractor, +{ + /// The source iterator. + pub source: Source, + + /// The dedupe key extractor. + pub dedupe_key_extractor: DedupeKeyExtractor, + + /// The state for tracking the duplicates. + pub dedupe_state: + BTreeSet<>::Output>, +} + +impl DedupeIter +where + Source: Iterator, + DedupeKeyExtractor: self::DedupeKeyExtractor, +{ + /// Create a new dedupe iterator from the given iterator. + pub fn new(source: Source, dedupe_key_extractor: DedupeKeyExtractor) -> Self { + Self { + source, + dedupe_key_extractor, + dedupe_state: Default::default(), + } + } +} + +impl Iterator for DedupeIter +where + Source: Iterator, + DedupeKeyExtractor: self::DedupeKeyExtractor, + DedupeKeyExtractor::Output: Ord, +{ + type Item = Source::Item; + + fn next(&mut self) -> Option { + loop { + let item = self.source.next()?; + let dedupe_key = self.dedupe_key_extractor.extract_key(&item); + let was_new = self.dedupe_state.insert(dedupe_key); + if !was_new { + continue; + } + return Some(item); + } + } + + fn size_hint(&self) -> (usize, Option) { + let (_source_lower, source_higher) = self.source.size_hint(); + + // Lower bound is always unpredictably `0`. + (0, source_higher) + } +} + +/// [`Iterator`] extension trait for `dedupe` fn. +pub trait DedupeIteratorExt: Iterator + Sized { + /// Deduplicate the iterator. + fn dedupe>( + self, + dedupe_key_extractor: DedupeKeyExtractor, + ) -> DedupeIter; +} + +impl DedupeIteratorExt for T +where + T: Iterator, +{ + fn dedupe>( + self, + dedupe_key_extractor: DedupeKeyExtractor, + ) -> DedupeIter { + DedupeIter::new(self, dedupe_key_extractor) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + struct IdentityCopy; + + impl DedupeKeyExtractor for IdentityCopy { + type Output = T; + + fn extract_key(&self, value: &T) -> Self::Output { + *value + } + } + + #[test] + fn dedupe() { + let iter = vec![1usize, 2, 1].into_iter(); + + let deduped_iter = iter.dedupe(IdentityCopy); + + assert_eq!(deduped_iter.collect::>(), vec![1, 2]); + } +} From b4369af46b5804b90fe63d5b8c5f331b9a626363 Mon Sep 17 00:00:00 2001 From: MOZGIII Date: Fri, 14 Nov 2025 11:31:13 +0400 Subject: [PATCH 11/11] Add the check for the fixed validators set --- crates/pallet-humanode-session/src/tests.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/pallet-humanode-session/src/tests.rs b/crates/pallet-humanode-session/src/tests.rs index 787b00838..cc038e81d 100644 --- a/crates/pallet-humanode-session/src/tests.rs +++ b/crates/pallet-humanode-session/src/tests.rs @@ -385,6 +385,10 @@ fn duplicates() { expires_at: 1000, }] ); + assert_eq!( + pallet_fixed_validators_set::Validators::::get(), + vec![1] + ); assert_eq!(Session::validators(), vec![1]); assert_eq!( Session::queued_keys(), @@ -423,6 +427,10 @@ fn duplicates() { expires_at: 1000, }] ); + assert_eq!( + pallet_fixed_validators_set::Validators::::get(), + vec![1] + ); assert_eq!(Session::validators(), vec![1]); assert_eq!( Session::queued_keys(),