Skip to content

Commit

Permalink
178 add benchmarks for custom pallets per runtime (#453)
Browse files Browse the repository at this point in the history
* Make adjustments before benchmarking

* Run benchmarks on Foucoco

* Use new weights in Foucoco runtime

* Run benchmarks on Amplitude

* Use new weights in Amplitude runtime

* Run some benchmarks on Pendulum

* Use new weights in Pendulum runtime

* Update cargo lock

* Remove feature flag from parameters macro

* Actually remove feature flag for parameters macro

* Fix failing benchmarks on Pendulum and add comments

* Generate weights for Spacewalk pallets on Pendulum runtime

* Fix indent

* Rerun benchmarks for treasury buyout extension

* Fix WeightInfo impls for buyout extension

* Use newer commit in Spacewalk

* Amend previous

* Change Stellar currency constants

* Add template to benchmark commands in README

* Clean up chain spec

* Use mock DIA data provider also in Pendulum

* Change Spacewalk rev version

* Generate weights for issue pallet

* Remove tarpaulin report

* Use actual issue weights

* Change weights used for issue and redeem pallets

* Fix parachain-staking benchmarks and add them to all runtimes

* Regenerate weights for parachain-staking pallet

* Update imports

Co-authored-by: Marcel Ebert <mail@marcel-ebert.de>

* Update imports

Co-authored-by: Marcel Ebert <mail@marcel-ebert.de>

* Revert oracle key value

Co-authored-by: Marcel Ebert <mail@marcel-ebert.de>

* Address change requests

---------

Co-authored-by: Marcel Ebert <mail@marcel-ebert.de>
  • Loading branch information
bogdanS98 and ebma authored Jun 10, 2024
1 parent 991c769 commit 3835d27
Show file tree
Hide file tree
Showing 57 changed files with 8,011 additions and 456 deletions.
105 changes: 53 additions & 52 deletions Cargo.lock

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

10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Pendulum chain by SatoshiPay. More information about Pendulum can be found [here](https://docs.pendulumchain.org/).

### How to Run Tests

[`mocktopus`](https://docs.rs/mocktopus/latest/mocktopus/) is nightly-only lib, and is used in testing.
So to run the tests, override the toolchain with nightly; minimum version is `nightly-2024-04-18`.

Expand Down Expand Up @@ -162,7 +163,8 @@ runtimes `lib.rs` file.
--extrinsic "*" \
--steps 50 \
--repeat 20 \
--output runtime/pendulum/src/weights/
--output runtime/pendulum/src/weights/ \
--template .maintain/frame-weight-template.hbs
```

#### Amplitude
Expand All @@ -176,7 +178,8 @@ runtimes `lib.rs` file.
--extrinsic "*" \
--steps 50 \
--repeat 20 \
--output runtime/amplitude/src/weights/
--output runtime/amplitude/src/weights/ \
--template .maintain/frame-weight-template.hbs
```

#### Foucoco
Expand All @@ -190,7 +193,8 @@ runtimes `lib.rs` file.
--extrinsic "*" \
--steps 50 \
--repeat 20 \
--output runtime/foucoco/src/weights/
--output runtime/foucoco/src/weights/ \
--template .maintain/frame-weight-template.hbs
```

### How to run in standalone mode
Expand Down
4 changes: 2 additions & 2 deletions chain-extensions/price/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version = "0.1.0"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
chain-extension-common = { path = "../common", default-features = false }
chain-extension-common = { path = "../common", default-features = false }

codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
log = { version = "0.4.17", default-features = false }
Expand All @@ -21,7 +21,7 @@ frame-system = { git = "https://github.com/paritytech/substrate", default-featur
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" }
pallet-contracts = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" }
spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev ="e7a672ba1e21c98a70df30a6ee458317951dd597"}
spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "8b41e633321e472288e8fb635a4fc3cde9236d54" }

# Open Runtime Module Library
orml-currencies = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", default-features = false, branch = "polkadot-v0.9.42" }
Expand Down
6 changes: 3 additions & 3 deletions chain-extensions/token/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
log = { version = "0.4.17", default-features = false }
chain-extension-common = { path = "../common", default-features = false}
chain-extension-common = { path = "../common", default-features = false }

# Substrate
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" }
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" }
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" }
sp-std = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false}
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42", default-features = false }
pallet-contracts = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.42" }

# Open Runtime Module Library
Expand All @@ -27,7 +27,7 @@ orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-li
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library.git", default-features = false, branch = "polkadot-v0.9.42" }

# Custom libraries for Spacewalk
spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev ="e7a672ba1e21c98a70df30a6ee458317951dd597"}
spacewalk-primitives = { git = "https://github.com/pendulum-chain/spacewalk", default-features = false, rev = "8b41e633321e472288e8fb635a4fc3cde9236d54" }

# Pendulum Pallets
orml-currencies-allowance-extension = { path = "../../pallets/orml-currencies-allowance-extension", default-features = false }
Expand Down
Loading

0 comments on commit 3835d27

Please sign in to comment.