Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix polimec benches #295

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,26 @@ test-runtime-features runtime="polimec-runtime":
test-integration:
cargo test -p integration-tests

dry-run-benchmarks pallet="*" extrinsic="*":
cargo build --features runtime-benchmarks --release && \
./target/release/polimec-node benchmark pallet \
--chain=politest-local \
--steps=2 \
--repeat=1 \
--pallet={{ pallet }} \
--extrinsic={{ extrinsic }} \
--wasm-execution=compiled \
--heap-pages=4096 && \
./target/release/polimec-node benchmark pallet \
--chain=polimec-local \
--steps=2 \
--repeat=1 \
--pallet={{ pallet }} \
--extrinsic={{ extrinsic }} \
--wasm-execution=compiled \
--heap-pages=4096
dry-run-benchmarks runtime="politest,polimec" pallet="*" extrinsic="*" :
#!/bin/bash
# Set the internal field separator for splitting the runtime variable
IFS=','
# Read the runtime variable into an array
read -ra runtimes <<< "{{runtime}}"
# Build the project
cargo build --features runtime-benchmarks --release
# Loop over each runtime and run the benchmark
for runtime in "${runtimes[@]}"; do \
echo -e "\033[34mRunning benchmarks for runtime: \033[92m$runtime\033[34m\033[0m"
./target/release/polimec-node benchmark pallet \
--chain=${runtime}-local \
--steps=2 \
--repeat=1 \
--pallet={{ pallet }} \
--extrinsic={{ extrinsic }} \
--wasm-execution=compiled \
--heap-pages=4096
done

# src: https://github.com/polkadot-fellows/runtimes/blob/48ccfae6141d2924f579d81e8b1877efd208693f/system-parachains/asset-hubs/asset-hub-polkadot/src/weights/cumulus_pallet_xcmp_queue.rs
# Benchmark a specific pallet on the "Polimec" Runtime
Expand Down
1 change: 1 addition & 0 deletions runtimes/polimec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ std = [
]

runtime-benchmarks = [
"development-settings",
"cumulus-pallet-dmp-queue/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
Expand Down
4 changes: 2 additions & 2 deletions runtimes/polimec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ parameter_types! {
}

// Development public key
#[cfg(feature = "development-settings")]
#[cfg(any(feature = "development-settings", test))]
parameter_types! {
pub VerifierPublicKey: [u8; 32] = [
32, 118, 30, 171, 58, 212, 197, 27, 146, 122, 255, 243, 34, 245, 90, 244, 221, 37, 253,
Expand All @@ -1002,7 +1002,7 @@ parameter_types! {
}

// Production public key
#[cfg(not(feature = "development-settings"))]
#[cfg(not(any(feature = "development-settings", test)))]
parameter_types! {
pub VerifierPublicKey: [u8; 32] = [
83, 49, 95, 191, 98, 138, 14, 43, 234, 192, 105, 248, 11, 96, 127, 234, 192, 62, 80,
Expand Down