mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 21:01:02 +00:00
Set CurrentCodeHash before running some dispatchable benchmarks (#4645)
* Set CurrentCodeHash before running some dispatchable benchmarks * Use insert instead of put * Actually hash the ValidationCode * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs Co-authored-by: Parity Bot <admin@parity.io>
This commit is contained in:
@@ -81,6 +81,7 @@ benchmarks! {
|
||||
let c in 1 .. MAX_CODE_SIZE;
|
||||
let new_code = ValidationCode(vec![0; c as usize]);
|
||||
let para_id = ParaId::from(c as u32);
|
||||
<Pallet<T> as Store>::CurrentCodeHash::insert(¶_id, new_code.hash());
|
||||
generate_disordered_pruning::<T>();
|
||||
}: _(RawOrigin::Root, para_id, new_code)
|
||||
verify {
|
||||
@@ -108,6 +109,8 @@ benchmarks! {
|
||||
let s in 1 .. MAX_HEAD_DATA_SIZE;
|
||||
let para_id = ParaId::from(1000);
|
||||
let new_head = HeadData(vec![0; s as usize]);
|
||||
let old_code_hash = ValidationCode(vec![0]).hash();
|
||||
<Pallet<T> as Store>::CurrentCodeHash::insert(¶_id, old_code_hash);
|
||||
// schedule an expired code upgrade for this `para_id` so that force_note_new_head would use
|
||||
// the worst possible code path
|
||||
let expired = frame_system::Pallet::<T>::block_number().saturating_sub(One::one());
|
||||
|
||||
Reference in New Issue
Block a user