mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 02:21:04 +00:00
Companion for substrate#14435 (BenchmarkHelper for frame-system) (#2766)
* Temporary fix for frame_system::set_code benchmark
* Removed temprary fix
* BenchmarkHelper for frame-system (TODO: add stuff for ParachainSystem OnSetCode)
* BenchmarkHelper for frame-system (TODO: add stuff for ParachainSystem OnSetCode)
* Glutton
* Fix benchmarks for `set_code`
* Changed dummy values to non-zero
* update lockfile for {"polkadot", "substrate"}
---------
Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -1067,6 +1067,33 @@ impl<T: Config> Pallet<T> {
|
||||
)],
|
||||
})
|
||||
}
|
||||
|
||||
/// Prepare/insert relevant data for `schedule_code_upgrade` for benchmarks.
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
pub fn initialize_for_set_code_benchmark(max_code_size: u32) {
|
||||
// insert dummy ValidationData
|
||||
let vfp = PersistedValidationData {
|
||||
parent_head: polkadot_parachain::primitives::HeadData(Default::default()),
|
||||
relay_parent_number: 1,
|
||||
relay_parent_storage_root: Default::default(),
|
||||
max_pov_size: 1_000,
|
||||
};
|
||||
<ValidationData<T>>::put(&vfp);
|
||||
|
||||
// insert dummy HostConfiguration with
|
||||
let host_config = AbridgedHostConfiguration {
|
||||
max_code_size,
|
||||
max_head_data_size: 32 * 1024,
|
||||
max_upward_queue_count: 8,
|
||||
max_upward_queue_size: 1024 * 1024,
|
||||
max_upward_message_size: 4 * 1024,
|
||||
max_upward_message_num_per_candidate: 2,
|
||||
hrmp_max_message_num_per_candidate: 2,
|
||||
validation_upgrade_cooldown: 2,
|
||||
validation_upgrade_delay: 2,
|
||||
};
|
||||
<HostConfiguration<T>>::put(host_config);
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ParachainSetCode<T>(sp_std::marker::PhantomData<T>);
|
||||
|
||||
Reference in New Issue
Block a user