Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
Merge 6134c51 into 48d2d9e
Browse files Browse the repository at this point in the history
  • Loading branch information
cab404 authored Dec 21, 2021
2 parents 48d2d9e + 6134c51 commit e7dc9d8
Show file tree
Hide file tree
Showing 35 changed files with 1,194 additions and 2,580 deletions.
4 changes: 0 additions & 4 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
# Configuring missing caches just in case
grep -r "pontem.cachix.org" ~/.config/nix/nix.conf >/dev/null || {
nix-shell -p cachix --command "cachix use pontem"
}
use flake
60 changes: 60 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,63 @@ jobs:
# path: target/**/pontem
if-no-files-found: warn
retention-days: 2
bench:
name: Build
runs-on: ${{ matrix.os }}
if: "contains(github.event.head_commit.message, '#benchme')"

defaults:
run:
shell: bash

strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
dove:
- 1.3.3
benchmark:
- groupsign
- sp-mvm

steps:
- name: Checkout repository
uses: actions/checkout@v2

- id: rust # MSRV
name: use required Rust version
run: |
echo "WASM_BUILD_TOOLCHAIN=$(cat rust-toolchain)" >> $GITHUB_ENV
echo ::set-output name=version::$(cat rust-toolchain)
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ steps.rust.outputs.version }}
profile: minimal
target: wasm32-unknown-unknown
override: false

- name: get dove
uses: pontem-network/get-dove@main
with:
prerelease: true
version: ${{ matrix.dove }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: cargo +${{ steps.rust.outputs.version }} build --features "runtime-benchmarks" --release

- name: Run benchmarks
run: |
mkdir -p bench-${{matrix.benchmark}}
./target/release/pontem benchmark --dev -lsp_mvm=trace --pallet=${{matrix.benchmark}} --extrinsic='*' --steps=20 --repeat=10 output=bench-${{matrix.benchmark}}
- name: Save results
uses: actions/upload-artifact@v2.2.3
with:
name: ${{ matrix.benchmark }}-benches
path: bench-${{matrix.benchmark}}/**
if-no-files-found: warn
retention-days: 2
83 changes: 42 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 31 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ clippy:

.PHONY: bench
bench: assets
# This is just an example about how to run benchmarks for the pallet
mkdir -p ./target/sp-bench
cargo run \
--release \
Expand All @@ -49,6 +48,37 @@ bench: assets
--steps=20 --repeat=10 \
--output=target/sp-bench

.PHONY: run-bench-groupsign
run-bench-groupsign:
mkdir -p ./target/gs-bench
./target/release/pontem \
benchmark \
--dev \
-lsp_mvm=trace \
--pallet=groupsign \
--extrinsic='*' \
--execution=wasm \
--wasm-execution=compiled \
--steps=20 --repeat=10 \
--output=target/gs-bench

.PHONY: bench-groupsign
bench-groupsign:
mkdir -p ./target/gs-bench
cargo run \
--release \
--bin pontem \
--features=runtime-benchmarks -- \
benchmark \
--dev \
-lsp_mvm=trace \
--pallet=groupsign \
--extrinsic='*' \
--execution=wasm \
--wasm-execution=compiled \
--steps=20 --repeat=10 \
--output=target/gp-bench

.PHONY: test
test: assets
export SKIP_WASM_BUILD=1
Expand Down
Loading

0 comments on commit e7dc9d8

Please sign in to comment.