Skip to content

Commit 007c586

Browse files
authored
change: Benchmark selection pallet (#1045)
1 parent c13dab0 commit 007c586

File tree

15 files changed

+158
-350
lines changed

15 files changed

+158
-350
lines changed

Cargo.lock

Lines changed: 1 addition & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ members = [
1515
"substrate-extensions/aura/consensus",
1616
"toolkit/block-production-log/pallet",
1717
"toolkit/committee-selection/pallet",
18-
"toolkit/committee-selection/pallet/benchmarking",
1918
"toolkit/committee-selection/rpc",
2019
"substrate-extensions/aura/primitives",
2120
"toolkit/block-production-log/primitives",
@@ -293,7 +292,6 @@ selection = { path = "toolkit/committee-selection/selection", default-features =
293292
sp-session-validator-management = { default-features = false, path = "toolkit/committee-selection/primitives" }
294293
sp-session-validator-management-query = { default-features = false, path = "toolkit/committee-selection/query" }
295294
pallet-session-validator-management = { default-features = false, path = "toolkit/committee-selection/pallet" }
296-
pallet-session-validator-management-benchmarking = { default-features = false, path = "toolkit/committee-selection/pallet/benchmarking" }
297295
pallet-session-validator-management-rpc = { path = "toolkit/committee-selection/rpc" }
298296
authority-selection-inherents = { path = "toolkit/committee-selection/authority-selection-inherents", default-features = false }
299297

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ session in order to make `pallet_session` use authorities with less delay.
1818

1919
## Fixed
2020

21+
* Improper weights for `set_main_chain_scripts` in `pallet_session_validator_management`
22+
2123
## Added
2224

2325
* Added `partner-chains-node smart-contracts upsert-script` command for inserting and updating versioned scripts.

demo/runtime/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ sp-sidechain = { workspace = true }
7474
pallet-sidechain = { workspace = true }
7575
pallet-session-validator-management = { workspace = true }
7676
sp-session-validator-management = { workspace = true, features = ["serde"] }
77-
pallet-session-validator-management-benchmarking = { workspace = true, optional = true }
7877
sidechain-domain = { workspace = true, features = ["serde"] }
7978
sidechain-slots = { workspace = true }
8079
pallet-address-associations = { workspace = true }
@@ -127,7 +126,6 @@ std = [
127126
"pallet-grandpa/std",
128127
"pallet-sudo/std",
129128
"pallet-session-validator-management/std",
130-
"pallet-session-validator-management-benchmarking?/std",
131129
"pallet-timestamp/std",
132130
"pallet-transaction-payment-rpc-runtime-api/std",
133131
"pallet-transaction-payment/std",
@@ -185,6 +183,7 @@ runtime-benchmarks = [
185183
"pallet-block-participation/runtime-benchmarks",
186184
"pallet-governed-map/runtime-benchmarks",
187185
"pallet-partner-chains-bridge/runtime-benchmarks",
186+
"pallet-session-validator-management/runtime-benchmarks",
188187
]
189188
try-runtime = [
190189
"frame-try-runtime/try-runtime",

demo/runtime/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ impl pallet_session_validator_management::Config for Runtime {
408408
fn current_epoch_number() -> ScEpochNumber {
409409
Sidechain::current_epoch_number()
410410
}
411+
412+
#[cfg(feature = "runtime-benchmarks")]
413+
type BenchmarkHelper = ();
411414
}
412415

413416
parameter_types! {
@@ -774,6 +777,7 @@ mod benches {
774777
[pallet_block_participation, BlockParticipation]
775778
[pallet_governed_map, GovernedMap]
776779
[pallet_partner_chains_bridge, Bridge]
780+
[pallet_session_validator_management, SessionCommitteeManagement]
777781
);
778782
}
779783

demo/runtime/src/mock.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ impl pallet_session_validator_management::Config for Test {
187187
}
188188

189189
type WeightInfo = ();
190+
191+
#[cfg(feature = "runtime-benchmarks")]
192+
type BenchmarkHelper = ();
190193
}
191194

192195
impl pallet_timestamp::Config for Test {

toolkit/committee-selection/pallet/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ sp-io = { workspace = true }
2929
sidechain-domain = { workspace = true }
3030
pallet-session = { workspace = true }
3131
sp-staking = { workspace = true }
32+
frame-benchmarking = { workspace = true, optional = true }
3233

3334
[dev-dependencies]
3435
sp-io = { workspace = true }
@@ -50,5 +51,11 @@ std = [
5051
"sidechain-domain/serde",
5152
"pallet-session/std",
5253
"sp-staking/std",
54+
"frame-benchmarking?/std",
5355
]
5456
try-runtime = ["frame-support/try-runtime"]
57+
runtime-benchmarks = [
58+
"frame-benchmarking/runtime-benchmarks",
59+
"frame-support/runtime-benchmarks",
60+
"frame-system/runtime-benchmarks",
61+
]

toolkit/committee-selection/pallet/benchmarking/Cargo.toml

Lines changed: 0 additions & 67 deletions
This file was deleted.

toolkit/committee-selection/pallet/benchmarking/src/lib.rs

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)