Commit Graph

301 Commits

Author SHA1 Message Date
Xavier Lau d0f81ba65f Rename extra_constant (#5749) 2022-07-06 10:04:52 +00:00
Kian Paimani bf9e324e8c backport minimum weight to fee to master (#5739)
* propose fix fees

* add tests to kusama runtime as well

* better tests

* last change

* last update

* Fix test

* ignore tests again
2022-06-29 20:26:07 +00:00
Gavin Wood 5f350d4d69 Companion for #11124 (#5615)
* Bump

* Formatting
2022-05-31 11:59:54 +01:00
Gavin Wood 026848c932 Companion to Substrate #11490 (#5603)
* Fix warnings

* Bump
2022-05-30 11:21:03 +01:00
Malte Kliemann 32770a4383 Add missing markdown code block delimiter (#5555) 2022-05-19 11:09:49 +02:00
Bastian Köcher 28cae2ef45 Substrate companion #11387 (#5531)
* Substrate companion #11387

https://github.com/paritytech/substrate/pull/11387

* Update runtime/common/src/crowdloan/migration.rs

* cargo update -p sp-io

* fmt

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2022-05-17 23:33:49 +00:00
Oliver Tale-Yazdi 157b5186ba Co #10719: Use into_account_truncating (#4947)
* Use into_account_truncating

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* more truncating

* more truncating

* more

* clean up parachain primitives

* more truncating

* update lockfile for {"substrate"}

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
2022-05-17 17:53:14 -04:00
Shawn Tabrizi 432cae1a2b Migrate some Pallets to Named Events (#5423)
* auctions

* claims

* registrar

* Update purchase.rs

* crowdloan

* slots

* comma
2022-05-13 16:49:19 +00:00
Bernhard Schuster b67b7fa355 Avoid an excessive amount of unrelated errors on prior rustc error
`1.into()` -> `ParaId::from(1_u32)` (#5500)
2022-05-11 16:11:48 +02:00
Georges a74c527d32 Companion for Adding benchmarking for new frame_election_provider_support #11149 (#5241)
* `GenesisElectionOf` after changes to substrate

* Benchmarking for `frame_election_provider_support`

* Introducing `OnChainSeqPhragmen` after changes
to substrate.
Pallet renaming in substrate

* Fixing `test-runtime`

* Use `UnboundedExecution` after change to substrate

* update lockfile for {"substrate"}

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark pallet --chain=polkadot-dev --steps=50 --repeat=20 --pallet=frame_election_provider_support --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark pallet --chain=kusama-dev --steps=50 --repeat=20 --pallet=frame_election_provider_support --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark pallet --chain=westend-dev --steps=50 --repeat=20 --pallet=frame_election_provider_support --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/

Co-authored-by: parity-processbot <>
Co-authored-by: Parity Bot <admin@parity.io>
2022-04-15 17:17:38 +02:00
Shawn Tabrizi 4d837bac88 Custom Slots Migration for Fund Index Change (#5227)
* new migration

* use new migration in runtime
2022-04-07 10:51:37 -04:00
Qinxuan Chen 74078d8eb9 Comanion for substrate#11136 (#5218)
* Comanion for substrate#11136

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* revert changes in bridge

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
2022-04-04 11:13:34 +02:00
Kian Paimani 5900c50c7b Companion for bags-list iter-from interface (#5209)
* companion for bags-list iter-from

* remove unused

* update lockfile for {"substrate"}

* fix CI

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Co-authored-by: parity-processbot <>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2022-03-31 17:28:50 +00:00
Shawn Tabrizi 37b8bc4886 Migrate Slot Depositors in Crowdloan Migration (#5173)
* Also migrate lease depositors

* bump spec version

* Update runtime/common/src/crowdloan/migration.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2022-03-30 18:41:08 +00:00
Georges 7793796bd2 Adding Fallback on election failure (#5093)
* Adding `Fallback` on election failure
Use the newly introduced `BoundedOnChainSequentialPhragmen`
and `UnboundedOnChainSequentialPhragmen`

* Adding `BoundedOnchainExecution`
after changes in substrate

* Introducing `ExecutionConfig`
from `frame_election_provider_support::onchain`

* `OnChainSequentialPhragmen` > `OnChainSeqPhragmen`
Renaming to have a shorter name

* `BoundedOnchainExecution` -> `BoundedExecution`
And `UnboundedOnchainExecution` -> `UnboundedExecution`

* `Fallback` back to `NoFallback`
`UnboundedExecution` for `GovernanceFallback`

* Update runtime/test-runtime/src/lib.rs

* update lockfile for {"substrate"}

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: parity-processbot <>
2022-03-26 14:27:39 +00:00
Keith Yeung 7cf8010815 Companion for paritytech/substrate#10242 (#4862)
* Rename to BagError

* update lockfile for {"substrate"}

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: parity-processbot <>
2022-03-24 15:39:24 +01:00
Shawn Tabrizi 4d3f6a202e Remove Superfluous Test in Crowdloan Migration (#5158)
* remove stupid check

* here too
2022-03-18 15:06:45 +00:00
Shawn Tabrizi dd6fdf0f14 Fix Benchmark Regressions in Polkadot Parachain Auction System (#5139)
* integration tests use offset

* fix slots

* fix auctions

* add auctions benchmark

* fix crowdloan
2022-03-17 15:56:50 +00:00
Oliver Tale-Yazdi eec58039f1 Parachain runtime dependent weights (#5091)
* Prepare for parachain runtime dependent weights

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Lockfile

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* CI

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* CI

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* CI

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2022-03-12 19:37:24 +00:00
Oliver Tale-Yazdi 2b8f6e9d0a Runtime dependent weights (#5064)
* Copy Substrate weights into each runtime

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Define weights per runtime

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Do the same for test-runtime

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix CI

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Generate multiplier tests via macro

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix CI

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix imports

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix imports

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Change rococo tests to use ExtrinsicBaseWeight

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix imports

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Spellcheck on

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Spellcheck on

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Spellcheck

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Re-Export weight constants in the runtime

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Prepare for cumulus companion

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fmt

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2022-03-11 16:36:08 +00:00
Zeke Mostov b13bb87870 Use updated bags list: Companion to #10997 (#5065)
* Use updated bags list: Companion to #10997

* Use Score, not Value

* update lockfile for {"substrate"}

* Fix match_types

* Fix

Co-authored-by: parity-processbot <>
2022-03-10 10:02:15 +01:00
Robert Habermeier 49f7e5cce4 Finish migration to v2 primitives (#5037)
* remove v0 primitives from polkadot-primitives

* first pass: remove v0

* fix fallout in erasure-coding

* remove v1 primitives, consolidate to v2

* the great import update

* update runtime_api_impl_v1 to v2 as well

* guide: add `Version` request for runtime API

* add version query to runtime API

* reintroduce OldV1SessionInfo in a limited way
2022-03-09 14:01:13 -06:00
Kian Paimani 511344e86c Remove balancing iterations from OCW miners (#4995)
* remove random balancing from unsigned solution

* tweak miner a bit

* add comments

* lower kusama staking limits

* Revert "lower kusama staking limits"

This reverts commit 8ccccbb65a97b78505ef71a796698bb067cc6ba0.

* Update utils/staking-miner/src/dry_run.rs

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>

* last review

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
2022-03-02 21:52:42 +00:00
Davide Galassi 00ce69aae8 [WIP] Companion PR for sr25519 fallible constructor (#4861)
* Manage new `sr25519::Signature::from_slice` fallible constructor

Constructor now returns an `Option`

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
2022-02-26 21:51:44 +00:00
Shawn Tabrizi d5f5127354 Allow two Parachains to swap (#4772)
* add support for parachain to parachain swap

* enable swaps on kusama

* sanity test in paras_registrar

* express more errors

* finish up tests

* fmt

* make fields pub

* refactor integration tests to use real accounts

* Update Crowdloan Account to FundIndex (#4824)

* update fund account to use index

* fix integration tests

* Update runtime/common/src/crowdloan.rs

* finish parachain swap test

* format

* fix warning

* fix spacing

* fix formatting

* write migrations

* add migration

* fixes

* more fixes to migration

* Update runtime/common/src/crowdloan/mod.rs

Co-authored-by: Zeke Mostov <z.mostov@gmail.com>

* Update runtime/common/src/paras_registrar.rs

* Update migration.rs

* extract swap function

Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
2022-02-12 17:16:22 +00:00
Bastian Köcher ef13a0ab8d Companion for Substrate#10655 (#4765)
* Companion for Substrate#10655

https://github.com/paritytech/substrate/pull/10655

This removes the last usages of `Default` in conjunction with `AccountId`

* More fixes

* More of them!

* FMT

* Update Substrate
2022-01-21 20:14:09 +00:00
Oliver Tale-Yazdi 3d61cc01db co #10662: Require MaxEncodedLen per default (#4746)
* Add `without_storage_info`

The MaxEncodedLen trait is now enforced by default in Substrate.
All pallets missing an implementation need to be marked with
`without_storage_info` now.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove `generate_storage_info`

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add more `without_storage_info`

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
2022-01-20 12:36:22 +00:00
Gavin Wood fe7c34bbff Mainnets have upper bound on treasury bond required (companion for #10689) (#4739)
* Mainnets have upper bound on treasury bond required

* Update runtime/common/src/impls.rs

* Update runtime/polkadot/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* Bump

* Update Substrate

Co-authored-by: RRTTI <raul@justopensource.io>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
2022-01-19 21:26:10 +00:00
Alexander Popiak 401540eefc Add fast-runtime Cargo Feature for Quick Test Runs (#4332)
* add fast-runtime feature for reduced session times

* make democracy periods fast on fast-runtime

* propagate fast-runtime feature through cargo.toml files

* add fast motion and term durations to Kusama

* Update runtime/westend/Cargo.toml

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* set session time to 2 minutes to avoid block production issues

* formatting

* update Substrate

* set democracy fast periods back to 1min

* set launch period and enactment period to 1 block in fast-runtime

* remove unnecessary westend period configs

* add prod_or_test macro to allow specifying prod, test and env values for parameter types

* move prod_or_test macro into common module and use it consistently

* rename macro to prod_or_fast

* cargo +nightly fmt

* bump impl_versions

* newline

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* add note that env variable is evaluated at compile time

* newline

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* newline

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* cargo fmt

* impl_version: 0

* impl_version: 0

* use prod_or_fast macro for LeasePeriod and LeaseOffset

* use prod_or_fast macro in WND and ROC constants

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Giles Cope <gilescope@gmail.com>
2022-01-13 20:08:24 +00:00
Sergei Shulepov 47810dcac9 pvf-precheck: Integrate PVF pre-checking into paras module (#4457)
* pvf-precheck: Integrate PVF pre-checking into paras module

Closes #4009

This is the most of the runtime-side change needed for #3211.

Here is how it works.

The PVF pre-checking can be triggered either by an upgrade or by
onboarding (i.e. calling `schedule_para_initialize`). The PVF
pre-checking process is identified by the PVF code hash that is being
voted on. If there is already PVF pre-checking process running, then no
new PVF pre-checking process will be started. Instead, we just subscribe
to the existing one.

If there is no PVF pre-checking process running but the PVF code hash
was already saved in the storage, that necessarily means (I invite the
reviewers to double-check this invariant) that the PVF already passed
pre-checking. This is equivalent to instant approving of the PVF.

The pre-checking process can be concluded either by obtaining a
supermajority or if it expires.

Each validator checks the list of PVFs available for voting. The vote is
binary, i.e. accept or reject a given PVF. As soon as the supermajority
of votes are collected for one of the sides of the vote, the voting is
concluded in that direction and the effects of the voting are enacted.

Only validators from the active set can participate in the vote. The set
of active validators can change each session. That's why we reset the
votes each session. A voting that observed a certain number of sessions
will be rejected.

The effects of the PVF accepting depend on the operations requested it:

1. All onboardings subscribed to the approved PVF pre-checking process will
get scheduled and after passing 2 session boundaries they will be onboarded.
2. All upgrades subscribed to the approved PVF pre-checking process will
get scheduled very similarly to the existing process. Upgrades with
pre-checking are really the same process that is just delayed by the
time required for pre-checking voting. In case of instant approval the
mechanism is exactly the same. This is important from parachains
compatibility standpoint since following the delayed upgrade requires
the parachain to implement
https://github.com/paritytech/cumulus/pull/517.

In case, PVF pre-checking process was concluded with rejection, then all
the requesting operations get cancelled. For onboarding it means it gets
without movement: the lifecycle of such parachain is terminated on the
`Onboarding` state and after rejection the lifecycle is none. That in
turn means that the caller can attempt registering the parachain once
more. For upgrading it means that the upgrade process is aborted: that
flashes go-ahead signal with `Abort` flag.

Rejection leads to removing the allegedly bad validation code from the
chain storage. Among other things, this implies that the operation can
be re-requested. That allows for retrying an operation in case there was
some bug. At the same time it does not look as a DoS vector due to the
caching performed by the nodes.

PVF pre-checking can be enabled and disabled. Initially, according to
the changes in #4420, this mechanism is disabled. Triggering the PVF
pre-checking when it is disabled just means that we insta approve the
requesting operation. This should lead to the behavior being unchanged.

Follow-ups:

- expose runtime APIs

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_parachains_paras.rs

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_paras.rs

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras.rs

* cargo run --quiet --release --features runtime-benchmarks -- benchmark --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/rococo/src/weights/runtime_parachains_paras.rs

* Review fixes

Co-authored-by: Parity Bot <admin@parity.io>
2021-12-16 17:14:40 +01:00
Gavin Wood ca72ad636c Companion #10403: Remove Default for AccountId (#4500)
* Some work

* Fixes

* Tests builds

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Formatting

* Formatting

* Fix

* Fixes

* Fixes

* Fixes

* Fixes

* Update Cargo.lock

* Bump

* Fixes
2021-12-14 08:17:26 +01:00
Shawn Tabrizi a94accb57e Do not allow death on Crowdloan contribute + Introduce contribute_all (#4233)
* Add contirbute all, do not allow death on contribute

* fmt

* Revert "fmt"

This reverts commit c4746e336ac105b1318d8ec6f4cebf504f5d2fba.

* fmt
2021-12-13 11:18:44 +01:00
Bernhard Schuster 0f1a9fb1eb remove Default from CandidateDescriptor (#4484)
* remove Default from CandidateHash

* Apply suggestions from code review

Co-authored-by: Andronik Ordian <write@reusable.software>

* chore: fmt

* remove backed candidate default

* Partial migration away from CandidateReceipt::default

* Remove more CandidateReceipt defaults

* fmt

* Mostly remove CommittedCandidateReceipt default usage

* Remove CommittedCandidateReceipt

* Remove more Defaults from polakdot primitives v1 + fmt

* Remove more Default from polkadot primites v1

* WIP trying to get overseer example + tests to compile

* feat: add primitives test helpers

* reduce deps of helper

* update primitive helpers

* make candidate validation compile

* fixup cargo lock

* make av-store compile

* fixup disputes coordinator tests

* test: fixup backing

* test: fixup approval voting

* fixup bitfield signing

* test: fixup runtime-api

* test: fixup availability dist

* foxi[ pverseer test]

* remove some Defaults, remove bounds from `dummy`

All `fn dummy` in primitives need to be removed anyways.
This aids in the transition.

* it's a test helper, so always use std

* test: fixup parachains runtime tests

Excluding benches.

* fix keyring

* fix paras runtime properly, no more default

* Remove fn dummy() usage from approval voting

* Move TestCandidateBuilder out of av store to test helpers

* Make candidate validation tests pass

* Make most dispute coirdinator tests pass

* Make provisioner tests work

* Make availability recovery tests work with test helpers

* Update polkadot-collator-protocol tests

* Update statement distribution tests

* Update polkadot overseer examples and tests

* Derive default for validation code so we don't break unrelated things

* Make para runtime test pass (no bench)

* Some more work

* chore: cargo fmt

* cargo fix

* avoid some Default::default

* fixup dispute coordinator test

* remove unused crate deps

* remove Default::default wherever possible, replace by dummy_* for the most part

* chore: cargo fmt

* Remove some warnings

* Remove CommittedCandidateReceipt dummy

* Remove CandidateReceipt dummy

* Remove CandidateDescriptor dummy

* Remove commented out code

* Fix para runtime tests

* chore: nightly

* Some updates to the builder

* Dynamically adjust mock head data size

* Make dispute cooridinator tests work

* Fix test candidate_backing_reorders_votes work

* +nightly-2021-10-29 fmt

* Spelling and remove a default use in builder

* Various clean up

* More small updates

* fmt

* More small updates

* Doc comments for test helpers

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras_inherent --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_paras_inherent.rs

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras_inherent --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_parachains_paras_inherent.rs

* Update lib.rs

* review comments

* fix warnings

* fix test by using correct candidate receipt relay parent

Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: emostov <32168567+emostov@users.noreply.github.com>
Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Gavin Wood <gavin@parity.io>
2021-12-10 12:12:07 +00:00
Gavin Wood bc58b46962 Companion for #10382 (Insufficient asset quotas and deposits) (#4390)
* MaxConsumers

* Fixes

* fixes

* one more fix

* Bump Substrate

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-12-09 14:42:39 +01:00
Guillaume Thiolliere a3c60b245f companion for #10231 (#4306)
* fix renames

* fix test

* cargo update -p sp-io

* bump implement version

* bumpd spec version, to be safe

* bump version correctly

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-12-03 07:00:49 +00:00
Steve Degosserie b3d08c0a8e Rococo: ability to programatically assign slots to teams (#3943)
* Permanent & Temp parachain slots on Rococo - WIP

* Revert test change

* Revert test change

* Fix formatting

* Extract logic to separate assigned_slots pallet

* Formatting

* Parachain downgrade logic

* Pallet doc comment

* Revert unnecessary changes

* Fix few issues, tweak temp slots allocation logic; add a bunch of tests

* Address review comments; track active temp slots

* Update runtime/common/src/assigned_slots.rs

* Update runtime/common/src/assigned_slots.rs

* Remove assigned_slots calls from paras_sudo_wrapper

* Unassign is a perfectly valid verb

* Remove unneeded collect

* Update code following #3980

* Cleanup

* Generate storage info for pallet

* Address review comments

* Add ForceOrigin to slots pallet

* Track permanent slot duration in storage

* Fix tests build

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
2021-12-02 22:23:45 +01:00
Shawn Tabrizi 3771b90ff1 Companion for 10379 (EnsureOneOf) (#4405)
* new ensure one of

* fmt

* Update lib.rs

* Update substrate

Co-authored-by: Bastian Köcher <info@kchr.de>
2021-12-01 23:32:37 +01:00
Guillaume Thiolliere e16f71b7b6 companion for pallet order fix. (#4181)
* companion

* remove no-op duplicated function

* fmt

* add comment on constraint

* Run cargo update

* fix integration test

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2021-12-01 03:00:20 +00:00
Bastian Köcher 49d78d99f7 rococo-runtime: Switch to latest construct_runtime! syntax (#4389)
* rococo-runtime: Switch to latest `construct_runtime!` syntax

Besides that it fixes pallet macro errors in other crates that popped up
because of this switch.

* FMT
2021-11-29 21:36:19 +01:00
Kian Paimani 55f58760f2 companion for substrate/10377 (#4379)
* companion for substrate/10377

* udpate substrate (cargo update -p sp-io)

* fmt
2021-11-28 15:21:18 +01:00
Sergei Shulepov bce0e5ac7f Impose new restrictions on paras init and cleanup (#4360)
* Impose new restrictions on paras init and cleanup

For upcoming PVF pre-checking feature we will need to impose a couple of
new restrictions for:

- `schedule_para_initialize`.
- `schedule_para_cleanup`.

Specifically, for the former we do not want to allow registration of
wasm blob that is empty, i.e. 0 bytes. While that currently already
does not make a lot of sense, it allows us to simplify the PVF
pre-checking logic: if this PR is deployed before the following changes
for PVF prechecking then we can be sure that no paras onboarding have to
have to go through the PVF pre-checking. In case, we deploy it
altogether this property will allow us to distingush paras that came in
before PVF pre-checking.

For `schedule_para_cleanup` we do not want to allow offboarding of paras
that are undergoing the upgrade process. While this is not a harsh
restriction this change allows us to avoid making the PVF prechecking
more complicated than it has to be.

* Add a test for schedule_para_initialize

* Link to `ParaLifecycle::is_stable` in docs.

* `schedule_para_{init,cleanup}` docs

Now they link to their original declarations in the pallet for more
details.
2021-11-26 12:53:23 +01:00
Keith Yeung bbde75e8eb Update W3F URL links (#4376) 2021-11-26 08:49:51 +00:00
Alexander Popiak dd695f7ace remove duplicate Deposit from OnUnbalanced implementation (#4180)
closes https://github.com/paritytech/polkadot/issues/4133
2021-10-30 18:39:04 +02:00
Shawn Tabrizi 1031a57d8b Fix XCM Teleport Benchmark (#4146)
* fix xcm benchmark

* fix overflow

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs

* fix spelling

* fmt

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_xcm_benchmarks::fungible --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --template=./xcm/pallet-xcm-benchmarks/template.hbs --output=./runtime/westend/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs

Co-authored-by: Parity Bot <admin@parity.io>
2021-10-27 15:13:39 +02:00
Andronik Ordian 47202727cf validator-discovery: don't remove multiaddr of requested PeerIds (#4036)
* validator-discovery: remove from peer set before inserting

* bump spec versions

* rework into a companion

* fmt

* fix

* fix

* one more time

* one more try

* one more try

* Revert "one more try"

This reverts commit ab6568d3b828a33dc06f5650037597fc88dd06b1.

* one more try

* one more try

* Revert "one more try"

This reverts commit 8d7369f7b78633bd1b1c5ba3e0f2a0544bdd77a5.

* fix a warning

* fix another warn

* correct log

* fix compilation

* ffs

* less cloning

* Apply suggestions from code review

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

* add comments and a small refactoring

* use set_reserved_peers

* cargo update -p sp-io

* rename added to num_peers

* update Substrate

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: parity-processbot <>
2021-10-08 16:12:57 +00:00
André Silva 9bdded5fe4 Companion for substrate#9448 (#3527)
* Companion for substrate#9448

* fix on_disabled

* use temporary beefy branch

* revert beefy updates

* update Substrate

Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: parity-processbot <>
2021-10-06 17:06:53 +00:00
Falco Hirschenberger 4b9fc6460e Add call-decoding weight to benchmarks (#3866)
* Add add call-decoding weight to benchmarks

fixes #3864

* Change order as suggested by @thiolliere

* More reordering as @KiChjang suggested

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_common::claims --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_common_claims.rs

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_common::claims --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_common_claims.rs

Co-authored-by: Parity Bot <admin@parity.io>
2021-10-06 10:15:19 +00:00
Zeke Mostov dc38cf8959 Add benchmarking to rococo; Remove weights from runtime_parachains (#3914)
* Add benchmarking to rococo; Remove weights from runtime_parachains

* cargo run --quiet --release --features runtime-benchmarks -- benchmark --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtime/rococo/src/weights/runtime_parachains_paras.rs --header=./file_header.txt

* Impl TestWeightInfo for Paras and Configuration

* fmt

* cargo run --quiet --release --features runtime-benchmarks -- benchmark --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::configuration --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtime/rococo/src/weights/runtime_parachains_configuration.rs --header=./file_header.txt

* Fix CI complaint: error: unused variable: `c`

* polkadot-runtime-common & polkadot-test-runtime compile

* xcm-simulator compile

* change TestWeightInfo to max_block

* cargo run --quiet --release --features runtime-benchmarks -- benchmark --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtime/rococo/src/weights/runtime_parachains_paras.rs --header=./file_header.txt

* ordering

* cargo run --quiet --release --features runtime-benchmarks -- benchmark --chain=rococo-dev --steps=50 --repeat=20 --pallet=runtime_parachains::paras --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./runtime/rococo/src/weights/runtime_parachains_paras.rs --header=./file_header.txt

* Replace max_block with Weight::MAX

Co-authored-by: Parity Bot <admin@parity.io>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
2021-10-06 09:38:29 +00:00
Shawn Tabrizi bc7326383d individual benchmark tests (#4018) 2021-10-05 15:53:20 -04:00
Shawn Tabrizi d6d37621b0 Allow an Offset to Lease Periods (#3980)
* add slot offset for slots

* trying things out

* fix test

* improve api to return the first block of a new lease period

* add an integration test with offset

* de-duplicate test

* hide lease period_period_length from public api

* fix benchmarks

* Update runtime/common/src/slots.rs

* support the exact same range of crowdloans

* fix docs

* fix docs again

* introduce offset to runtimes

* fix and check edge case w/ offset and lease period first block

* remove newline

* turn into an option

* fix benchmarks

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2021-10-05 09:07:47 -05:00