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

feat: upgrade to Polkadot v0.9.19 #357

Merged
merged 11 commits into from
Apr 27, 2022
Merged

feat: upgrade to Polkadot v0.9.19 #357

merged 11 commits into from
Apr 27, 2022

Conversation

wischli
Copy link
Contributor

@wischli wischli commented Apr 21, 2022

fixes KILTProtocol/ticket#1946

  • Adds LengthToFee for pallet_transaction_payment --> required refactor of our WeightToFee impl (see Substrate PR)
  • Upgrades from Polkadot v0.9.17 to Polkadot v0.9.19
    • In v0.9.18, a database migration happens, which also integrates an IPFS server into Substrate (new remark pallet) and adds remark_with_index (PR) which basically enables serving smaller files (< 50kb)
    • However, we do not need to add any migration to our runtime

paritytech/substrate#10779 is a database migration that results in backwards incompatible changes to the database.
paritydbusers: please take a look at paritytech/polkadot#5168 (comment) to avoid issues with your database.

  • Adds Benchmark Subcommands to both clients (main PR, block cmd)
    • Documentation only exist in rust docs or corresponding PRs, see below for an extract

Benchmark Cmd Refactor

Sub-commands concerned with benchmarking. The pallet benchmarking moved to the `pallet` sub-command

USAGE:
    substrate benchmark <SUBCOMMAND>

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

SUBCOMMANDS:
    block       Benchmark the execution time of historic blocks
    help        Print this message or the help of the given subcommand(s)
    overhead    Benchmark the execution overhead per-block and per-extrinsic
    pallet      Benchmark the extrinsic weight of FRAME Pallets
    storage     Benchmark the storage speed of a chain snapshot

Pallet Benchmark

We already know this command

cargo run --release -p kilt-parachain --features=runtime-benchmarks -- benchmark pallet \\
   --chain=dev --steps=50 --repeat=2 --pallet=pallet-tips --extrinsic="*" --execution=wasm \\
   --wasm-execution=compiled --heap-pages=4096

Storage Benchmark

# Rocks DB
cargo run --release -p kilt-parachain --features=runtime-benchmarks -- benchmark storage \\
 --chain=dev --state-version=1

# Parity DB
cargo run --release -p kilt-parachain --features=runtime-benchmarks -- benchmark storage \\
 --chain=dev --state-version=1 --db paritydb-experimental

Block Benchmark

Requires database snapshot

Let's say you are on a Substrate chain and want to verify that the first 3 blocks did not use more weight than declared which would otherwise be an issue.
To test this with a dev node, first create one with a temp directory:

$ substrate --dev -d /tmp/my-dev --execution wasm --wasm-execution compiled

And wait some time to let it produce 3 blocks. Then benchmark them with:

$ substrate benchmark-block --from 1 --to 3 --dev -d /tmp/my-dev \\
  --execution wasm --wasm-execution compiled --pruning archive

Overhead benchmark

We don't provide support yet as its not supported yet in the cumulus parachain node template.

ToDo

  • Check for missing migrations --> We don't need any, Kusama/Polkadot only run a crowdloan migration which is a result from an incorrect previous migration
  • Handle runtimes better in parachain client --> Not optimal at all, but improvements need to be handled in a separate PR

Checklist:

  • I have verified that the code works
    • No panics! (checked arithmetic ops, no indexing array[3] use get(3), ...)
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • I have left the code in a better state
  • I have documented the changes (where applicable)

@wischli wischli changed the title feat: upgrade to polkadot 0.9.19 feat: upgrade to Polkadot v0.9.19 Apr 21, 2022
@wischli wischli marked this pull request as ready for review April 22, 2022 15:10
.gitlab-ci.yml Show resolved Hide resolved
nodes/parachain/src/command.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@trusch trusch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm :)

@wischli wischli merged commit 6f2016b into develop Apr 27, 2022
@wischli wischli deleted the wf-1946-polkadot-0.9.19 branch April 27, 2022 13:46
ntn-x2 pushed a commit that referenced this pull request Jun 23, 2022
* chore: bump deps to Polkadot v0.9.19

* fix: LengthToFee

https://github.com/paritytech/substrate/pull/10785/files

* fix: remove u32_trait

paritytech/substrate#10850

* fix: client

paritytech/substrate#11164
paritytech/cumulus#963
paritytech/cumulus#1069
paritytech/substrate#10878

* fix: clippy runtime

* fix: clippy clone

* feat: add para runtime enum for client

* ci: bump paritytech/ci-linux image

* fix: clippy

* refactor: benchmark cmd match

* fix: peregrune runtime api

(cherry picked from commit 6f2016b)
ntn-x2 added a commit that referenced this pull request Jun 24, 2022
* Adds two more relaychain bootnodes for staging environment  (#334)

* chore: reset peregrine stg (#335)

* ci: use custom ci image (#336)

* Optimizes docker layer (#337)

* fix: add did lookup pallet to DID authorization logic + reverse lookup index (#343)

* chore: update toolchain version to nightly 1.59 (#339)

* feat: proxy type for disableling deposit claiming (#341)

* fix: rococo protocol id (#369)

* feat: generic access control (#316)

* Updates toolchain version (#345)

* refactor: enforce no runtime in pallet (#349)

* fix: features (#353)

* feat: add tips pallet (#352)

* feat: upgrade to Polkadot v0.9.19 (#357)

* chore: upgrade and clean up (#360)

* Adds the new rococo chainspec (#363)

* feat: add launch pallet removal migration (#359)

* refactor: update rilt para id from 2015 to 2108 (#364)

* fix: rilt para id (#365)

* feat: upgrade to Polkadot v0.9.23 (#366)

* use ci-linx:production base image (#368)

* feat: upgrade to Polkadot v0.9.24 (#370)

* fix: fix CI builders compilation errors and pin to a specific hash (#372)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants