Commit Graph

178 Commits

Author SHA1 Message Date
Ashley 14766804c0 Remove usage of substrate-test-runtime. (#969)
* Switch from using the substrate_test_runtime Extrinsic to the polkadot_test_runtime one

* Copy genesismap into test-runtime

* Add UncheckedExtrinsics

* Fix tests :^)

* Remove unused functions from genesismap

* DRY, clean up

* Clean up

* Update service/src/grandpa_support.rs

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

* Fix indentation

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

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
2020-04-21 12:56:22 +02:00
Bastian Köcher fb2e0c0ca9 Make sure collators join the validation network (#1010)
Collators need to join the validation network to tell its connected
relay chain peers the leaf they listen on. This is required to make the
Parachain validator send the signed statement to the collators as well.
2020-04-20 15:58:36 -04:00
Bastian Köcher eab3624096 Release 0.7.30 (#1006)
* Release 0.7.30

* Update Substrate & libp2p
2020-04-17 23:01:00 +02:00
Nikolay Volf 39e8013490 Companion PR for 5657 (#1003)
* prometheus registry to txpool

* Fix network tests

* Use None as the network config path

* update substrate

Co-authored-by: Ashley Ruglys <ashley.ruglys@gmail.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
2020-04-17 17:29:33 +02:00
Arkadiy Paronyan 280bf3928a Updated for the new db (#996)
* Updated for the new db

* Bumped version

* Sort out features

* Update to substrate master
2020-04-15 15:08:51 +02:00
Bastian Köcher c6134cf91a Release 0.7.29 (#998)
* Release 0.7.29

* Update `Cargo.lock`
2020-04-14 16:46:20 +02:00
Pierre Krieger 17c2882ae7 Companion PR to channel names (#995)
* Companion PR to channel names

* Err... fix missing event stream name

* Update Substrate
2020-04-14 16:00:25 +02:00
Bastian Köcher 70a30a9783 Make sure we send collators its role on connect (#991) 2020-04-14 15:01:46 +02:00
Robert Habermeier a5034dbe98 Use strong types in runtime for parachain heads and validation code (#964)
* use stronger types for HeadData and ValidationCode in runtime

* fix weird debug compile error

* fix runtime build

* update invocations invalidation.rs

* fix tests
2020-04-13 10:24:25 +02:00
Pierre Krieger 75ebe7fb2e Companion PR to #5560 - Also includes polkadot#979 and polkadot#986 (#982)
* Companion PR to #5560

* Set priorities.

* Update substrate.

* Fix tests.

* Update Substrate

* Companion of SignedExtension refactor (#5540)

Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
Co-authored-by: Alexander Theißen <alexander.theissen@parity.io>
2020-04-08 16:12:28 +02:00
Cecile Tonglet 9477be3440 Update cli to new sc-cli API (#935)
* Initial commit

Forked at: 9283855dba
Parent branch: origin/master

* Switch substrate to branch cecton-the-revenge-of-the-cli

* Adapting code

* Update Cargo.lock

* Adapting code

* Adapt more code

* Implement force_kusama parameter

* Revert dependency update

* Adapt code to use ref to SubstrateCli object

* Updated to latest version

* Updated with latest changes

* Bump spec vesion

* Fixed tests

* WIP

Forked at: 9283855dba
Parent branch: origin/master

* More fixes

* Cargo.lock

* Updated code

* Fixed and adapt

* Fixed dependency issue with wasm

* Adapted code

* Revert branch change

* Cargo.lock

* Cargo.lock

* Adapt code

* Clean-up

* More clean-up

* Cargo.lock
2020-04-07 12:08:53 +02:00
Robert Habermeier 15a83079ba refactor out validation hosts to pool struct (#972)
* refactor out validation hosts to pool struct

* make web-wasm compatible

* typo

* remove now-unused static hosts
2020-04-04 15:15:54 -04:00
André Silva b3d326acca Update substrate (#970)
* update substrate

* Hopefully fix compilation

* network: rename roles to role

* runtime: fix runtime-benchmarks compilation

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2020-04-03 20:50:34 +02:00
Pierre Krieger 8ce7154111 Companion PR to splitting Roles (#960)
* Companion PR to splitting Roles

* Fix network tests

* Fix service build

* Even more fixing

* Oops, quick fix

* use is_network_authority in grandpa service config

Co-authored-by: André Silva <andre.beat@gmail.com>
2020-04-03 19:08:46 +02:00
Bastian Köcher a26d919d8b Make sure we send the validator key to collators on status (#968)
Before the validator only send the keys if it was updated and thus the
collators would "never" be informed about the key of the validator.
2020-04-03 12:59:25 -04:00
Pierre Krieger 5b5ab9757b Don't depend directly on libp2p (#963)
* Don't depend directly on libp2p

* Fix bad import
2020-04-03 00:53:10 +02:00
Bastian Köcher 1e6f37076d Rework consensus instance communication with the network worker (#958)
Up to now consensus instances used the main channel to communicate with
the background network worker. This lead to a race condition when
sending a local collation and dropping the router before driving the
send local collation future until it is finished. This pr changes the
communication between worker and the instances to use their own
channels. This has the advantage that we don't need an extra
`DropConsensusNetworking` message as the network is dropped
automatically when the last sender is dropped.
2020-04-01 17:01:59 +02:00
Gavin Wood d8e1180030 Companion for #5412 (#942)
* Fixes for democracy using Scheduler

* Revert branch change
2020-04-01 17:01:14 +02:00
Robert Habermeier cb5defc91d PoV-block gossip (#930)
* add pov-block gossip message to network

* tests for pov-block gossip

* integrate pov-block gossip into main protocol

* message validation fetches pov blocks

* remove stray dbg! invocation

* test that pov-block is fetched from relay-parent topic
2020-03-31 23:05:42 +02:00
Bastian Köcher 4c3ca7bbb9 Companion pr for substrate#5448 (#957)
* Companion pr for substrate#5448

* Update Substrate reference
2020-03-31 14:09:36 +02:00
Cecile Tonglet 080eb240fa Companion PR for https://github.com/paritytech/substrate/pull/5236 (#955)
* Adapt code to API changes

* Update sp-io
2020-03-31 11:45:53 +02:00
Bastian Köcher b4c79556f3 Upgrade bitvec and parity-scale-codec (#947) 2020-03-30 13:08:15 +02:00
Fedor Sakharov dbb4e987fa Remove Parent Hash to Session mapping (#928)
* Adds a SigningContext type

* Bump spec versions

* Fixes requested changes

* Bump ParachainHost api_version and guard signing_context call

* Improve error message

* If there is no signing_context api use default value

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
2020-03-25 17:04:05 -04:00
Gav Wood 5f04e1aa52 Version bump 2020-03-23 16:29:10 +01:00
Gav Wood 0c435448f9 Bump version 2020-03-21 16:48:06 +01:00
Gavin Wood 95d732beca Introduce progressive democracy (#920)
* Updates for the new democracy

* Introduce progressive democracy

Also move to "master" branch of Substrate ready for continuous
sync with Substrate master.
2020-03-21 16:46:09 +01:00
André Silva 2edc7f13b0 Release version v0.7.27 (#916)
* bump version to v0.7.27

* update to latest substrate polkadot-master

* bump runtime impl_version
2020-03-19 16:24:32 +00:00
Gavin Wood d92963c7dc Bump version (#907) 2020-03-17 15:42:51 +01:00
Gavin Wood d07116a577 Bump version and Substrate (#905)
* Bump version and Substrate

* Version

* Lock
2020-03-17 14:10:15 +01:00
Robert Habermeier 260b2fa336 Tests for new network code (#897)
* move protocol.rs into subfolder

* add trait for mocking network behavior

* add a mock version of network ops

* remove some redundant parameters from service messages

* ensure fetching erasure chunks automatically cancels

* introduce dummy ProvideRuntimeApi

* abstract over gossip somewhat

* add mock gossip handler

* skeleton test

* remove dependence of shared table on router

* remove worker dependence on its own sender

* test shutdown

* add tests

* test that gossip streams are cleaned up correctly

* refactor worker out into its own struct and reduce bound on executor

* remove reliance of tests on global thread pool
2020-03-16 11:17:08 +01:00
Gavin Wood a81d8cb220 Bump versions & Substrate. (#902) 2020-03-16 11:00:11 +01:00
Gavin Wood 2c85b84cb6 Bump Substrate and runtime version (#900)
* Insert storage for finality tracker

* Bump lock

* Bump version
2020-03-14 17:13:10 +01:00
Gavin Wood 844ca939ab Prepare for version 0.7.23 (#899)
* Bump version

* Cargo lock

* Bump runtime version

* Bump Substrate again to include recent fix
2020-03-13 15:49:33 +01:00
Gavin Wood 1ddfb5c4e1 Bump to latest Substrate (#898)
* Flag to force kusama runtime

* Chainspecs for kusama

* Polkadot config for westend

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

* network/src/legacy/gossip: Wrap GossipEngine in Arc Mutex & lock it on use

`GossipEngine` in itself has no need to be Send and Sync, given that it
does not rely on separately spawned background tasks anymore.
`RegisteredMessageValidator` needs to be `Send` and `Sync` due to the
inherited trait bounds from implementing `GossipService`. In addition
`RegisteredMessageValidator` derives `Clone`. Thereby `GossipEngine`
needs to be wrapped in an `Arc` and `Mutex` to keep the status quo.

* Needed fixes.

* Fixes

* Fixed build

* Fixed build w benchmarking CLI

* Fixed building tests

* Added --dev shortcut

Co-authored-by: arkpar <arkady.paronyan@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Max Inden <mail@max-inden.de>
2020-03-13 14:43:31 +01:00
Ashley 1736c2d576 Add a testnet similar to sc_network_test. (#852)
* Copy over files

* Most network tests work

* Fix copyrights

* Strip out unneeded pallets

* Update test-runtime and remove unused network test things

* Upgrade test runtime

* Strip more things out of the test runtime

* Bump kusama impl version
2020-03-10 15:36:21 +01:00
Max Inden e98826977d network/src/legacy: Remove unnecessary super trait on GossipService (#891)
Remove `Send + Sync + 'static` super trait bound on `GossipService`. It
is not required by `GossipService` nor its `impl`s.
2020-03-09 16:35:22 -07:00
Gavin Wood 845ad821ee Bump version to knock the -dev (#887)
* Bump version to knock the -dev

* Update lock
2020-03-07 12:27:38 +01:00
Gavin Wood 2cf2811e16 Update to Substrate master (#886)
* Bump Substrate and some fixes

* Bump runtime

* version bump
2020-03-07 00:03:16 +01:00
joe petrowski 6d3f6bbda6 fix a few typos in docs (#884) 2020-03-06 13:05:53 +01:00
Gavin Wood e13fdc884c Merged companions and update Subtrate (#882)
* expunge legacy code from polkadot-network

* mostly rip out old legacy protocol from service

* ensure validation work is spawned by incoming messages

* decouple availabliity store from network logic; clean up data flow

* av_store: test helpers and use futures-abort

* update polkadot-validation to pass n_validators when submitting chunks

* fallible erasure-chunk fetching

* implement `ErasureNetworking` for new network prot

* API for registering availability store in network

* fully integrate new network service into service

* fix validation tests

* scaffolding for porting collator over to new network

* track connected validators' peer IDs and distribute collators' collations

* helper in network for fetching all checked statements

* fix adder-collator

* actually register notifications protocol

* Update service/src/lib.rs

* Make needed changes to service

* Merge two companion PRs.

- #880
- #881

* Some effort towards compilation

* Fix

* remove `NetworkSpecialization` references from network

* fix compilation errors in service and collator

* ensure protocol name is valid

* Fixes

* Fix

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
Co-authored-by: Ashley <ashley.ruglys@gmail.com>
2020-03-05 23:20:42 +01:00
Robert Habermeier 7931380825 Remove legacy network code (#860)
* expunge legacy code from polkadot-network

* mostly rip out old legacy protocol from service

* ensure validation work is spawned by incoming messages

* decouple availabliity store from network logic; clean up data flow

* av_store: test helpers and use futures-abort

* update polkadot-validation to pass n_validators when submitting chunks

* fallible erasure-chunk fetching

* implement `ErasureNetworking` for new network prot

* API for registering availability store in network

* fully integrate new network service into service

* fix validation tests

* scaffolding for porting collator over to new network

* track connected validators' peer IDs and distribute collators' collations

* helper in network for fetching all checked statements

* fix adder-collator

* actually register notifications protocol

* Update service/src/lib.rs

* merge with master
2020-03-05 10:11:21 -08:00
Gavin Wood b2df51d296 Update substrate (#878)
* Switch branch

* Small changes

* Update substrate branch

* Switch

* Revert "Switch branch"

This reverts commit b9d48b2ce8f5cbfa379dd385e817e80870391d9d.

* fix

* add `wipe` and `commit`

* Remove deprecated_host_interface

* Switch branch

* HasherFor -> HashFor

* More HasherFor changes

* Final touches

* Revert "Switch branch"

This reverts commit d0da27313839559de01f59690f3826fe587becb8.

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-03-05 13:27:28 +01:00
Bastian Köcher 8a38b7af3c Update to latest Substrate master (#863)
* Begin to update to latest Substrate master

* Fix compilation

* Remove `Balances` from `OnKilledAccount`

* Update cli/src/command.rs

Co-Authored-By: Cecile Tonglet <cecile@parity.io>

* Change gossip name

* Change again

Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com>
2020-02-28 12:32:16 +01:00
Robert Habermeier b7d30aa379 A more comprehensive model for PoV-Blocks and Candidate receipts (#843)
* encode the candidate statement as only the hash

* refactor CandidateReceipt and CollationInfo

* introduce an abridged candidate receipt type

* erasure coding stores candidate receipt

* store omitted data instead and introduce AvailableData type

* refactor availability-store schema

* tweak schema and APIs a bit more

* get availability-store tests passing

* accept AbridgedCandidateReceipt in `set_heads`

* change statement type in primitives to be hash-only

* fix parachains runtime tests

* fix bad merge

* rewrite validation pipeline

* remove evaluation module

* use abridged candidate hash as canonical

* statement table uses abridged candidate receipts

* kill availability_store::Data struct

* port shared table to new validation pipelines

* extract full validation pipeline to helper

* remove old validation pipeline from collation module

* polkadot-validation compiles

* polkadot-validation tests compile

* make local collation available in validation service

* port legacy network code

* polkadot-network fully ported

* network: ensure fresh statement is propagated

* remove pov_block_hash from LocalValidationData

* remove candidate_hash field from AttestedCandidate and update runtime

* port runtimes to new ParachainHost definition

* port over polkadot-collator

* fix test compilation

* better fix

* remove unrelated validation work dispatch fix

* address grumbles

* fix equality check
2020-02-25 15:16:58 -08:00
Pierre Krieger c24c8e9b88 Redefine RequetsId instead of using it from Substrate (#857) 2020-02-21 10:15:29 -08:00
Nikolay Volf f7303348ff Update to latest substrate master (#853)
* try to update

* latest updates

* final fixes

* Fix claim w/ vesting logic

* Make claim tests a bit better

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
2020-02-19 17:24:57 +00:00
Ashley bbb2fbc556 Remove TargetedMessage (#848)
* Remove TargetedMessage

* Nitpicks
2020-02-19 08:33:38 -08:00
Ashley 5f9e602af7 Strip out old XCMP primitives (#823)
* WIP

* WIp

* Mostly get tests to compile

* Fix adder collator

* Remove more stuff

* Revert some changes to av store

* Fix av store tests

* Nitpicks

* Restore some things

* Small changes

* Remvoe unused error variants
2020-02-13 17:12:05 +01:00
Bastian Köcher 2eb7621759 Adds some debug logging (#837) 2020-02-11 22:01:45 +01:00
Robert Habermeier 9b23f3f1f0 rewrite network code to use notifications_protocol APIs from Substrate (#788)
* extract all network code to legacy submodule

* update references to legacy proto

* skeleton of futures-based protocol

* refactor skeleton to use background task

* rename communication_for to build_table_router

* implement internal message types for validation network

* basic ParachainNetwork and TableRouter implementations

* add some module docs

* remove exit-future from validation

* hack: adapt legacy protocol to lack of exit-future

* generalize RegisteredMessageValidator somewhat

* instantiate and teardown table routers

* clean up RouterInner drop logic

* implement most of the statement import loop

* implement statement loop in async/await

* remove unneeded TODO

* most of the collation skeleton

* send session keys and validator roles

* also send role after status

* use config in startup

* point TODO to issue

* fix test compilation
2020-02-10 15:20:45 +01:00