Commit Graph

7697 Commits

Author SHA1 Message Date
Ross Bulat 197b8d6571 add claim_commission weight (#13774) 2023-04-01 17:19:12 +00:00
PG Herveou 8d802eece0 contracts: make test work with debugger (#13776)
* contracts: make test work with debugger

* fix path

* PR review

* Add comment

* space

* Update frame/contracts/src/tests.rs

* lint

* spelling
2023-03-31 19:44:29 +02:00
asynchronous rob 2a44372ea1 Refactor: extract most aura logic out to standalone module, make use of these (#13764)
* Extract most aura logic out to standalone module, make use of these

* Update client/consensus/aura/src/standalone.rs

improve docs

Co-authored-by: Bastian Köcher <git@kchr.de>

* add slot_duration_at

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: parity-processbot <>
2023-03-31 14:00:07 +02:00
PG Herveou 1bd5d2f78d [Contracts] Overflowing bounded DeletionQueue allows DoS against contract termination (#13702)
* [Contracts review] Overflowing bounded `DeletionQueue` allows DoS against contract termination

* wip

* wip

* wip

* wip

* wip

* fix doc

* wip

* PR review

* unbreak tests

* fixes

* update budget computation

* PR comment: use BlockWeights::get().max_block

* PR comment: Update queue_trie_for_deletion signature

* PR comment: update deletion budget docstring

* PR comment: impl Default with derive(DefaultNoBound)

* PR comment: Remove DeletedContract

* PR comment Add ring_buffer test

* remove missed comment

* misc comments

* contracts: add sr25519_recover

* Revert "contracts: add sr25519_recover"

This reverts commit d4600e00934b90e5882cf5288f36f98911b51722.

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts

* PR comments update print_schedule

* Update frame/contracts/src/benchmarking/mod.rs

* Update frame/contracts/src/storage.rs

* Update frame/contracts/src/storage.rs

* rm temporary fixes

* fix extra ;

* Update frame/contracts/src/storage.rs

Co-authored-by: juangirini <juangirini@gmail.com>

* Update frame/contracts/src/storage.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Update frame/contracts/src/lib.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Update frame/contracts/src/lib.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* Support stable rust for compiling the runtime (#13580)

* Support stable rust for compiling the runtime

This pull request brings support for compiling the runtime with stable Rust. This requires at least
rust 1.68.0 to work on stable. The code is written in a way that it is backwards compatible and
should automatically work when someone compiles with 1.68.0+ stable.

* We always support nightlies!

* 🤦

* Sort by version

* Review feedback

* Review feedback

* Fix version parsing

* Apply suggestions from code review

Co-authored-by: Koute <koute@users.noreply.github.com>

---------

Co-authored-by: Koute <koute@users.noreply.github.com>

* github PR commit fixes

* Revert "Support stable rust for compiling the runtime (#13580)"

This reverts commit 0b985aa5ad114a42003519b712d25a6acc40b0ad.

* Restore DeletionQueueMap

* fix namings

* PR comment

* move comments

* Update frame/contracts/src/storage.rs

* Update frame/contracts/src/storage.rs

* fixes

---------

Co-authored-by: command-bot <>
Co-authored-by: juangirini <juangirini@gmail.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Koute <koute@users.noreply.github.com>
2023-03-31 11:03:56 +00:00
Javier Viola 2f3a8b9e38 bump zombienet version (#13772) 2023-03-30 23:01:50 +02:00
Bastian Köcher 5d5cc9a007 sp-runtime-interface-test: Fix flaky test (#13770) 2023-03-30 21:31:08 +02:00
Kian Paimani 95da8d7ace Fix nomiantion pools doc render (#13748)
Co-authored-by: parity-processbot <>
2023-03-30 16:50:45 +02:00
Adrian Catangiu 92c1229e24 BEEFY: gossip finality proofs (#13727)
* sc-consensus-beefy: add justifications to gossip protocol

* sc-consensus-beefy: voter gossips finality proofs

* sc-consensus-beefy: add finality proof gossip test

* sc-consensus-beefy: always gossip finality proof

Gossip finality proof in _both_ cases of reaching finality threshold
through votes:
1. threshold reached through self vote,
2. threshold reached through incoming vote.

* address comments
2023-03-30 17:23:36 +03:00
Alexander Theißen 25a616ce08 Build wasm for mvp cpu (#13758) 2023-03-30 16:20:12 +02:00
Roman Useinov cc3152bc2f [Enhancement] Throw an error when there are too many pallets (#13763)
* [Enhancement] Throw an error when there are too many pallets

* fix ui test

* fix PR comments

* Update frame/support/procedural/src/construct_runtime/mod.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update frame/support/procedural/src/construct_runtime/mod.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: command-bot <>
2023-03-30 14:53:47 +02:00
Aaro Altonen 4240490d1d Attempt to relieve pressure on mpsc_network_worker (#13725)
* Attempt to relieve pressure on `mpsc_network_worker`

`SyncingEngine` interacting with `NetworkWorker` can put a lot of strain
on the channel if the number of inbound connections is high. This is
because `SyncingEngine` is notified of each inbound substream which it
then can either accept or reject and this causes a lot of message
exchange on the already busy channel.

Use a direct channel pair between `Protocol` and `SyncingEngine`
to exchange notification events. It is a temporary change to alleviate
the problems caused by syncing being an independent protocol and the
fix will be removed once `NotificationService` is implemented.

* Apply review comments

* fixes

* trigger ci

* Fix tests

Verify that both peers have a connection now that the validation goes
through `SyncingEngine`. Depending on how the tasks are scheduled,
one of them might not have the peer registered in `SyncingEngine` at which
point the test won't make any progress because block announcement received
from an unknown peer is discarded.

Move polling of `ChainSync` at the end of the function so that if a block
announcement causes a block request to be sent, that can be sent in the
same call to `SyncingEngine::poll()`.

---------

Co-authored-by: parity-processbot <>
2023-03-30 11:59:58 +00:00
Davide Galassi 7985495b8c Application Crypto cleanup (#13746)
* Adjust application crypto docs

* Blanket implementation for 'RuntimeAppPublic' trait

* Blanket implementation for 'BoundToRuntimeAppPublic' for 'RuntimeAppPublic'

* Relax type bounds

* Docs fix

* restore MaybeHash

* Commit suggestion

Co-authored-by: Anton <anton.kalyaev@gmail.com>

---------

Co-authored-by: Anton <anton.kalyaev@gmail.com>
2023-03-30 10:30:35 +02:00
Davide Galassi 29e31f2b0a Generic keystore internals (#13749)
* Generic testing keystore internals

* Generic local keystore internals

* Restore deleted comment
2023-03-30 01:22:34 +02:00
Roman Useinov c91b5b5b21 [Fix] Bump tuple element number in frame-support. (#13760)
That is to avoid hitting the pallet limit that emits a cryptic error. More detail could be found here: https://substrate.stackexchange.com/questions/7212 .

Co-authored-by: parity-processbot <>
2023-03-29 20:30:15 +00:00
Mira Ressel 212d6a5a6f Clean up after debian 11 rollout (#13762)
This reverts commit 86d638d08f.
2023-03-29 20:25:41 +02:00
Michal Kucharczyk 469726ee74 proc-macro: check for non-args runtime calls added (#13742)
* proc-macro: check for non-args runtime calls added

* Update primitives/api/proc-macro/src/impl_runtime_apis.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: parity-processbot <>
2023-03-29 14:54:02 +00:00
Davide Galassi c32b240df0 Swap 'base58' with 'bs58' (#13739)
* Swap base58 with bs58

* Removed unused clone

* std flag
2023-03-29 15:46:05 +02:00
Mira Ressel 86d638d08f roll out new debian 11 ci image (#13744) 2023-03-29 15:27:40 +02:00
Mira Ressel f843b7f447 provide a default value for RELENG_SCRIPTS_BRANCH (#13743)
Currently this variable is configured exclusively via a project
variable, which makes it impossible to override for specific test prs.
2023-03-29 12:27:48 +02:00
Bastian Köcher d338e9a114 Support stable rust for compiling the runtime (#13580)
* Support stable rust for compiling the runtime

This pull request brings support for compiling the runtime with stable Rust. This requires at least
rust 1.68.0 to work on stable. The code is written in a way that it is backwards compatible and
should automatically work when someone compiles with 1.68.0+ stable.

* We always support nightlies!

* 🤦

* Sort by version

* Review feedback

* Review feedback

* Fix version parsing

* Apply suggestions from code review

Co-authored-by: Koute <koute@users.noreply.github.com>

---------

Co-authored-by: Koute <koute@users.noreply.github.com>
2023-03-29 07:17:50 +00:00
Kasper Ziemianek acec84cc1e contracts: proper event link in docs (#13729) 2023-03-28 16:38:13 +02:00
Vladimir Istyufeev 9c9492476c CI: rephrase RUSTFLAGS (#13735) 2023-03-28 15:41:10 +04:00
Sebastian Kunert c41eadc090 Remove HeaderBackend requirement from AuthorityDiscovery and NetworkWorker (#13730)
* Remove `HeaderBackend` requirement from `NetworkWorker`

* Remove HeaderBackend from authority-discovery
2023-03-28 07:10:50 +00:00
Vladimir Istyufeev 551367d4cb CI: Investigate why RUSTFLAGS differs on master and PRs (#13686) 2023-03-28 04:00:18 +04:00
Joyce Siqueira 7c18bc9dfd updating labels descriptions (#13557)
* updating labels descriptions

* delete milestones

* Update docs/CONTRIBUTING.adoc

Co-authored-by: Bastian Köcher <git@kchr.de>

* link to label docs

* Update docs/CONTRIBUTING.adoc

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: parity-processbot <>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-03-27 23:27:16 +02:00
Aaron Bassett a59ea80cec Change license of node-template and FRAME examples to MIT-0 (#13465)
* Change node-template license from Unlicense to MIT-0

* Change frame examples license from Unlicense to MIT-0

* Update bin/node-template/LICENSE

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
2023-03-27 22:36:20 +02:00
PG Herveou 836f544c86 contracts: Add host function tracing (#13648) 2023-03-27 19:33:59 +02:00
Ross Bulat 39e5548c66 Reward pool migration fix (#13715)
* reward pool migration fix

* comment

* remove generic

* rm max

* foramtting

* Add note to V4 migration

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

* Add more asserts to the V5 migration

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

* Make compile

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

* Update frame/nomination-pools/src/migration.rs

Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>

* Make V4 migration re-usable

Otherwise it wont chain together with the V5.

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

* Add MigrateV3ToV5 wrapper

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

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
2023-03-27 15:02:03 +00:00
Aaron Bassett 1fad957deb Update pallet licenses to Apache-2.0 (#13467) 2023-03-27 14:03:04 +00:00
Gavin Wood a3b1c1d941 FRAME: Fix the Referenda confirming alarm (#13704)
* Fix the Referenda confirming alarm

* Add minimal regression test

This fails on 40e1704e1c since the
downwards rounding voids the curve delay.

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

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-03-27 12:04:24 +00:00
Bastian Köcher f5e257298a sc-slots: Forward block size limit (#13716) 2023-03-27 09:50:31 +02:00
Mira Ressel 6213161e33 add a new ci job to fuzz sp-arithmetic (#13673)
as requested in https://github.com/paritytech/ci_cd/issues/761
2023-03-27 07:23:53 +02:00
yjh 3a3905ccb1 chore(sc-cli): improve runner and signals (#13688)
* chore(sc-cli): improve runner and signals

* Update client/cli/src/runner.rs

* fmt

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
2023-03-26 22:07:17 +00:00
Oliver Tale-Yazdi 0043ff00e2 Fix failing offences bench test (#13712)
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-03-25 15:59:31 +00:00
Harald Heckmann 22027135eb Emit event when changing total locked value in pallet-balances (#12287)
* Emit Locked/Unlocked events

* Implement lock event tests

* Adhere to style guide

* Use saturating math

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

* Fix typo

* Emit event on change locks and add tests

* Adjust event docstring

---------

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: parity-processbot <>
2023-03-25 00:53:18 +01:00
Aaro Altonen cef4b363c3 Get the correct number of connected peers in SyncState (#13700)
`Protocol` is not a reliable source for the information of connected
peers because it doesn't have real-time information of the actual
connectivity state because it's not resposible for accepting/rejecting
connections and gets that information with delay from `SyncinEngine`.
2023-03-25 00:47:28 +01:00
Davide Galassi 4eae8dc1cd Fix docs (#13709) 2023-03-24 23:54:32 +01:00
Mira Ressel 8ead950c9d bump timestamp script to v0.2 (#13710) 2023-03-25 01:00:48 +04:00
Bastian Köcher 685b43c3fc try-runtime: Use configured wasm execution method (#13694)
* try-runtime: Use configured wasm execution method

* Fix compilation
2023-03-24 17:50:16 +00:00
Gavin Wood ccc614979a Make ED of zero (kind of) work (#13655)
* Minimum of 1 for ED

* Avoid need for ED to be minimum one

* Docs

* Ban ED of zero unless feature enabled

* use integrity_test

* Docs

* Cleanup

* Update frame/balances/Cargo.toml

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/balances/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/balances/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Ensure dodgy code is disabled by default

* zero_ed -> insecure_zero_ed

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
2023-03-24 17:48:21 +00:00
Oliver Tale-Yazdi c6a9b81fad try-runtime: run migration checks per default (#13684)
* try-runtime: run migration checks per default

The current behaviour of having to explicetly specify --checks seems
to cause confusion. Therefore bringing back the old behaviour of
running the pre- and post-upgrade checks per default.

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

* Fix docs

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

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-03-24 15:09:34 +00:00
Gavin Wood 2c77f8f4ca Use sensible maths for from_rational (#13660)
* Use sensible maths for from_rational

* Fixes

* Fixes

* More fixes

* Remove debugging

* Add fuzzer tests

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

* Prevent panics

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

* docs

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

* Clean up old code

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

* Test all rounding modes of from_rational

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

* Clean up code

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

* Revert "Prevent panics"

This reverts commit 7e88ac76138a1b590e68b68318505b69efe1e1f6.

* fix imports

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

* cleanup

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

* Fuzz test multiply_rational

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

* Fix import

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

* fmt

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

* Return None in multiply_rational on zero div

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

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-03-24 14:48:37 +00:00
Davide Galassi 40e1704e1c Keystore overhaul (final) (#13683)
* Introduce keystore specialized sign methods

* Get rid of 'AppKey::UntypedGeneric' associated type.

Untyped generics are accessible using associated types 'Generic' associated type.
I.e. <T as AppKey>::Public::Generic

* Get rid of 'CryptoTypePublicPair'

* Trivial fix

* Small refactory of local keystore implementations

* Remove 'crypto_id' method from 'Public'

* Trivial rename of 'AppKey' to 'AppCrypto'

* Remove unused import

* Improve docs

* Better signature related errors for authority-discovery

* Apply review suggestion

* Apply review suggestions

Co-authored-by: Koute <koute@users.noreply.github.com>

* Authority discoverty signing error revisited

* Signing error revisited for babe and aura as well

* Further cleanup

---------

Co-authored-by: Koute <koute@users.noreply.github.com>
2023-03-24 13:46:02 +00:00
Oliver Tale-Yazdi 370e71cb20 Remove Weight::without_{ref_time, proof_size} (#13637)
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-03-23 17:09:29 +00:00
Alexandru Vasile 30122da07a chain_head/tests: Check finalized block event before new block (#13680)
* chain_head/tests: Mock client for custom block notification

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* chain_head/tests: Check finalized block event before new block

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update client/rpc-spec-v2/src/chain_head/test_utils.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/rpc-spec-v2/src/chain_head/test_utils.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Update client/rpc-spec-v2/src/chain_head/test_utils.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* chain_head/tests: Run import events with 10min timeout

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* chain_head/tests: Add comments about test

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
2023-03-23 15:40:02 +02:00
Sebastian Kunert 7bd3f3d762 Remove unused light-client leftover (#13687)
* Remove unused light-client leftover

* Remove more unused code
2023-03-23 11:35:39 +01:00
Bastian Köcher 080990051c Remove unused trait (#13682) 2023-03-22 20:46:35 +01:00
Kasper Ziemianek be734195c3 GetCallIndex trait (#13558)
* GetCallIndex trait

* final impl

* ".git/.scripts/commands/fmt/fmt.sh"

* Docs

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

* One more test

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

* Doc

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

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
2023-03-22 12:13:31 +00:00
Alexandru Vasile c2f32c9cbd fix/chain_head: Ensure correct events for finalized branch (#13632)
* chain_head/follow: Ensure correct events for finalized branch

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Reenable tests

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Do some clean ups and add some more docs

* Fix gramatic

* Update client/rpc-spec-v2/src/chain_head/chain_head_follow.rs

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>

* rpc/chain_head: Introduce error for absent headers

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: Bastian Köcher <info@kchr.de>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
2023-03-22 12:52:10 +02:00
Liam Aharon f1f2f617e8 Fix try_runtime_cli doc broken links (#13672) 2023-03-22 21:47:44 +11:00