Commit Graph

2125 Commits

Author SHA1 Message Date
Robert Klotzner e3340e44b5 Dispute distribution guide (#3158)
* Dispute distribution initial design.

* WIP.

* Dispute distribution guide update.

* Make invalid statement include `InvalidStatementKind`.

* Clarify the scope of disputes.

* A few fixes + introduced back pressure oneshot.

* Fixes and spam protection WIP.

* More spam considerations.

* More fixes.

* Fixes + add note about not dispute participating nodes.
2021-06-22 18:23:53 -05:00
dependabot[bot] 7880190415 Bump paste from 1.0.4 to 1.0.5 (#3340)
Bumps [paste](https://github.com/dtolnay/paste) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/dtolnay/paste/releases)
- [Commits](https://github.com/dtolnay/paste/compare/1.0.4...1.0.5)

---
updated-dependencies:
- dependency-name: paste
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-22 11:34:40 +00:00
dependabot[bot] 23f1b8ee37 Bump rand_chacha from 0.3.0 to 0.3.1 (#3225)
Bumps [rand_chacha](https://github.com/rust-random/rand) from 0.3.0 to 0.3.1.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/rand_chacha-0.3.0...rand_chacha-0.3.1)

---
updated-dependencies:
- dependency-name: rand_chacha
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-22 13:21:56 +02:00
Arkadiy Paronyan 0225640d62 Fast sync companion PR (#3078)
* Fixed build

* Bumped trie-db

* update Substrate

* impl-guide: fix broken links

Co-authored-by: parity-processbot <>
Co-authored-by: Andronik Ordian <write@reusable.software>
2021-06-22 10:48:39 +00:00
Andronik Ordian ffc6f7c731 make ctx.spawn blocking (#3337)
* make spawn sync

* improve error type
2021-06-21 20:43:40 -05:00
Bastian Köcher 9fa5d28e0b Only fetch one collation at a time per relay parent (#3333)
* Only fetch one collation at a time per relay parent

Before a validator would fetch all collations that were advertised to
him. This pr changes the behavior to always just fetch one collation at
a time. If fetching fails, the validator will start fetching one of the
other collations.

* Use enum to be more explicit

* Review comments
2021-06-21 19:51:31 +00:00
Bastian Köcher 3d2931ace5 Remove the streamunordered crate (#3339)
The functionality is now provided by the `futures` crate.
2021-06-21 19:48:33 +00:00
Robert Habermeier 74baed8b39 Chain Selection Subsystem Logic (#3277)
* crate skeleton and type definitions

* add ChainSelectionMessage

* add error type

* run loop

* fix overseer

* simplify determine_new_blocks API

* write an overlay struct and fetch new blocks

* add new function to overlay

* more flow

* add leaves to overlay and add a strong type around leaves-set

* add is_parent_viable

* implement block import, ignoring reversions

* add stagnant-at to overlay

* add stagnant

* add revert consensus log

* flow for reversions

* extract and import block reversions

* recursively update viability

* remove redundant parameter from WriteBlockEntry

* do some removal of viable leaves

* address grumbles

* refactor

* address grumbles

* add comment about non-monotonicity

* extract backend to submodule

* begin the hunt for viable leaves

* viability pivots for updating the active leaves

* remove LeafSearchFrontier

* partially -> explicitly viable and untwist some booleans

* extract tree to submodule

* implement block finality update

* Implement block approval routine

* implement stagnant detection

* ensure blocks pruned on finality are removed from the active leaves set

* write down some planned test cases

* floww

* leaf loading

* implement best_leaf_containing

* write down a few more tests to do

* remove dependence of tree on header

* guide: ChainApiMessage::BlockWeight

* node: BlockWeight ChainAPI

* fix compile issue

* note a few TODOs for the future

* fetch block weight using new BlockWeight ChainAPI

* implement unimplemented

* sort leaves by block number after weight

* remove warnings and add more TODOs

* create test module

* storage for test backend

* wrap inner in mutex

* add write waker query to test backend

* Add OverseerSignal -> FromOverseer conversion

* add test harnes

* add no-op test

* add some more test helpers

* the first test

* more progress on tests

* test two subtrees

* determine-new-blocks: cleaner genesis avoidance and tighter ancestry requests

* don't make ancestry requests when asking for one block

* add a couple more tests

* add to AllMessages in guide

* remove bad spaces from bridge

* compact iterator

* test import with gaps

* more reversion tests

* test finalization pruning subtrees

* fixups

* test clobbering and fix bug in overlay

* exhaustive backend state after finalizaiton tested

* more finality tests

* leaf tests

* test approval

* test ChainSelectionMessage::Leaves thoroughly

* remove TODO

* avoid Ordering::is_ne so CI can build

* comment algorithmic complexity

* Update node/core/chain-selection/src/lib.rs

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
2021-06-21 17:39:43 +00:00
Shawn Tabrizi 6b1baba490 Use max_code_size and max_wasm_data_size from Parachains Configuration (#3329)
* use `configuration::config()` for max bytes

* Update integration_tests.rs

* Update paras_registrar.rs

* remove consts

* add asserts for non-zero

* more const clean up

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

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

* add checks to `MAX_CODE_SIZE`

* re-pot MAX_POV_SIZE

* check pov limit in runtime

* POV_BOMB_LIMIT multiplier

* fix compile

* Update configuration.rs

* Update node/primitives/src/lib.rs

* fix test

Co-authored-by: Parity Bot <admin@parity.io>
2021-06-21 17:24:49 +00:00
Alexander Popiak 45ed52a273 Export fungibles_adapter Types (#3334)
* export fungibles_adapter types

* formatting
2021-06-21 17:09:54 +01:00
Andronik Ordian e74181b16f disable approval-checking voting rule (#3321) 2021-06-20 20:46:04 +00:00
Andronik Ordian 20d9ed06d6 downgrade a warn log to debug (#3319)
* downgrade to debug

* another thick log

* bump spec versions in kusama, polkadot and westend again IV
2021-06-20 16:15:13 +00:00
André Silva fc7f6dbfd9 Companion for substrate#9128 (#3268)
* support async selectchain

* update Substrate

Co-authored-by: parity-processbot <>
2021-06-20 11:39:20 +00:00
dependabot[bot] 03813cdc10 Bump kvdb-rocksdb from 0.11.0 to 0.11.1 (#3315)
Bumps [kvdb-rocksdb](https://github.com/paritytech/parity-common) from 0.11.0 to 0.11.1.
- [Release notes](https://github.com/paritytech/parity-common/releases)
- [Commits](https://github.com/paritytech/parity-common/compare/kvdb-rocksdb-v0.11.0...kvdb-rocksdb-v0.11.1)

---
updated-dependencies:
- dependency-name: kvdb-rocksdb
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-20 03:22:08 +02:00
Robert Habermeier 1225963dea Improvements to determine_new_blocks (#3313)
* determine-new-blocks: cleaner genesis avoidance and tighter ancestry requests

* don't make ancestry requests when asking for one block
2021-06-19 19:59:32 -05:00
André Silva 85936d2862 Companion for substrate#9138 (#3294)
* fix babe params

* update Substrate

Co-authored-by: parity-processbot <>
2021-06-19 21:08:00 +00:00
dependabot[bot] a5c6d30ccd Bump env_logger from 0.8.2 to 0.8.4 (#3298)
Bumps [env_logger](https://github.com/env-logger-rs/env_logger) from 0.8.2 to 0.8.4.
- [Release notes](https://github.com/env-logger-rs/env_logger/releases)
- [Changelog](https://github.com/env-logger-rs/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/env-logger-rs/env_logger/compare/v0.8.2...v0.8.4)

---
updated-dependencies:
- dependency-name: env_logger
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-19 22:53:16 +02:00
Andronik Ordian 71c5017967 network-bridge: remove action_sink abstraction (#3308)
* network-bridge: remove action_sink abstraction

* another wtf

* filter out event stream

* Revert "filter out event stream"

This reverts commit 63bd8f5de5b44d415dcb205e1b9fad8145200e06.

* retain cleanup though
2021-06-19 21:08:15 +02:00
Robert Habermeier b70da7bff7 Block weight ChainAPI (#3301)
* guide: ChainApiMessage::BlockWeight

* node: BlockWeight ChainAPI

* fix compile issue

* implement ChainApi::BlockWeight

* add test for ChainApi::BlockWeight

* update substrate

Co-authored-by: André Silva <andrerfosilva@gmail.com>
2021-06-19 19:19:07 +02:00
Andreas Doerr be2d1ce01b Bump BEEFY (#3302) 2021-06-19 17:46:06 +02:00
Shawn Tabrizi 039df45f00 New Weights for Polkadot / Kusama / Westend (#3305) 2021-06-19 07:08:05 +02:00
Lldenaurois 5c16c95bd5 Follow-up PR: Count no-shows (#3309)
* node/approval-voting: test for invalid validator index in assignments

This commit adds a unit test to show that, currently, validator indexes
greater than n_validators (or the length of the approvals bitvector) are
counted in n_assignments. In the subsequent commit we will correct this
behavior.

* node/approval-voting: ignore invalid validator indexes in n_assignments

This commit ignores any validator assignments whose index is beyond
n_validators. Without this check, an improperly crafted assignment would
be counted towards the approval.

It still remains that n_assignments and count_no_shows inspect the
number of validators and approvals, respectively. Ideally we would
add greater safety around ensuring these two values cannot differ.
2021-06-19 00:27:02 +00:00
Andronik Ordian ad9c02886d improved gossip topology (#3270)
* gossip-support: gossip topology

* some fixes

* handle view update for newly added gossip peers

* fix neighbors calculation

* fix test

* resolve TODOs

* typo

* guide updates

* spaces in the guide

* sneaky spaces

* hash randomness

* address some review nits

* use unbounded in bridge for subsystem msg
2021-06-18 14:30:35 -05:00
Kian Paimani ae5b355754 Set new staking limits (#3299)
* Set staking limits

* Set westend limits as well

* Update runtime/kusama/src/lib.rs

Co-authored-by: Gavin Wood <gavin@parity.io>

Co-authored-by: Gavin Wood <gavin@parity.io>
2021-06-18 13:16:26 +01:00
dependabot[bot] dc286de7af Bump derive_more from 0.99.11 to 0.99.14 (#3248)
Bumps [derive_more](https://github.com/JelteF/derive_more) from 0.99.11 to 0.99.14.
- [Release notes](https://github.com/JelteF/derive_more/releases)
- [Changelog](https://github.com/JelteF/derive_more/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JelteF/derive_more/compare/v0.99.11...v0.99.14)

---
updated-dependencies:
- dependency-name: derive_more
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-18 07:28:26 +02:00
Robert Habermeier 7dbf971054 add revert consensus log (#3275) 2021-06-17 16:35:56 -05:00
Hernando Castano 9887b49e8c Add bridge team as codeowners of bridges Subtree (#3291) 2021-06-17 17:13:40 -04:00
Lldenaurois f8ed46f455 Extract and test count_no_shows method for approval voting (#3264)
* node/approval-voting: extract and test count_no_shows method

This commit extracts no_show computation into a pure function so that it can be
extensively unit tested.

* node/approval-voting: ignore invalid validator indexes in count_no_show

Previously indexes that were past the length of the approvals bitvector
would contribute to the no_show count or the next_no_show value. This
commit changes the behavior to ignore garbage values.

* node/approval-voting: add comment for next_no_show adding clock_drift
2021-06-17 21:05:18 +00:00
Andronik Ordian 325cc888b1 cleanup more tests and spaces (#3288)
* cleanup more tests and spaces

* oops
2021-06-17 17:28:10 +00:00
Zeke Mostov 6f8c8ec387 Companion #9019 (max rpc payload override) (#3276)
* Companion #9019 (max rpc payload override)

* update Substrate

Co-authored-by: parity-processbot <>
2021-06-17 15:14:06 +00:00
Robert Habermeier 9c7a346e4c Implementers' Guide: Chain Selection (#3262)
* high-level discussion of fork-choice and chain selection

* notes on chain-selection subsystem

* send `Approve` messages from approval-voting

* remove references to candidate-selection

* adjust grandpa voting rule docs

* Update roadmap/implementers-guide/src/node/grandpa-voting-rule.md

Co-authored-by: Lldenaurois <ljdenaurois@gmail.com>

* Update roadmap/implementers-guide/src/protocol-chain-selection.md

Co-authored-by: Lldenaurois <ljdenaurois@gmail.com>

* Update roadmap/implementers-guide/src/protocol-chain-selection.md

Co-authored-by: Lldenaurois <ljdenaurois@gmail.com>

Co-authored-by: Lldenaurois <ljdenaurois@gmail.com>
2021-06-17 15:10:23 +00:00
Bastian Köcher 4c6dc182b2 CLI: Add missing feature checking and check if someone passes a file (#3283) 2021-06-17 16:52:36 +02:00
Shaun Wang d8dc0f8778 Export 'TakeRevenue' trait. (#3278) 2021-06-17 14:20:40 +00:00
Shawn Tabrizi 29fa0a369d Add XCM Decode Limit (#3273)
* Add XCM Decode Limit of 256

* use `decode_all_*`

* Update xcm/src/double_encoded.rs
2021-06-17 11:51:36 +00:00
Shawn Tabrizi b5b42c94b7 Allow Council to Use Scheduler (#3237)
* Allow council to use scheduler

* westend doesnt have council
2021-06-17 09:03:10 +00:00
Shawn Tabrizi 0282ad3128 fix xcm pallet origin (#3272) 2021-06-16 21:57:29 +01:00
Robert Habermeier 462ca043e5 extract determine_new_blocks into a separate utility (#3261)
* extract determine_new_blocks into a separate utility

* rework docs
2021-06-16 14:10:50 -05:00
Lldenaurois 0da70dfa88 Approval checking unit tests (#3252)
* node/approval_checking: break out filled_tranch_iterator method

In the subsequent commit, we will begin to test this method in
isolation.

* node/approval-voting: fix tranche back-filling algorithm

Previously, this algorithm would generate duplicate, empty entries for
tranches (1..pre_end). This is caused because the initial value (0) for
gap_end is treated as the end of a prior tranche that wasn't actually
processed. The first pass thus would add (1..tranche) empty entries, in
addition to the (0..pre_end) empty entries chained at the end of the
method.

This is fixed by using the current tranche as the gap_start for the
first iteration, ensuring that the approval_entries_filled only produces
entries in the range (pre_end..post_start).

* Address feedback
2021-06-16 17:24:12 +00:00
André Silva 4b3ec9c97d bridges: update finality-grandpa to 0.14.1 (#3266)
* bridges: update finality-grandpa

* update Substrate

Co-authored-by: parity-processbot <>
2021-06-16 13:23:39 +00:00
Bernhard Schuster 44a8aa23d5 malus - mockable overseer mvp (#3224) 2021-06-16 12:45:21 +02:00
Shawn Tabrizi b64d9885ad use safe math (#3249) 2021-06-16 10:19:41 +00:00
Shawn Tabrizi 2fbd705ed5 Companion for #8920 (Control Staking) (#3260)
* update weight apis

* update Substrate

Co-authored-by: parity-processbot <>
2021-06-16 09:17:26 +02:00
Keith Yeung 7d82d93f34 Companion for #8949 (#3216)
* Remove Call part imports of the offences and authority discovery pallets

* Remove non-existent Call enum variants

* Move ValidateUnsigned impl to be under #[pallet::validate_unsigned] in claims pallet

* Remove unused imports

* Remove Call part import for randomness collective flip pallet

* update Substrate

Co-authored-by: parity-processbot <>
2021-06-16 04:13:21 +00:00
Robert Habermeier 28ecc38646 Drop guard for detecting stale approvals (#3251)
* Drop guard for detecting stale approvals

* address nits with different API
2021-06-15 16:09:03 +00:00
Shawn Tabrizi da71128daf Companion for #9106 (remove_all with size limit) (#3257)
* update apis

* fix api

* rename to `KillStorageResult`

* update Substrate

Co-authored-by: parity-processbot <>
2021-06-15 13:52:54 +00:00
Martin Pugh 396b38b355 Bump version, spec_version & substrate in prep for release v0.9.5 (#3238)
* bump spec_version and version

* bump substrate

* remove migrations

* Revert "remove migrations"

This reverts commit ceeab924d1cd5c2d3d05f24ab28315f0566f89d8.

* remove stale migration for kusama + westend
2021-06-14 23:10:45 +02:00
André Silva d8d61bad36 implement dispute participation subsystem (#3234)
* implement dispute participation subsystem

* guide: minor fix in dispute participation

* Update node/core/dispute-participation/src/lib.rs

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

* dispute: add comments to participation logic

* dispute-coordinator: fix test compilation

* implementers-guide: update dispute participation

* dispute-participation: add error for missing validation code

* dispute-participation: add tests

* Update node/core/dispute-participation/src/lib.rs

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>

* guide: update overseer protocol dispute participation message

* dispute-participation: remove duplication in tests

Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2021-06-14 15:41:02 -05:00
Shawn Tabrizi 2a792b48e7 FallbackStrategy::Nothing (#3088) 2021-06-14 19:10:41 +00:00
Guillaume Thiolliere 364a8d751d fix test (#3240) 2021-06-14 12:56:36 -05:00
Robert Habermeier faf42fc29d Better metrics for approval voting (#3247)
* add more information about what's happening during approval work

* record assignment tranches in histogram
2021-06-14 17:28:22 +00:00