Skip to content

Commit

Permalink
🐛 Fix polimec benches (#295)
Browse files Browse the repository at this point in the history
## What?
- Fix Polimec benchmarks

## How?
- Use the testing verifier key when running benchmarks and tests 

## Testing?
- `just dry-run-benchmarks polimec`
  • Loading branch information
JuaniRios authored May 14, 2024
1 parent 60e2eeb commit bfad987
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
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

0 comments on commit bfad987

Please sign in to comment.