Commit fc919376 authored by Falco Hirschenberger's avatar Falco Hirschenberger Committed by GitHub
Browse files

Add benchmarking for parachain runtime `ump` pallet (#3889)



* Claim grounds, not working yet.

* still wip, nothing to see

* Module visibility problem

* Add benchmarks for all parachain-enabled chains

* Add missing mock weights

* Fix mock weight info

* Add max-weight to extrinsic weight

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::ump --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_ump.rs

* sorting declarations

* Use a maximum size message to benchmark worst-case

* remove warning

* Fix msg size overflow in tests

* Use benchmarked weight in PostInfo

* Update runtime/parachains/src/ump.rs

Co-authored-by: default avatarAlexander Popiak <[email protected]>

* Delete obsolete file

* Compile fix

* Fix spelling

* Add benchmark for `UmpSink::process_upward_message`

It benchmarks the time to process a message, mainly the size-dependent
decoding time. This is used interally for refunding weight from
`service_overweight`

* Fix warning

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::ump --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_ump.rs

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::ump --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_ump.rs

* Update runtime/parachains/src/ump.rs

Co-authored-by: default avatarKian Paimani <[email protected]>

* Give mock weights for tests a name instead of ()

* Add benchmark for `initializer_on_new_session` aka.
`perform_outgoing_para_cleanup`

* Remove unnescessary pub specifier and change folding to a for loop

suggestions by @pepyakin



* Update runtime/parachains/src/ump.rs

Co-authored-by: default avatarKian Paimani <[email protected]>

* Update runtime/parachains/src/ump.rs

Co-authored-by: default avatarKian Paimani <[email protected]>

* Add comment on weight calculation and expected slight overestimation

* Introduce a size bound constant for upward messages

* Use KiB not kB for message size bound

* Enforce max-message size bound

* Use a const for upward message size bound.

* Decrease max_upward_message_sizes to 50KiB as suggested by @pepyakin

* Fix creating overweight messages

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::ump --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/rococo/src/weights/runtime_parachains_ump.rs

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::ump --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_ump.rs

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::ump --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_ump.rs

* Remove unused variable

* Rename benchmark function to the function actually benchmarked and some
code cleanup

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::ump --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_ump.rs

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::ump --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/rococo/src/weights/runtime_parachains_ump.rs

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::ump --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_ump.rs

* Better variable naming

* Fix build

* Fix build

* Fix some remarks from @pepyakin



Co-authored-by: default avatarParity Bot <[email protected]>
Co-authored-by: default avatarAlexander Popiak <[email protected]>
Co-authored-by: default avatarKian Paimani <[email protected]>
Co-authored-by: default avataremostov <[email protected]>
parent 2771f183
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment