Skip to content

Commit 508bc82

Browse files
authored
Merge branch 'master' into ankan/np-newtype
2 parents 11792ce + 03bbc17 commit 508bc82

File tree

19 files changed

+1659
-4036
lines changed

19 files changed

+1659
-4036
lines changed

bridges/modules/grandpa/src/benchmarking.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@ const MAX_VOTE_ANCESTRIES_RANGE_END: u32 =
7070
// the same with validators - if there are too much validators, let's run benchmarks on subrange
7171
fn precommits_range_end<T: Config<I>, I: 'static>() -> u32 {
7272
let max_bridged_authorities = T::BridgedChain::MAX_AUTHORITIES_COUNT;
73-
if max_bridged_authorities > 128 {
73+
let max_bridged_authorities = if max_bridged_authorities > 128 {
7474
sp_std::cmp::max(128, max_bridged_authorities / 5)
7575
} else {
7676
max_bridged_authorities
7777
};
78+
7879
required_justification_precommits(max_bridged_authorities)
7980
}
8081

cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_grandpa.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
//! Autogenerated weights for `pallet_bridge_grandpa`
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
20-
//! DATE: 2024-05-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
20+
//! DATE: 2024-05-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
2121
//! WORST CASE MAP SIZE: `1000000`
22-
//! HOSTNAME: `runner-unxyhko3-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
22+
//! HOSTNAME: `runner-vicqj8em-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
2323
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
2424
2525
// Executed Command:
@@ -62,17 +62,17 @@ impl<T: frame_system::Config> pallet_bridge_grandpa::WeightInfo for WeightInfo<T
6262
/// Proof: `BridgeWestendGrandpa::ImportedHashes` (`max_values`: Some(1024), `max_size`: Some(36), added: 1521, mode: `MaxEncodedLen`)
6363
/// Storage: `BridgeWestendGrandpa::ImportedHeaders` (r:0 w:2)
6464
/// Proof: `BridgeWestendGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`: Some(68), added: 1553, mode: `MaxEncodedLen`)
65-
/// The range of component `p` is `[1, 838]`.
65+
/// The range of component `p` is `[1, 168]`.
6666
/// The range of component `v` is `[50, 100]`.
6767
fn submit_finality_proof(p: u32, _v: u32, ) -> Weight {
6868
// Proof Size summary in bytes:
69-
// Measured: `440 + p * (60 ±0)`
69+
// Measured: `438 + p * (60 ±0)`
7070
// Estimated: `51735`
71-
// Minimum execution time: 306_046_000 picoseconds.
72-
Weight::from_parts(384_361_000, 0)
71+
// Minimum execution time: 300_829_000 picoseconds.
72+
Weight::from_parts(321_573_000, 0)
7373
.saturating_add(Weight::from_parts(0, 51735))
74-
// Standard Error: 14_298
75-
.saturating_add(Weight::from_parts(49_045_748, 0).saturating_mul(p.into()))
74+
// Standard Error: 25_917
75+
.saturating_add(Weight::from_parts(48_613_160, 0).saturating_mul(p.into()))
7676
.saturating_add(T::DbWeight::get().reads(6))
7777
.saturating_add(T::DbWeight::get().writes(5))
7878
}
@@ -90,8 +90,8 @@ impl<T: frame_system::Config> pallet_bridge_grandpa::WeightInfo for WeightInfo<T
9090
// Proof Size summary in bytes:
9191
// Measured: `452`
9292
// Estimated: `51735`
93-
// Minimum execution time: 94_965_000 picoseconds.
94-
Weight::from_parts(113_633_000, 0)
93+
// Minimum execution time: 101_007_000 picoseconds.
94+
Weight::from_parts(129_904_000, 0)
9595
.saturating_add(Weight::from_parts(0, 51735))
9696
.saturating_add(T::DbWeight::get().reads(3))
9797
.saturating_add(T::DbWeight::get().writes(6))

cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/weights/pallet_bridge_grandpa.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
//! Autogenerated weights for `pallet_bridge_grandpa`
1818
//!
1919
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
20-
//! DATE: 2024-05-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
20+
//! DATE: 2024-05-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
2121
//! WORST CASE MAP SIZE: `1000000`
22-
//! HOSTNAME: `runner-unxyhko3-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
22+
//! HOSTNAME: `runner-vicqj8em-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
2323
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-westend-dev")`, DB CACHE: 1024
2424
2525
// Executed Command:
@@ -62,19 +62,19 @@ impl<T: frame_system::Config> pallet_bridge_grandpa::WeightInfo for WeightInfo<T
6262
/// Proof: `BridgeRococoGrandpa::ImportedHashes` (`max_values`: Some(1024), `max_size`: Some(36), added: 1521, mode: `MaxEncodedLen`)
6363
/// Storage: `BridgeRococoGrandpa::ImportedHeaders` (r:0 w:2)
6464
/// Proof: `BridgeRococoGrandpa::ImportedHeaders` (`max_values`: Some(1024), `max_size`: Some(68), added: 1553, mode: `MaxEncodedLen`)
65-
/// The range of component `p` is `[1, 838]`.
65+
/// The range of component `p` is `[1, 168]`.
6666
/// The range of component `v` is `[50, 100]`.
6767
fn submit_finality_proof(p: u32, v: u32, ) -> Weight {
6868
// Proof Size summary in bytes:
69-
// Measured: `270 + p * (60 ±0)`
69+
// Measured: `268 + p * (60 ±0)`
7070
// Estimated: `51735`
71-
// Minimum execution time: 294_098_000 picoseconds.
72-
Weight::from_parts(31_208_540, 0)
71+
// Minimum execution time: 291_721_000 picoseconds.
72+
Weight::from_parts(37_495_589, 0)
7373
.saturating_add(Weight::from_parts(0, 51735))
74-
// Standard Error: 8_832
75-
.saturating_add(Weight::from_parts(40_930_987, 0).saturating_mul(p.into()))
76-
// Standard Error: 147_319
77-
.saturating_add(Weight::from_parts(2_663_839, 0).saturating_mul(v.into()))
74+
// Standard Error: 22_170
75+
.saturating_add(Weight::from_parts(45_403_072, 0).saturating_mul(p.into()))
76+
// Standard Error: 73_977
77+
.saturating_add(Weight::from_parts(2_130_216, 0).saturating_mul(v.into()))
7878
.saturating_add(T::DbWeight::get().reads(6))
7979
.saturating_add(T::DbWeight::get().writes(5))
8080
}
@@ -92,8 +92,8 @@ impl<T: frame_system::Config> pallet_bridge_grandpa::WeightInfo for WeightInfo<T
9292
// Proof Size summary in bytes:
9393
// Measured: `282`
9494
// Estimated: `51735`
95-
// Minimum execution time: 112_875_000 picoseconds.
96-
Weight::from_parts(120_861_000, 0)
95+
// Minimum execution time: 77_426_000 picoseconds.
96+
Weight::from_parts(90_926_000, 0)
9797
.saturating_add(Weight::from_parts(0, 51735))
9898
.saturating_add(T::DbWeight::get().reads(3))
9999
.saturating_add(T::DbWeight::get().writes(6))

prdoc/pr_4233.prdoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
title: "[pallet_contracts] Update Host fn benchnmarks"
2+
3+
doc:
4+
- audience: Runtime Dev
5+
description: |
6+
Update how the host functions are benchmarked.
7+
Instead of benchnarking a contract that calls the host functions, we now benchmark the host functions directly.
8+
9+
crates:
10+
- name: pallet-contracts
11+
bump: minor
12+
- name: pallet-contracts-proc-macro
13+
bump: minor
14+

substrate/frame/contracts/README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,6 @@ calls are reverted. Assuming correct error handling by contract A, A's other cal
3434

3535
One `ref_time` `Weight` is defined as one picosecond of execution time on the runtime's reference machine.
3636

37-
#### Schedule
38-
39-
The `Schedule` is where, among other things, the cost of every action a contract can do is defined. These costs are derived
40-
from the benchmarks of this pallet. Instead of looking at the raw benchmark results it is advised to look at the `Schedule`
41-
if one wants to manually inspect the performance characteristics. The `Schedule` can be printed like this:
42-
43-
```sh
44-
RUST_LOG=runtime::contracts=info cargo run --features runtime-benchmarks --bin substrate-node -- benchmark pallet --extra -p pallet_contracts -e print_schedule
45-
```
46-
47-
Please note that the `Schedule` will be printed multiple times. This is because we are (ab)using a benchmark to print
48-
the struct.
49-
5037
### Revert Behaviour
5138

5239
Contract call failures are not cascading. When failures occur in a sub-call, they do not "bubble up", and the call will

0 commit comments

Comments
 (0)