Skip to content

Commit eb00c3a

Browse files
authored
fix: Address association tests and runtime benchmarks should use the same genesis utxo (#873)
1 parent 6882f47 commit eb00c3a

File tree

3 files changed

+26
-22
lines changed

3 files changed

+26
-22
lines changed

toolkit/address-associations/pallet/src/benchmarking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ mod benchmarks {
2323
let stake_public_key = StakePublicKey(hex!(
2424
"2bebcb7fbc74a6e0fd6e00a311698b047b7b659f0e047ff5349dbd984aefc52c"
2525
));
26-
// Alice
26+
// Alice (hex: d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d)
2727
let pc_address = T::PartnerChainAddress::from_ss58check(
2828
"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
2929
)
3030
.unwrap();
3131
let signature = StakeKeySignature(hex!(
32-
"1aa8c1b363a207ddadf0c6242a0632f5a557690a327d0245f9d473b983b3d8e1c95a3dd804cab41123c36ddbcb7137b8261c35d5c8ef04ce9d0f8d5c4b3ca607"
32+
"36aabd5267699b01c01fb6892f9888ab82a0b853a21dcd863b8241c3049d85163ddf350cbbc8ba724abe7b22d5ae03a7b1429f4cc37fb11afcce041fac1cdd05"
3333
));
3434

3535
// Create an account and fund it with sufficient balance

toolkit/address-associations/pallet/src/mock.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ pub(crate) fn pc_address() -> AccountId32 {
117117
}
118118

119119
pub(crate) const VALID_SIGNATURE: [u8; 64] = hex!(
120-
"1aa8c1b363a207ddadf0c6242a0632f5a557690a327d0245f9d473b983b3d8e1c95a3dd804cab41123c36ddbcb7137b8261c35d5c8ef04ce9d0f8d5c4b3ca607"
120+
"36aabd5267699b01c01fb6892f9888ab82a0b853a21dcd863b8241c3049d85163ddf350cbbc8ba724abe7b22d5ae03a7b1429f4cc37fb11afcce041fac1cdd05"
121121
);
122122

123123
impl crate::pallet::Config for Test {
124124
type WeightInfo = ();
125125
type PartnerChainAddress = PartnerChainAddress;
126126
fn genesis_utxo() -> UtxoId {
127-
UtxoId::new(hex!("59104061ffa0d66f9ba0135d6fc6a884a395b10f8ae9cb276fc2c3bfdfedc260"), 1)
127+
UtxoId::new(hex!("0000000000000000000000000000000000000000000000000000000000000000"), 0)
128128
}
129129
type Currency = Balances;
130130
type BurnAmount = AssociationFeeBurn;

toolkit/address-associations/pallet/src/weights.rs

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
//! Autogenerated weights for pallet_address_associations
33
//!
4-
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 46.0.0
5-
//! DATE: 2025-02-11, STEPS: `500`, REPEAT: `200`, LOW RANGE: `[]`, HIGH RANGE: `[]`
4+
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 47.0.0
5+
//! DATE: 2025-06-24, STEPS: `500`, REPEAT: `200`, LOW RANGE: `[]`, HIGH RANGE: `[]`
66
//! WORST CASE MAP SIZE: `1000000`
77
//! HOSTNAME: `Nikolaoss-MacBook-Pro.local`, CPU: `<UNKNOWN>`
88
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
@@ -13,7 +13,7 @@
1313
// benchmark
1414
// pallet
1515
// --runtime
16-
// target/release/wbuild/sidechain-runtime/sidechain_runtime.compact.compressed.wasm
16+
// target/release/wbuild/partner-chains-demo-runtime/partner_chains_demo_runtime.compact.compressed.wasm
1717
// --pallet
1818
// pallet_address_associations
1919
// --extrinsic
@@ -22,7 +22,7 @@
2222
// --repeat=200
2323
// --wasm-execution=compiled
2424
// --output
25-
// toolkit/pallets/address-associations/src/weights.rs
25+
// toolkit/address-associations/pallet/src/weights.rs
2626
// --template
2727
// .maintain/frame-weight-template.hbs
2828

@@ -45,15 +45,17 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
4545
/// Storage: `Sidechain::GenesisUtxo` (r:1 w:0)
4646
/// Proof: `Sidechain::GenesisUtxo` (`max_values`: Some(1), `max_size`: Some(34), added: 529, mode: `MaxEncodedLen`)
4747
/// Storage: `AddressAssociations::AddressAssociations` (r:1 w:1)
48-
/// Proof: `AddressAssociations::AddressAssociations` (`max_values`: None, `max_size`: Some(170), added: 2645, mode: `MaxEncodedLen`)
48+
/// Proof: `AddressAssociations::AddressAssociations` (`max_values`: None, `max_size`: Some(76), added: 2551, mode: `MaxEncodedLen`)
49+
/// Storage: `System::Account` (r:1 w:1)
50+
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
4951
fn associate_address() -> Weight {
5052
// Proof Size summary in bytes:
51-
// Measured: `96`
52-
// Estimated: `3635`
53-
// Minimum execution time: 45_000_000 picoseconds.
54-
Weight::from_parts(47_000_000, 3635)
55-
.saturating_add(T::DbWeight::get().reads(2_u64))
56-
.saturating_add(T::DbWeight::get().writes(1_u64))
53+
// Measured: `197`
54+
// Estimated: `3593`
55+
// Minimum execution time: 84_000_000 picoseconds.
56+
Weight::from_parts(85_000_000, 3593)
57+
.saturating_add(T::DbWeight::get().reads(3_u64))
58+
.saturating_add(T::DbWeight::get().writes(2_u64))
5759
}
5860
}
5961

@@ -62,14 +64,16 @@ impl WeightInfo for () {
6264
/// Storage: `Sidechain::GenesisUtxo` (r:1 w:0)
6365
/// Proof: `Sidechain::GenesisUtxo` (`max_values`: Some(1), `max_size`: Some(34), added: 529, mode: `MaxEncodedLen`)
6466
/// Storage: `AddressAssociations::AddressAssociations` (r:1 w:1)
65-
/// Proof: `AddressAssociations::AddressAssociations` (`max_values`: None, `max_size`: Some(170), added: 2645, mode: `MaxEncodedLen`)
67+
/// Proof: `AddressAssociations::AddressAssociations` (`max_values`: None, `max_size`: Some(76), added: 2551, mode: `MaxEncodedLen`)
68+
/// Storage: `System::Account` (r:1 w:1)
69+
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
6670
fn associate_address() -> Weight {
6771
// Proof Size summary in bytes:
68-
// Measured: `96`
69-
// Estimated: `3635`
70-
// Minimum execution time: 45_000_000 picoseconds.
71-
Weight::from_parts(47_000_000, 3635)
72-
.saturating_add(RocksDbWeight::get().reads(2_u64))
73-
.saturating_add(RocksDbWeight::get().writes(1_u64))
72+
// Measured: `197`
73+
// Estimated: `3593`
74+
// Minimum execution time: 84_000_000 picoseconds.
75+
Weight::from_parts(85_000_000, 3593)
76+
.saturating_add(RocksDbWeight::get().reads(3_u64))
77+
.saturating_add(RocksDbWeight::get().writes(2_u64))
7478
}
7579
}

0 commit comments

Comments
 (0)