Commit Graph

4187 Commits

Author SHA1 Message Date
Gavin Wood 7a8673f057 Tweak poll end block (#1397) 2020-07-13 13:08:32 +02:00
Gavin Wood 97acfa76d1 Introduce polling pallet (#1391)
* Initial draft

* Initial build

* Integrate into runtime

* Fix warnings.

* Initial tests

* Fixes and tests

* Update runtime/polkadot/src/poll.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Expose End constant

* Docs

* Update runtime/polkadot/src/lib.rs

Co-authored-by: kaichao <kaichaosuna@gmail.com>

* Update runtime/polkadot/src/poll.rs

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

* Clean up filters

* Warnings

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: kaichao <kaichaosuna@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
2020-07-11 17:04:10 +02:00
Bastian Köcher 566281675b Revert log rotation (#1389)
* Revert log rotation

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

* 'Update substrate'

Co-authored-by: parity-processbot <>
2020-07-10 13:24:17 +02:00
Peter Goodspeed-Niklaus 3725bb6228 add more detail to provisioner block production section (#1370)
Per https://github.com/paritytech/polkadot/commit/f210456#r40392855
2020-07-10 08:36:38 +02:00
Joseph Mark 41afc0fcdf Add Process.toml (#1361)
* Add Process.toml

* Apply suggestions from code review

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2020-07-10 07:58:02 +02:00
Robert Habermeier 3b13cd9a85 Refactor primitives (#1383)
* create a v1 primitives module

* Improve guide on availability types

* punctuate

* new parachains runtime uses new primitives

* tests of new runtime now use new primitives

* add ErasureChunk to guide

* export erasure chunk from v1 primitives

* subsystem crate uses v1 primitives

* node-primitives uses new v1 primitives

* port overseer to new primitives

* new-proposer uses v1 primitives (no ParachainHost anymore)

* fix no-std compilation for primitives

* service-new uses v1 primitives

* network-bridge uses new primitives

* statement distribution uses v1 primitives

* PoV distribution uses v1 primitives; add PoV::hash fn

* move parachain to v0

* remove inclusion_inherent module and place into v1

* remove everything from primitives crate root

* remove some unused old types from v0 primitives

* point everything else at primitives::v0

* squanch some warns up

* add RuntimeDebug import to no-std as well

* port over statement-table and validation

* fix final errors in validation and node-primitives

* add dummy Ord impl to committed candidate receipt

* guide: update CandidateValidationMessage

* add primitive for validationoutputs

* expand CandidateValidationMessage further

* bikeshed

* add some impls to omitted-validation-data and available-data

* expand CandidateValidationMessage

* make erasure-coding generic over v1/v0

* update usages of erasure-coding

* implement commitments.hash()

* use Arc<Pov> for CandidateValidation

* improve new erasure-coding method names

* fix up candidate backing

* update docs a bit

* fix most tests and add short-circuiting to make_pov_available

* fix remainder of candidate backing tests

* squanching warns

* squanch it up

* some fallout

* overseer fallout

* free from polkadot-test-service hell
2020-07-09 21:23:03 -04:00
Andronik Ordian 6957847b6b Integrate all (dummy) subsystems with the Overseer (#1374)
* overseer: introduce a utility typemap

* it's ugly but it compiles

* move DummySubsystem to subsystem crate

* fix tests fallout

* use a struct for all subsystems

* more tests fallout

* add missing pov_distribution subsystem

* remove unused imports and bounds

* fix minimal-example
2020-07-09 16:25:40 -04:00
Fedor Sakharov c119627835 CandidateBackingSubsystem (#1312)
* Updates guide for CandidateBacking

* Move assignment types to primitives

* Initial implementation.

* More functionality

* use assert_matches

* Changes to report misbehaviors

* Some fixes after a review

* Remove a blank line

* Update guide and some types

* Adds run_job function

* Some comments and refactorings

* Fix review

* Remove warnings

* Use summary in kicking off validation

* Parallelize requests

* Validation provides local and global validation params

* Test issued validity tracking

* Nits from review
2020-07-09 16:23:58 -04:00
Bastian Köcher 54bace2b5d Companion for #6620 (#1386)
* Companiong for #6620

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

* 'Update substrate'

Co-authored-by: parity-processbot <>
2020-07-09 15:24:00 +00:00
Ashley 1c5f9b09ba Companion PR for ' Simplify a few chain components creation APIs related to the service' (#1384)
* Switch branch

* Fix service creation

* Revert "Switch branch"

This reverts commit a706335821eb1553e48f86e0b0c5b3c11d589a1d.

* Switch branch again

* Revert "Switch branch again"

This reverts commit 04afc5095e408ff9a116c526ef84f6b101482ee1.

* Update substrate branch
2020-07-09 16:59:58 +02:00
Robert Habermeier 8130d8210e Delay session changes' effects on parachains by 1 block (#1354)
* note that the initializer is responsible for buffering session changes

* amend initializer definition to include session change buffering

* support buffered changes before `on_initialize`

* implement and test session buffering

* Update roadmap/implementors-guide/src/runtime/README.md

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

* expand on how this affects misbehavior reports

* fix typo

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
2020-07-09 09:43:26 -04:00
Cecile Tonglet a4fa71ed17 Make a test crate to make the runtime-test usable (#1258)
Fixes #833
2020-07-09 15:12:52 +02:00
Pierre Krieger 8696788747 Remove AwaitCanceled (#1375) 2020-07-09 13:25:39 +02:00
Robert Habermeier 151d73af5b Implement PoV Distribution Subsystem (#1344)
* introduce candidatedescriptor type

* add PoVDistribution message type

* loosen bound on PoV Distribution to account for equivocations

* re-export some types from the messages module

* begin PoV Distribution subsystem

* remove redundant index from PoV distribution

* define state machine for pov distribution

* handle overseer signals

* set up control flow

* remove `ValidatorStatement` section

* implement PoV fetching

* implement distribution logic

* add missing `

* implement some network bridge event handlers

* stub for message processing, handle our view change

* control flow for handling messages

* handle `awaiting` message

* handle any incoming PoVs and redistribute

* actually provide a subsystem implementation

* remove set-builder notation

* begin testing PoV distribution

* test that we send awaiting messages only to peers with same view

* ensure we distribute awaited PoVs to peers on view changes

* test that peers can complete fetch and are rewarded

* test some reporting logic

* ensure peer is reported for flooding

* test punishing peers diverging from awaited protocol

* test that we eagerly complete peers' awaited PoVs based on what we receive

* test that we prune the awaited set after receiving

* expand pov-distribution in guide to match a change I made

* remove unneeded import
2020-07-08 18:15:39 -04:00
Gavin Wood f83ba174f1 Bump Substrate (#1382) 2020-07-08 18:48:48 +02:00
Pierre Krieger 647e303df5 Update the Kusama bootnode IDs (#1377) 2020-07-08 18:24:38 +02:00
Shawn Tabrizi 099e41dc9e Companion for #6575 (Add WeightInfo) (#1352)
* Add `WeightInfo`

* fix test

* fix tests

* fix more tests
2020-07-08 18:22:22 +02:00
Bastian Köcher 283ffd4ec4 Companion for #6599 (#1371)
* Companion for #6599

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

* Update Substrate ref
2020-07-08 16:15:59 +00:00
Bastian Köcher 51a698803c Use SpawnNamed to give tasks names (#1379) 2020-07-08 17:42:29 +02:00
Pierre Krieger fef3c181d9 Update to substrate#59ee76a0 (#1380) 2020-07-08 17:21:37 +02:00
pscott acb5875e85 Companion PR for #6564 (#1350)
* Add log_rotation_opt

* Update Cargo lock

* Use SubstrateCli's log-directory instead of re-defining it
2020-07-08 14:05:41 +02:00
Bastian Köcher 61ba45aaad Companion for #6584 (#1373)
* Companion for #6584

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

* updating sp-io

* Update dev-dependency, too

* update lockfile

Co-authored-by: Benjamin Kampmann <ben@gnunicorn.org>
2020-07-08 11:42:46 +02:00
Shaopeng Wang c9046d9686 Companion for #6500 (decl_module: frame_system as default ident) (#1314)
* Update decl_storage usage with frame_system as default ident.

* More decl_module usage update.

* 'Update substrate'

Co-authored-by: parity-processbot <>
2020-07-08 09:07:19 +02:00
Robert Habermeier 42bd096413 I am dumb and can't spell (#1366)
* rename implementor's guide to implementer's guide

* fix typos in more places
2020-07-07 10:10:36 -04:00
Bastian Köcher 37da08a764 Companion for #6589 (#1367)
https://github.com/paritytech/substrate/pull/6589
2020-07-07 12:06:57 +02:00
Peter Goodspeed-Niklaus f3c2db1a28 convert SignedAvailabilityBitfields from newtype to typedef (#1342)
Closes #1339.
2020-07-07 10:01:15 +02:00
Robert Habermeier ac8e1ca206 Implement the Statement Distribution Subsystem (#1326)
* set up data types and control flow for statement distribution

* add some set-like methods to View

* implement sending to peers

* start fixing equivocation handling

* Add a section to the statement distribution subsystem on equivocations and flood protection

* fix typo and amend wording

* implement flood protection

* have peer knowledge tracker follow when peer first learns about a candidate

* send dependents after circulating

* add another TODO

* trigger send in one more place

* refactors from review

* send new statements to candidate backing

* instantiate active head data with runtime API values

* track our view changes and peer view changes

* apply a benefit to peers who send us statements we want

* remove unneeded TODO

* add some comments and improve Hash implementation

* start tests and fix `note_statement`

* test active_head seconding logic

* test that the per-peer tracking logic works

* test per-peer knowledge tracker

* test that peer view updates lead to messages being sent

* test statement circulation

* address review comments

* have view set methods return references
2020-07-06 11:16:17 -04:00
Bastian Köcher 72d0f09659 Companion for #6576 (#1351)
* Companion for #6576

* 'Update substrate'

Co-authored-by: parity-processbot <>
2020-07-06 13:36:00 +02:00
Shawn Tabrizi 4af14c5191 Companion for #6567 (Benchmark Writer CLI) (#1349)
* Update usage of macro

* 'Update substrate'

* cargo update -p sp-io

Co-authored-by: parity-processbot <>
2020-07-06 10:06:02 +00:00
Peter Goodspeed-Niklaus f2104562d8 implement custom proposer (#1320)
* network bridge skeleton

* move some primitives around and add debug impls

* protocol registration glue & abstract network interface

* add send_msgs to subsystemctx

* select logic

* transform different events into actions and handle

* implement remaining network bridge state machine

* start test skeleton

* make network methods asynchronous

* extract subsystem out to subsystem crate

* port over overseer to subsystem context trait

* fix minimal example

* fix overseer doc test

* update network-bridge crate

* write a subsystem test-helpers crate

* write a network test helper for network-bridge

* set up (broken) view test

* Revamp network to be more async-friendly and not require Sync

* fix spacing

* fix test compilation

* insert side-channel for actions

* Add some more message types to AllMessages

* introduce a test harness

* impl ProvideInherent for InclusionInherent

* reduce import churn; correct expect message

* move inclusion inherent identifier into primitives

It's not clear precisely why this is desired, but it's a pattern
I've seen in several places, so I'm going this to be on the
safe side. Worst case, we can revert this commit pretty easily.

* bump kusama spec_version to placate CI

* copy sc_basic_authorship::{ProposerFactory, Proposer}

We have from the problem description:

> This Proposer will require an OverseerHandle to make requests via.

That's next on the plate.

* use polkadot custom proposer instead of basic-authorship one

* add some tests

* ensure service compiles and passes tests

* fix typo

* fix service-new compilation

* Subsystem test helpers send messages synchronously

* remove smelly action inspector

* remove superfluous let binding

* fix warnings

* add license header

* empty commit; maybe github will notice the one with changes

* Update node/network/bridge/src/lib.rs

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>

* add sanity check to only include valid inherents

* stub: encapsulate block production mechanics instead of copying them

The goal is to end up with something like what's in
validation::block_production::*, which encapsulates
basic block production mechanics. This is a better idea than
just straight-up copying those mechanics.

* partial implementation of propose fn

Doesn't actually compile yet; need to bring in some other
commits to ensure ProvisionerMessage is a thing, and also
figure out how to get the block hash given the current
context.

* fix compilation

* clear a few more compile errors

* finish fn propose

* broken: add timeout to proposal

* add timeout to proposal

* guide: provisioner is responsible for selecting parachain candidates

* implement ProvisionerMessage::RequestInherentData & update fn propose

* impl CreateProposer::init; clean up

* impl std::error::Error for Error

* document error-handling rationale

* cause polkadot-service-new to compile correctly

* Move potentially-blocking call from fn init -> fn propose

This means that we can wrap the delayed call into the same
timeout check used elsewhere.

* document struct Proposer

* extract provisioner data fetch

This satisfies two requirements:

- only applies the timeout to actually fetching the provisioner data,
  not to constructing the block after
- simplifies the problem of injecting default data if we could not
  get the real provisioner data in time.

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
Co-authored-by: Gavin Wood <gavin@parity.io>
2020-07-05 19:22:52 +02:00
André Silva 19ef40a7c9 babe: enable equivocation reporting on all runtimes (#1330)
* enable BABE equivocation reporting on all runtimes

* runtime: fix parachains mock test runtime

* cargo update -p sp-io

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-07-04 15:19:58 +02:00
Bastian Köcher f77b8139c0 Make a collator send a collation as backup as well (#1353)
Currently a collator will only send a collation to validators it is a
primary for. While testing this could lead to the situation that the
same collator was registered as prime for all Parachain validators but
failed for other reasons to generate a PoVBlock. However no other
collator was sending a collation, which stopped the Parachain until the
faulty collator was stopped.

This pr solves this problem by making sure that every collator sends a
collation to one of his validators he is connected to, but registered as backup.
2020-07-03 20:10:47 -04:00
Gavin Wood 79954ae589 Reduce Westend deposit requirements (#1341)
* Switch branch

* Return chain ops parts in new_chain_ops

* Remove where param from new_chain_ops

* Add task manager to new_chain_ops return

* Revert branch switch

* Revert "Revert branch switch"

This reverts commit 7c7900c047abd794ddc759aa092811db4961a7a6.

* network/test/src/lib: Adjust network worker polling

Companion for https://github.com/paritytech/substrate/pull/6552.

* Fix adder parachain

* Fix collator tests

* Revert branch switch

* Bump everything

- Remove old migration code
- Reduce deposit requried for westend

* Reapply fixes

* Bump locl

* Fix for #6550

* Fix message

Co-authored-by: Ashley Ruglys <ashley.ruglys@gmail.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2020-07-03 15:35:36 +02:00
Bastian Köcher e7bb3aef39 Check candidate signatures before including them in set_heads (#1335)
* Check candidate signatures before including them in `set_heads`

This work around the bug described in: https://github.com/paritytech/polkadot/issues/1327

We check the candidate signatures in `create_inherent` to ensure that
all are valid. If one isn't valid, we don't include any candidate for
the current inherent.

* Bump runtimes
2020-07-03 10:02:55 +02:00
Gavin Wood aeae0e1422 Revert "Companion PR for Allow specify schedule dispatch origin #6387" (#1340) 2020-07-02 15:09:03 +02:00
Gav Wood b05d7413bf Merge branch 'xlc-update-scheduler' 2020-07-02 15:06:18 +02:00
Gav Wood 393c4bffe4 Merge branch 'update-scheduler' of https://github.com/xlc/polkadot into xlc-update-scheduler 2020-07-02 15:06:11 +02:00
Bastian Köcher 934f27d92b Downward & Upward messages (#1266)
* Downward messages, the front-end.

* Move types around to make them accessible from Parachains

* Fix compilation

* Fix branch

* Make it compile for Cumulus

* Update the branch names

* Add default generic parameter

* Implement `Partialeq`

* Move upward messages into the `ValidationResult`

* Support disabling of the runtime api

* Update branch

* Adds support for handling downward messages

* Implement sending XCMP messages as up/downward messages

* service: update to latest ServiceBuilder changes

* Make it compile

* Initial commit

Forked at: ef2aa428d7
Parent branch: origin/master

* Update substrate branch to cecton-update-polkadot-substrate

* Update substrate & polkadot to cumulus-branch

* Reset branch

* Update primitives/src/parachain.rs

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

* Update runtime/common/src/parachains.rs

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

* Update runtime/common/src/parachains.rs

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

* Minor fixes

* Fix wasm build

Co-authored-by: Gav Wood <gavin@parity.io>
Co-authored-by: André Silva <andre.beat@gmail.com>
Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com>
Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2020-07-01 10:20:38 -04:00
Chevdor 3b357fadd5 Add registrar proxy (#1296)
* Add registrar proxy

* Add proxy filter for registrar for polkadot and westend

* Renaming + allow batch calls for Kusama

* Add batch calls for other chains
2020-07-01 15:36:54 +02:00
Gavin Wood bba14546ab Allow voting in democracy (#1331)
* Allow voting in democracy.

* Ensire Root can begin referenda
2020-07-01 15:35:57 +02:00
Bryan Chen 9b8cba9815 Merge remote-tracking branch 'origin/master' into update-scheduler 2020-07-01 20:37:47 +12:00
Robert Habermeier 2a3e607d14 Subsystem::start takes self by-value (#1325)
* Subsystem::start takes self by-value

* fix doc-test compilation
2020-06-30 15:16:37 -04:00
Cecile Tonglet cb59245085 Use spawner to spawn work task instead of tokio (#1328)
* Use spawner to spawn work task instead of tokio

This allows the caller to choose the runtime they want (instead of tokio).

* Replace generic by actual type
2020-06-30 13:04:50 -04:00
Shawn Tabrizi b42d7ba4a2 Companion for #6511 (#1321)
* Add custom runtime upgrade for retract tip

* cargo update -p sp-io
2020-06-30 18:50:20 +02:00
Bastian Köcher c8a039067a Companion for Substrate #6508 (#1329)
* Companion for Substrate #6508

* Update Cargo.lock
2020-06-30 15:21:45 +00:00
Robert Habermeier d16e7485d4 Implement Network Bridge (#1280)
* network bridge skeleton

* move some primitives around and add debug impls

* protocol registration glue & abstract network interface

* add send_msgs to subsystemctx

* select logic

* transform different events into actions and handle

* implement remaining network bridge state machine

* start test skeleton

* make network methods asynchronous

* extract subsystem out to subsystem crate

* port over overseer to subsystem context trait

* fix minimal example

* fix overseer doc test

* update network-bridge crate

* write a subsystem test-helpers crate

* write a network test helper for network-bridge

* set up (broken) view test

* Revamp network to be more async-friendly and not require Sync

* fix spacing

* fix test compilation

* insert side-channel for actions

* Add some more message types to AllMessages

* introduce a test harness

* add some tests

* ensure service compiles and passes tests

* fix typo

* fix service-new compilation

* Subsystem test helpers send messages synchronously

* remove smelly action inspector

* remove superfluous let binding

* fix warnings

* Update node/network/bridge/src/lib.rs

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>

* fix compilation

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
2020-06-30 11:21:40 -04:00
Peter Goodspeed-Niklaus 90de55918a impl ProvideInherent for InclusionInherent (#1318)
* impl ProvideInherent for InclusionInherent

* reduce import churn; correct expect message

* move inclusion inherent identifier into primitives

It's not clear precisely why this is desired, but it's a pattern
I've seen in several places, so I'm going this to be on the
safe side. Worst case, we can revert this commit pretty easily.

* bump kusama spec_version to placate CI

* add license header

* empty commit; maybe github will notice the one with changes

* add sanity check to only include valid inherents
2020-06-30 11:07:59 -04:00
Ashley b26f6d08ac Companion PR for Remove the service, replacing it with a struct of individual chain components (#1288)
* Switch branch

* Fix service things

* Fix browser node compilation

* Update branch

* fixed new service

* Update for new branch

* Fix browser node

* Update branch

* Revert "Switch branch"

This reverts commit 3623adff7681124a1539a385a718c34e85931254.

* Update cargo.lock

Co-authored-by: Bastian Köcher <git@kchr.de>
2020-06-30 12:06:55 +00:00
Bryan Chen a9480d9fe8 add runtime upgrade 2020-06-27 12:59:51 +12:00
Bryan Chen e426a8e070 Merge remote-tracking branch 'origin/master' into update-scheduler 2020-06-27 12:15:16 +12:00