Unverified Commit 6459a194 authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

Companion pr for Substrate #3860 (#743)

* Make use of `runtime_interface` for parachain externalities

This also changes the encoding of the `ValidationResult` return value to
match the default encoding used in Substrate.

* Bump versions (#655)

* Bump version

* Update Cargo lock and bump runtime version

* Remove balance transfer disabler.

* Fix checking that `get_heads` exists (#657)

* Tweak some Kusama params (#659)

* Tweak some Kusama params

- Council elections daily
- No treasury burn
- Bonding/slash defer periods of 7 days

* Bump runtime

* Bump version

* Update Substrate (#661)

* Make compat with exit-future updates

* Update exit-future entirely

* Tidy

* Bump Substrate

* Update branch

* Add back sudo and fixing compilation

* Increase nick deposit (10 KSM) and require 2 councillors to slash (#663)

* Bump Substrate (#664)

* Replace Substrate mentions in license headers with Polkadot (#674)

* Fix typo in comment (#671)

* Bump Substrate, add Identity module (#676)

* Bump Substrate, add Identity module

* Bump Substrate again

* Update futures and tokio for browser light client (#673)

* Make availability-store compile for WASM

* Use --manifest-path instead

* Make validation work on wasm!

* Switch to Spawn trait

* Migrate validation to std futures

* Migrate network to std futures

* Final changes to validation

* Tidy up network

* Tidy up validation

* Switch branch

* Migrate service

* Get polkadot to compile via wasm!

* Add browser-demo

* Add initial browser file

* Add browser-demo

* Tidy

* Temp switch back to substrate/master

* tidy

* Fix wasm build

* Re-add release flag

* Switch to polkadot-master

* Revert cli tokio version to avoid libp2p panic

* Update tokio version

* Fix availability store tests

* Fix validation tests

* Remove futures01 from availability-store

* Fix network tests

* Small changes

* Fix collator

* Fix typo

* Revert removal of tokio_executor that causes tokio version mismatch panic

* Fix adder test parachain

* Revert "Revert removal of tokio_executor that causes tokio version mismatch panic"

This reverts commit cfeb50c0

.

* Update availability-store/src/worker.rs
Co-Authored-By: Pierre Krieger's avatarPierre Krieger <pierre.krieger1708@gmail.com>

* Update network/src/lib.rs
Co-Authored-By: Pierre Krieger's avatarPierre Krieger <pierre.krieger1708@gmail.com>

* Update network/src/lib.rs
Co-Authored-By: Pierre Krieger's avatarPierre Krieger <pierre.krieger1708@gmail.com>

* Box pin changes

* Asyncify network functions

* Clean up browser validation worker error

* Fix av store test

* Nits

* Fix validation test

* Switch favicon

* Fix validation test again

* Revert "Asyncify network functions"

This reverts commit f20ae654.

* Add async blocks back in

* Fix typo in comment (#672)

* Add the /ws bootnode to the chain specs (#681)

* Revert "Revert "Revert removal of tokio_executor that causes tokio version mismatch panic"" (#685)

This reverts commit 938f411a

.

* Fix bootnodes PeerIds (#683)

* Fixes a flaky test (#675)

* Fixes a flaky test

* Renames a var

* Do not unit the errors in tests

* Bump Substrate (#686)

* update to latest renames

* Bump Substrate

* Bump substrate

* Merge some things from `ashley-compile-to-wasm` (#687)

* Make availability-store compile for WASM

* Use --manifest-path instead

* Make validation work on wasm!

* Switch to Spawn trait

* Migrate validation to std futures

* Migrate network to std futures

* Final changes to validation

* Tidy up network

* Tidy up validation

* Switch branch

* Migrate service

* Get polkadot to compile via wasm!

* Add browser-demo

* Add initial browser file

* Add browser-demo

* Tidy

* Temp switch back to substrate/master

* tidy

* Fix wasm build

* Re-add release flag

* Add the /ws bootnode to the chain specs

* Copy changes from master

* Switch branch

* Switch libp2p and add wasm-timer

* Switch back libp2p and add rand

* Fix bootnodes PeerIds

* use browser indexdb

* Reduce changeset

* Add matrix release alert script and gitlab job (#688)

* Add matrix release alert script and gitlab job

* Update .gitlab-ci.yml
Co-Authored-By: Kirill Pimenov's avatarKirill Pimenov <kirill@parity.io>

* Rewrite some Future structs as async functions (#679)

* Squashed commit of the following:

commit e97a1715
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Tue Dec 10 15:06:28 2019 +0100

    Rewrite some functions as async

commit 970e4851
Merge: f98966ac 47828402
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Tue Dec 10 11:19:37 2019 +0100

    Merge remote-tracking branch 'parity/master' into ashley-futures-update

commit f98966ac
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 23:40:20 2019 +0100

    Add async blocks back in

commit 7fa88af0
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 23:17:02 2019 +0100

    Revert "Asyncify network functions"

    This reverts commit f20ae654.

commit 82413550
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 19:09:55 2019 +0100

    Fix validation test again

commit 47e002b0
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 19:07:43 2019 +0100

    Switch favicon

commit 0c5c1409
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 18:54:10 2019 +0100

    Fix validation test

commit 8bb6a018
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 18:53:54 2019 +0100

    Nits

commit 33410f3a
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 18:43:09 2019 +0100

    Fix av store test

commit f0c517eb
Merge: 938f411a 60e72111
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 18:21:39 2019 +0100

    Merge branch 'ashley-futures-updates' into ashley-futures-update

commit 60e72111
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 18:19:40 2019 +0100

    Clean up browser validation worker error

commit f20ae654
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 18:16:40 2019 +0100

    Asyncify network functions

commit b22758d0
Merge: 2e8b05ed ca8d5c54
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 17:47:26 2019 +0100

    Merge remote-tracking branch 'parity/master' into ashley-futures-updates

commit 2e8b05ed
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 17:45:52 2019 +0100

    Box pin changes

commit 08bfdf7f


Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 17:15:38 2019 +0100

    Update network/src/lib.rs
Co-Authored-By: Pierre Krieger's avatarPierre Krieger <pierre.krieger1708@gmail.com>

commit d8be456c


Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 17:15:32 2019 +0100

    Update network/src/lib.rs
Co-Authored-By: Pierre Krieger's avatarPierre Krieger <pierre.krieger1708@gmail.com>

commit ec736727


Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 17:14:36 2019 +0100

    Update availability-store/src/worker.rs
Co-Authored-By: Pierre Krieger's avatarPierre Krieger <pierre.krieger1708@gmail.com>

commit 938f411a
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 17:05:05 2019 +0100

    Revert "Revert removal of tokio_executor that causes tokio version mismatch panic"

    This reverts commit cfeb50c0.

commit f92f5804
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 15:47:35 2019 +0100

    Fix adder test parachain

commit cfeb50c0
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 15:31:36 2019 +0100

    Revert removal of tokio_executor that causes tokio version mismatch panic

commit 5bcb83a1
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 15:17:55 2019 +0100

    Fix typo

commit fc02b1dc
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 15:02:50 2019 +0100

    Fix collator

commit 6c4ff5b3
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 14:35:37 2019 +0100

    Small changes

commit e1338cb4
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 14:24:42 2019 +0100

    Fix network tests

commit 4e458f7a
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 12:25:26 2019 +0100

    Remove futures01 from availability-store

commit 5729f6cd
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 12:22:33 2019 +0100

    Fix validation tests

commit a8206125
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 12:01:48 2019 +0100

    Fix availability store tests

commit 112344fa
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 11:36:03 2019 +0100

    Update tokio version

commit d2de6d8b
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 11:33:25 2019 +0100

    Revert cli tokio version to avoid libp2p panic

commit 0c5f24e0
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 9 11:27:13 2019 +0100

    Switch to polkadot-master

commit 2e2311e3
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Fri Dec 6 15:07:21 2019 +0100

    Re-add release flag

commit 6adc1b61
Merge: 9767f832 5e9542c8
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Fri Dec 6 13:36:35 2019 +0100

    Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm

commit 9767f832
Merge: c528dc6d 84ece424
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Wed Dec 4 17:11:39 2019 +0100

    Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm

commit c528dc6d
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Wed Dec 4 17:07:00 2019 +0100

    Fix wasm build

commit da233a12
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Wed Dec 4 16:25:49 2019 +0100

    tidy

commit 832f8054
Merge: 4e1da888 78e828d8
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Wed Dec 4 15:56:56 2019 +0100

    Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm

commit 4e1da888
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Tue Dec 3 16:47:02 2019 +0100

    Temp switch back to substrate/master

commit af88a873
Merge: a03a980c abb51115
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 2 19:33:14 2019 +0100

    Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm

commit a03a980c
Merge: 31a88a93 f7d48261
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 2 13:52:37 2019 +0100

    Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm

commit 31a88a93
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 2 13:52:35 2019 +0100

    Tidy

commit 5b33b7a7
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 2 11:55:51 2019 +0100

    Add browser-demo

commit 868f6e51
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 2 10:51:57 2019 +0100

    Add initial browser file

commit e5e399c2
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Mon Dec 2 10:45:02 2019 +0100

    Add browser-demo

commit 408288b0
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Sun Dec 1 19:28:33 2019 +0100

    Get polkadot to compile via wasm!

commit 04ffe72e
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Sun Dec 1 19:28:16 2019 +0100

    Migrate service

commit 119f0829
Merge: 93fb6428 5422684f
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Sun Dec 1 17:43:49 2019 +0100

    Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm

commit 93fb6428
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Sun Dec 1 12:21:25 2019 +0100

    Switch branch

commit 0c4fe833
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Sat Nov 30 11:45:59 2019 +0100

    Tidy up validation

commit 73563253
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Sat Nov 30 11:39:09 2019 +0100

    Tidy up network

commit 1c9cf042
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Sat Nov 30 01:16:35 2019 +0100

    Final changes to validation

commit 322cca52
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Sat Nov 30 00:31:55 2019 +0100

    Migrate network to std futures

commit 96f1a994
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Fri Nov 29 23:31:04 2019 +0100

    Migrate validation to std futures

commit aaf5e55f
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Fri Nov 29 17:10:11 2019 +0100

    Switch to Spawn trait

commit 2ab282f5
Merge: cceb6b72 5598ed9b
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Fri Nov 29 16:31:24 2019 +0100

    Merge remote-tracking branch 'parity/master' into ashley-compile-to-wasm

commit cceb6b72
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Fri Nov 29 15:47:14 2019 +0100

    Make validation work on wasm!

commit b45a95cf
Merge: 3773d5c1 db7eaa6b
Author: Ashley <ashley.ruglys@gmail.com>
Date:   Fri Nov 29 13:57:23 2019 +0100

    Merge remote-tracking branch 'tomaka/wasm-start' into HEAD

commit db7eaa6b
Merge: 6f97dbb7 2ab32dac
Author: Pierre Krieger <pierre.krieger1708@gmail.com>
Date:   Thu Nov 28 13:58:15 2019 +0100

    Merge branch 'master' into wasm-start

commit 6f97dbb7
Author: Pierre Krieger <pierre.krieger1708@gmail.com>
Date:   Thu Nov 28 12:47:45 2019 +0100

    Use --manifest-path instead

commit 20104e98


Author: Pierre Krieger <pierre.krieger1708@gmail.com>
Date:   Thu Nov 28 10:44:51 2019 +0100

    Make availability-store compile for WASM

* Fix build

* Fix futures blocking panic in validators (again)

* Deindent

* Supercede 'Propagate Substrate#4284 to Polkadot' (#695)

* Propagate Substrate#4284 to Polkadot

* Fix tests

* Fixes

* Use hash part of fund id as child unique id.

* Add comma

* Switch branch

* run cargo update

* Update polkadot-master only

* Fix collator

* More update

* Fix compilation

* Some stylistic cleanups

* Increase the minimum treasury bond to reduce silly proposals (#701)

* Increase the minimum treasury bond to reduce silly proposals

* Bump substrate

* Bump version

* Update to latest Substrate master (#703)

* Update to latest Substrate master

* Fix tests

* Introduce an event for when transaction fees are paid (#702)

* Introduce an event for when transaction fees are paid

* Fix
Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>

* Bump to latest Substrate (#706)

* Updates, but won't build.

* Bump version.

* Fix

* Fix test

* ci: increase git cloning depth to 100 (#707)

* ci: fetch master branch for runtime diff (#708)

* Bump Substrate and runtime version (#712)

* Update to latest Substrate master

* Bump Substrate and runtime version
Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>

* ci: fix release tagging after tags are added on the master branch (#714)

* ci: fix release tagging after tags are added on the master branch

* ci: latest tag applied to latest tag

* Update kvdb version in availability-store (#709)

* update availability store

* also fix warning

* update Cargo.lock

* Support both polkadot and kusama runtimes (#704)

* Allow both polkadot and kusama runtimes

* Allow both polkadot and kusama runtimes

* Make `collator` build

* Removed kusama runtime

* Introduced common runtime

* Updated for latest substrate

* Updated CI targets

* Updated CI version check

* Removed unused dependency

* Pulled latests substrate

* Pulled latest substrate

* Fixed version

* Apply suggestions from code review
Co-Authored-By: default avatarBastian Köcher <bkchr@users.noreply.github.com>

* NEW_HEADS_IDENTIFIER moved to primitives

* Updated CI check script

* Fixed script

* Set epoch duration for polkadot

* ci: check_runtime for both runtimes
Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: default avatargabriel klawitter <gabreal@users.noreply.github.com>

* Bump Substrate & runtime version (#715)

* Bump Substrate & runtime version

* Attempt at fix

* Update runtime/kusama/src/lib.rs
Co-Authored-By: default avatarBastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>

* Update copyright year (#718)

* Fixes after master merge

* service: support setting fork blocks in config (#719)

* ci: make sure master branch is available for check_runtime (#720)

* service/src/lib.rs: Register network event stream for authority disc (#678)

* service/src/lib.rs: Register network event stream for authority disc

Previously one would create a sender and receiver channel pair, pass the
sender to the build_network_future through the service builder and
funnel network events returned from polling the network service into the
sender to be consumed by the authority discovery module owning the
receiver.

With recent changes it is now possible to register an event_stream
with the network service directly, thus one does not need to make the
detour through the build_network_future.

This commit is an adjusted clone of one targeting the Substrate
repository.

* service/src/lib.rs: Fix futures::stream imports

* [TMP] *: Replace polkadot-upstream with feature branch

* Revert "[TMP] *: Replace polkadot-upstream with feature branch"

This reverts commit 0c947b04

.

* Hotfix for Kusama (#724)

* cli: revert borked kusama chain on startup

* Docs.

* cli: fix reversal of bork kusama fork

* cli: force always can author

* Version bump

* service: support setting fork blocks in config

* service: add support for bad blocks extension

* service: add badBlocks to kusama chainspec

* Bump Substrate to hotfix version.

* service: add bad block to kusama chain spec

* cleanup kusama hotfix

* add kusama grandpa hotfix

* Bump substrate

* Bump spec_version

* Rebump

* cli: remove unnecessary dependencies

* service: revert can_author_with fix

* service: remove unnecessary method

* Don't try to track polkadot runtime verion yet

* Versions

* service: better grandpa fix detection
Co-authored-by: André Silva's avatarAndré Silva <andre.beat@gmail.com>

* allow release alerts to fail (#725)

* Fix the can-author issue by defaulting to Kusama when no chainspec given. (#728)

* Fix can_author by defaulting correctly.

* Comments

* Better logging

* Bump Substrate

* Minor updates to readme.

* service: reset grandpa into a future round (not past) (#726)

* service: reset grandpa into a future round (not past)

* update substrate version

* service: create grandpa reset round variable

* service: fine grained grandpa reset on startup
Co-authored-by: default avatarGavin Wood <github@gavwood.com>

* Bump version (#729)

* polkadot v0.7.13 (#730)

* bump substrate version

* bump version to 0.7.13

* Fix pending-release alert script (#734)

... parity/tools doesn't have /bin/bash

* Select native runtime based on chain spec (#733)

* Select native runtime based on chain spec

* Bumped substrate

* Add sudo module to `polkadot-runtime` (#735)

* Bump versions (#736)

* Fix up Kusama balance constants

* Bump versions

* Fix for the --dev option

* remove kusama fixes (#738)

* Tweak Polkadot constants & bump Substrate (#739)

* Tweak Polkadot constants.

* Bump and remove warning

* Bump impl version

* Bump Substrate

* Bump Substrate again

* Some fixes

* Fix compilation

* Remove TODO

* Remove old dir

* Companion PR for Substrate#4585 (#748)

* Companion PR for Substrate#4394 (#723)

* service/src/lib.rs: Register network event stream for authority disc

Previously one would create a sender and receiver channel pair, pass the
sender to the build_network_future through the service builder and
funnel network events returned from polling the network service into the
sender to be consumed by the authority discovery module owning the
receiver.

With recent changes it is now possible to register an event_stream
with the network service directly, thus one does not need to make the
detour through the build_network_future.

This commit is an adjusted clone of one targeting the Substrate
repository.

* service/src/lib.rs: Fix futures::stream imports

* [TMP] *: Replace polkadot-upstream with feature branch

* Switch branch

* Small change

* Companion PR to substrate#4542

* Revert "Merge remote-tracking branch 'tomaka/companion-4542' into ashley-browser-utils"

This reverts commit 17f00afe, reversing
changes made to 928cbb9c

.

* ashley-browser-utils -> ashley-browser-utils-polkadot

* Switch branches back
Co-authored-by: default avatarMax Inden <mail@max-inden.de>
Co-authored-by: Pierre Krieger's avatarPierre Krieger <pierre.krieger1708@gmail.com>

* Companion PR to substrate#4542 (#732)

* Companion PR for Substrate#4585
Co-authored-by: default avatarAshley <ashley.ruglys@gmail.com>
Co-authored-by: default avatarMax Inden <mail@max-inden.de>
Co-authored-by: Pierre Krieger's avatarPierre Krieger <pierre.krieger1708@gmail.com>

* Reset branch and make it compile

* Review feedback

* Make the bounds a bit cleaner.
Co-authored-by: default avatarGavin Wood <github@gavwood.com>
Co-authored-by: default avatarStanislav Tkach <stanislav.tkach@gmail.com>
Co-authored-by: default avatarLeo Arias <elopio@openzeppelin.com>
Co-authored-by: default avatarAshley <ashley.ruglys@gmail.com>
Co-authored-by: Pierre Krieger's avatarPierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: Fedor Sakharov's avatarFedor Sakharov <fedor.sakharov@gmail.com>
Co-authored-by: Martin Pugh's avatars3krit <pugh@s3kr.it>
Co-authored-by: Kirill Pimenov's avatarKirill Pimenov <kirushik@gmail.com>
Co-authored-by: default avatargabriel klawitter <gabreal@users.noreply.github.com>
Co-authored-by: default avatarNikolay Volf <nikvolf@gmail.com>
Co-authored-by: Arkadiy Paronyan's avatarArkadiy Paronyan <arkady.paronyan@gmail.com>
Co-authored-by: Shawn Tabrizi's avatarShawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: André Silva's avatarAndré Silva <andre.beat@gmail.com>
Co-authored-by: default avatarMax Inden <mail@max-inden.de>
Co-authored-by: default avatarTomasz Drwięga <tomusdrw@users.noreply.github.com>
parent f570356d
Pipeline #74174 passed with stages
in 23 minutes and 26 seconds
This diff is collapsed.
......@@ -14,18 +14,18 @@ log = "0.4.8"
futures = "0.3.1"
tokio = { version = "0.2.4", features = ["rt-core"] }
exit-future = "0.2.0"
codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.1.0", features = ["derive"] }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
consensus_common = { package = "sp-consensus", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
client = { package = "sc-client-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
keystore = { package = "sc-keystore", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
kvdb = "0.2.0"
kvdb-memorydb = "0.2.0"
kvdb = "0.3.1"
kvdb-memorydb = "0.3.1"
[target.'cfg(not(target_os = "unknown"))'.dependencies]
kvdb-rocksdb = "0.3"
kvdb-rocksdb = "0.4.1"
......@@ -32,19 +32,20 @@ use polkadot_primitives::{
ParachainHost,
},
};
use sp_runtime::traits::{BlakeTwo256, Hash as HashT, ProvideRuntimeApi};
use sp_runtime::traits::{BlakeTwo256, Hash as HashT, HasherFor};
use sp_blockchain::{Result as ClientResult};
use client::{
BlockchainEvents, BlockBody,
};
use sp_api::ApiExt;
use std::pin::Pin;
use sp_api::{ApiExt, ProvideRuntimeApi};
use log::warn;
use std::sync::Arc;
use std::collections::HashSet;
use std::path::PathBuf;
use std::io;
use std::pin::Pin;
mod worker;
mod store;
......@@ -200,9 +201,11 @@ impl Store {
keystore: KeyStorePtr,
) -> ClientResult<AvailabilityBlockImport<I, P>>
where
P: ProvideRuntimeApi + BlockchainEvents<Block> + BlockBody<Block> + Send + Sync + 'static,
P: ProvideRuntimeApi<Block> + BlockchainEvents<Block> + BlockBody<Block> + Send + Sync + 'static,
P::Api: ParachainHost<Block>,
P::Api: ApiExt<Block, Error=sp_blockchain::Error>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HasherFor<Block>>,
{
let to_worker = self.to_worker.clone();
......
......@@ -21,8 +21,8 @@ use std::thread;
use log::{error, info, trace, warn};
use sp_blockchain::{Result as ClientResult};
use sp_runtime::traits::{Header as HeaderT, ProvideRuntimeApi, Block as BlockT};
use sp_api::ApiExt;
use sp_runtime::traits::{Header as HeaderT, Block as BlockT, HasherFor};
use sp_api::{ApiExt, ProvideRuntimeApi};
use client::{
BlockchainEvents, BlockBody,
blockchain::ProvideCache,
......@@ -207,8 +207,10 @@ where
fn fetch_candidates<P>(client: &P, extrinsics: Vec<<Block as BlockT>::Extrinsic>, parent: &BlockId)
-> ClientResult<Option<Vec<CandidateReceipt>>>
where
P: ProvideRuntimeApi,
P: ProvideRuntimeApi<Block>,
P::Api: ParachainHost<Block, Error = sp_blockchain::Error>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HasherFor<Block>>,
{
let api = client.runtime_api();
......@@ -228,9 +230,11 @@ where
/// Creates a task to prune entries in availability store upon block finalization.
async fn prune_unneeded_availability<P, S>(client: Arc<P>, mut sender: S)
where
P: ProvideRuntimeApi + BlockchainEvents<Block> + BlockBody<Block> + Send + Sync + 'static,
P: ProvideRuntimeApi<Block> + BlockchainEvents<Block> + BlockBody<Block> + Send + Sync + 'static,
P::Api: ParachainHost<Block> + ApiExt<Block, Error=sp_blockchain::Error>,
S: Sink<WorkerMsg> + Clone + Send + Sync + Unpin,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HasherFor<Block>>,
{
let mut finality_notification_stream = client.finality_notification_stream();
......@@ -624,16 +628,19 @@ impl<I, P> Drop for AvailabilityBlockImport<I, P> {
}
impl<I, P> BlockImport<Block> for AvailabilityBlockImport<I, P> where
I: BlockImport<Block> + Send + Sync,
I: BlockImport<Block, Transaction = sp_api::TransactionFor<P, Block>> + Send + Sync,
I::Error: Into<ConsensusError>,
P: ProvideRuntimeApi + ProvideCache<Block>,
P: ProvideRuntimeApi<Block> + ProvideCache<Block>,
P::Api: ParachainHost<Block, Error = sp_blockchain::Error>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<sp_core::Blake2Hasher>
{
type Error = ConsensusError;
type Transaction = sp_api::TransactionFor<P, Block>;
fn import_block(
&mut self,
block: BlockImportParams<Block>,
block: BlockImportParams<Block, Self::Transaction>,
new_cache: HashMap<CacheKeyId, Vec<u8>>,
) -> Result<ImportResult, Self::Error> {
trace!(
......@@ -745,9 +752,11 @@ impl<I, P> AvailabilityBlockImport<I, P> {
to_worker: mpsc::UnboundedSender<WorkerMsg>,
) -> Self
where
P: ProvideRuntimeApi + BlockBody<Block> + BlockchainEvents<Block> + Send + Sync + 'static,
P: ProvideRuntimeApi<Block> + BlockBody<Block> + BlockchainEvents<Block> + Send + Sync + 'static,
P::Api: ParachainHost<Block>,
P::Api: ApiExt<Block, Error = sp_blockchain::Error>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
sp_api::StateBackendFor<P, Block>: sp_api::StateBackend<HasherFor<Block>>,
{
let (signal, exit) = exit_future::signal();
......
......@@ -14,6 +14,13 @@ futures = { version = "0.3.1", features = ["compat"] }
futures01 = { package = "futures", version = "0.1.29" }
structopt = "=0.3.7"
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
service = { package = "polkadot-service", path = "../service", default-features = false }
tokio = { version = "0.1.22", optional = true }
......
......@@ -31,10 +31,11 @@ use futures::{
use tokio::runtime::Runtime;
use log::info;
use structopt::StructOpt;
use sp_api::ConstructRuntimeApi;
pub use service::{
AbstractService, CustomConfiguration, ProvideRuntimeApi, CoreApi, ParachainHost, IsKusama, self,
WrappedExecutor
AbstractService, CustomConfiguration, ProvideRuntimeApi, CoreApi, ParachainHost, IsKusama,
WrappedExecutor, Block, self, RuntimeApiCollection, TFullClient
};
pub use sc_cli::{VersionInfo, IntoExit, NoCustom, SharedParams};
......@@ -101,6 +102,25 @@ pub fn run<E: IntoExit>(exit: E, version: sc_cli::VersionInfo) -> error::Result<
}
}
#[cfg(feature = "cli")]
use sp_core::Blake2Hasher;
#[cfg(feature = "cli")]
// We can't simply use `service::TLightClient` due to a
// Rust bug: https://github.com/rust-lang/rust/issues/43580
type TLightClient<Runtime, Dispatch> = sc_client::Client<
sc_client::light::backend::Backend<sc_client_db::light::LightStorage<Block>, Blake2Hasher>,
sc_client::light::call_executor::GenesisCallExecutor<
sc_client::light::backend::Backend<sc_client_db::light::LightStorage<Block>, Blake2Hasher>,
sc_client::LocalCallExecutor<
sc_client::light::backend::Backend<sc_client_db::light::LightStorage<Block>, Blake2Hasher>,
sc_executor::NativeExecutor<Dispatch>
>
>,
Block,
Runtime
>;
/// Execute the given `cmd` with the given runtime.
#[cfg(feature = "cli")]
fn execute_cmd_with_runtime<R, D, E, X>(
......@@ -110,14 +130,23 @@ fn execute_cmd_with_runtime<R, D, E, X>(
spec: Option<service::ChainSpec>,
) -> error::Result<()>
where
R: service::ConstructRuntimeApi<service::Block, service::TFullClient<service::Block, R, D>>
+ service::ConstructRuntimeApi<service::Block, service::TLightClient<service::Block, R, D>>
R: ConstructRuntimeApi<Block, service::TFullClient<Block, R, D>>
+ Send + Sync + 'static,
<R as service::ConstructRuntimeApi<service::Block, service::TFullClient<service::Block, R, D>>>::RuntimeApi: service::RuntimeApiCollection<E>,
<R as service::ConstructRuntimeApi<service::Block, service::TLightClient<service::Block, R, D>>>::RuntimeApi: service::RuntimeApiCollection<E>,
<R as ConstructRuntimeApi<Block, service::TFullClient<Block, R, D>>>::RuntimeApi:
RuntimeApiCollection<E, StateBackend = sc_client_api::StateBackendFor<service::TFullBackend<Block>, Block>>,
<R as ConstructRuntimeApi<Block, service::TLightClient<Block, R, D>>>::RuntimeApi:
RuntimeApiCollection<E, StateBackend = sc_client_api::StateBackendFor<service::TLightBackend<Block>, Block>>,
E: service::Codec + Send + Sync + 'static,
D: service::NativeExecutionDispatch + 'static,
X: IntoExit,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
<<R as ConstructRuntimeApi<Block, TFullClient<Block, R, D>>>::RuntimeApi as sp_api::ApiExt<Block>>::StateBackend:
sp_api::StateBackend<Blake2Hasher>,
// Rust bug: https://github.com/rust-lang/rust/issues/43580
R: ConstructRuntimeApi<
Block,
TLightClient<R, D>
>,
{
let is_kusama = spec.as_ref().map_or(false, |s| s.is_kusama());
// Use preloaded spec
......
......@@ -7,11 +7,13 @@ edition = "2018"
[dependencies]
futures = "0.3.1"
client = { package = "sc-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
client-api = { package = "sc-client-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
primitives = { package = "sp-core", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
consensus_common = { package = "sp-consensus", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
polkadot-primitives = { path = "../primitives" }
polkadot-cli = { path = "../cli" }
......@@ -21,6 +23,7 @@ polkadot-service = { path = "../service" }
log = "0.4.8"
tokio = "0.1.22"
futures-timer = "1.0"
codec = { package = "parity-scale-codec", version = "1.1.0" }
[dev-dependencies]
keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
......@@ -52,8 +52,8 @@ use std::pin::Pin;
use futures::{future, Future, Stream, FutureExt, TryFutureExt, StreamExt, task::Spawn};
use log::warn;
use client::BlockchainEvents;
use primitives::{Pair, Blake2Hasher};
use sc_client::BlockchainEvents;
use sp_core::{Pair, Blake2Hasher};
use polkadot_primitives::{
BlockId, Hash, Block,
parachain::{
......@@ -128,7 +128,7 @@ impl<R: fmt::Display> fmt::Display for Error<R> {
}
/// The Polkadot client type.
pub type PolkadotClient<B, E, R> = client::Client<B, E, Block, R>;
pub type PolkadotClient<B, E, R> = sc_client::Client<B, E, Block, R>;
/// Something that can build a `ParachainContext`.
pub trait BuildParachainContext {
......@@ -136,15 +136,20 @@ pub trait BuildParachainContext {
type ParachainContext: self::ParachainContext;
/// Build the `ParachainContext`.
fn build<B, E, R, SP>(
fn build<B, E, R, SP, Extrinsic>(
self,
client: Arc<PolkadotClient<B, E, R>>,
spawner: SP,
network: Arc<dyn Network>,
) -> Result<Self::ParachainContext, ()>
where
B: client_api::backend::Backend<Block, Blake2Hasher> + 'static,
E: client::CallExecutor<Block, Blake2Hasher> + Clone + Send + Sync + 'static,
PolkadotClient<B, E, R>: ProvideRuntimeApi<Block>,
<PolkadotClient<B, E, R> as ProvideRuntimeApi<Block>>::Api: service::RuntimeApiCollection<Extrinsic>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
<<PolkadotClient<B, E, R> as ProvideRuntimeApi<Block>>::Api as sp_api::ApiExt<Block>>::StateBackend:
sp_api::StateBackend<Blake2Hasher>,
Extrinsic: codec::Codec + Send + Sync + 'static,
E: sc_client::CallExecutor<Block> + Clone + Send + Sync + 'static,
SP: Spawn + Clone + Send + Sync + 'static;
}
......@@ -236,7 +241,7 @@ struct ApiContext<P, E, SP> {
}
impl<P: 'static, E: 'static, SP: 'static> RelayChainContext for ApiContext<P, E, SP> where
P: ProvideRuntimeApi + Send + Sync,
P: ProvideRuntimeApi<Block> + Send + Sync,
P::Api: ParachainHost<Block>,
E: futures::Future<Output=()> + Clone + Send + Sync + 'static,
SP: Spawn + Clone + Send + Sync
......@@ -266,7 +271,7 @@ impl<P: 'static, E: 'static, SP: 'static> RelayChainContext for ApiContext<P, E,
}
/// Run the collator node using the given `service`.
fn run_collator_node<S, E, P>(
fn run_collator_node<S, E, P, Extrinsic>(
service: S,
exit: E,
para_id: ParaId,
......@@ -275,19 +280,27 @@ fn run_collator_node<S, E, P>(
) -> polkadot_cli::error::Result<()>
where
S: AbstractService<Block = service::Block, NetworkSpecialization = service::PolkadotProtocol>,
client::Client<S::Backend, S::CallExecutor, service::Block, S::RuntimeApi>: ProvideRuntimeApi,
<client::Client<S::Backend, S::CallExecutor, service::Block, S::RuntimeApi> as ProvideRuntimeApi>::Api:
ParachainHost<service::Block, Error = sp_blockchain::Error>,
sc_client::Client<S::Backend, S::CallExecutor, service::Block, S::RuntimeApi>: ProvideRuntimeApi<Block>,
<sc_client::Client<S::Backend, S::CallExecutor, service::Block, S::RuntimeApi> as ProvideRuntimeApi<Block>>::Api:
service::RuntimeApiCollection<
Extrinsic,
Error = sp_blockchain::Error,
StateBackend = sc_client_api::StateBackendFor<S::Backend, Block>
>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
S::Backend: service::Backend<service::Block, service::Blake2Hasher>,
S::Backend: service::Backend<service::Block>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
S::CallExecutor: service::CallExecutor<service::Block, service::Blake2Hasher>,
<S::Backend as service::Backend<service::Block>>::State:
sp_api::StateBackend<sp_runtime::traits::HasherFor<Block>>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
S::CallExecutor: service::CallExecutor<service::Block>,
// Rust bug: https://github.com/rust-lang/rust/issues/24159
S::SelectChain: service::SelectChain<service::Block>,
E: futures::Future<Output=()> + Clone + Unpin + Send + Sync + 'static,
P: BuildParachainContext,
P::ParachainContext: Send + 'static,
<P::ParachainContext as ParachainContext>::ProduceCandidate: Send,
Extrinsic: service::Codec + Send + Sync + 'static,
{
let runtime = tokio::runtime::Runtime::new().map_err(|e| format!("{:?}", e))?;
let spawner = WrappedExecutor(service.spawn_task_handle());
......
......@@ -22,8 +22,9 @@ log = "0.4.8"
exit-future = "0.2.0"
sc-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
wasm-timer = "0.2.4"
[dev-dependencies]
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
......@@ -49,7 +49,7 @@
//! Peers who send information which was not allowed under a recent neighbor packet
//! will be noted as non-beneficial to Substrate's peer-set management utility.
use sp_runtime::{generic::BlockId, traits::{ProvideRuntimeApi, BlakeTwo256, Hash as HashT}};
use sp_runtime::{generic::BlockId, traits::{BlakeTwo256, Hash as HashT}};
use sp_blockchain::Error as ClientError;
use sc_network::{config::Roles, Context, PeerId, ReputationChange};
use sc_network_gossip::{
......@@ -63,6 +63,7 @@ use polkadot_primitives::parachain::{
};
use polkadot_erasure_coding::{self as erasure};
use codec::{Decode, Encode};
use sp_api::ProvideRuntimeApi;
use std::collections::HashMap;
use std::sync::Arc;
......@@ -273,8 +274,8 @@ pub trait ChainContext: Send + Sync {
impl<F, P> ChainContext for (F, P) where
F: Fn(&Hash) -> Option<Known> + Send + Sync,
P: Send + Sync + std::ops::Deref,
P::Target: ProvideRuntimeApi,
<P::Target as ProvideRuntimeApi>::Api: ParachainHost<Block, Error = ClientError>,
P::Target: ProvideRuntimeApi<Block>,
<P::Target as ProvideRuntimeApi<Block>>::Api: ParachainHost<Block, Error = ClientError>,
{
fn is_known(&self, block_hash: &Hash) -> Option<Known> {
(self.0)(block_hash)
......
......@@ -23,7 +23,7 @@
//! the `TableRouter` trait from `polkadot-validation`, which is expected to call into a shared statement table
//! and dispatch evaluation work as necessary when new statements come in.
use sp_runtime::traits::{ProvideRuntimeApi, BlakeTwo256, Hash as HashT};
use sp_runtime::traits::{BlakeTwo256, Hash as HashT};
use polkadot_validation::{
SharedTable, TableRouter, SignedStatement, GenericStatement, ParachainWork, Validated
};
......@@ -32,6 +32,7 @@ use polkadot_primitives::parachain::{
OutgoingMessages, CandidateReceipt, ParachainHost, ValidatorIndex, Collation, PoVBlock, ErasureChunk,
};
use crate::gossip::{RegisteredMessageValidator, GossipMessage, GossipStatement, ErasureChunkMessage};
use sp_api::ProvideRuntimeApi;
use futures::prelude::*;
use futures::{task::SpawnExt, future::{ready, select}};
......@@ -127,7 +128,7 @@ impl<P, E: Clone, T: Clone> Clone for Router<P, E, T> {
}
}
impl<P: ProvideRuntimeApi + Send + Sync + 'static, E, T> Router<P, E, T> where
impl<P: ProvideRuntimeApi<Block> + Send + Sync + 'static, E, T> Router<P, E, T> where
P::Api: ParachainHost<Block, Error = sp_blockchain::Error>,
T: Clone + Executor + Send + 'static,
E: Future<Output=()> + Clone + Send + Unpin + 'static,
......@@ -225,7 +226,7 @@ impl<P: ProvideRuntimeApi + Send + Sync + 'static, E, T> Router<P, E, T> where
}
}
impl<P: ProvideRuntimeApi + Send, E, T> TableRouter for Router<P, E, T> where
impl<P: ProvideRuntimeApi<Block> + Send, E, T> TableRouter for Router<P, E, T> where
P::Api: ParachainHost<Block>,
T: Clone + Executor + Send + 'static,
E: Future<Output=()> + Clone + Send + 'static,
......
......@@ -29,8 +29,7 @@ use polkadot_primitives::parachain::{
use sp_core::crypto::UncheckedInto;
use codec::Encode;
use sc_network::{
PeerId, Context, ReputationChange, config::Roles, message::generic::ConsensusMessage,
specialization::NetworkSpecialization,
PeerId, Context, ReputationChange, config::Roles, specialization::NetworkSpecialization,
};
use futures::executor::block_on;
......@@ -57,10 +56,6 @@ impl Context<Block> for TestContext {
}
}
fn send_consensus(&mut self, _who: PeerId, _consensus: Vec<ConsensusMessage>) {
unimplemented!()
}
fn send_chain_specific(&mut self, who: PeerId, message: Vec<u8>) {
self.messages.push((who, message))
}
......
......@@ -34,8 +34,8 @@ use polkadot_primitives::parachain::{
};
use parking_lot::Mutex;
use sp_blockchain::Result as ClientResult;
use sp_api::{Core, RuntimeVersion, StorageProof, ApiExt};
use sp_runtime::traits::{ApiRef, {Block as BlockT}, ProvideRuntimeApi};
use sp_api::{ApiRef, Core, RuntimeVersion, StorageProof, ApiErrorExt, ApiExt, ProvideRuntimeApi};
use sp_runtime::traits::Block as BlockT;
use std::collections::HashMap;
use std::sync::Arc;
......@@ -161,7 +161,7 @@ struct RuntimeApi {
data: Arc<Mutex<ApiData>>,
}
impl ProvideRuntimeApi for TestApi {
impl ProvideRuntimeApi<Block> for TestApi {
type Api = RuntimeApi;
fn runtime_api<'a>(&'a self) -> ApiRef<'a, Self::Api> {
......@@ -201,8 +201,12 @@ impl Core<Block> for RuntimeApi {
}
}
impl ApiExt<Block> for RuntimeApi {
impl ApiErrorExt for RuntimeApi {
type Error = sp_blockchain::Error;
}
impl ApiExt<Block> for RuntimeApi {
type StateBackend = sp_state_machine::InMemoryBackend<sp_api::HasherFor<Block>>;
fn map_api_result<F: FnOnce(&Self) -> Result<R, E>, R, E>(
&self,
......@@ -220,6 +224,19 @@ impl ApiExt<Block> for RuntimeApi {
fn extract_proof(&mut self) -> Option<StorageProof> {
None
}
fn into_storage_changes<
T: sp_api::ChangesTrieStorage<sp_api::HasherFor<Block>, sp_api::NumberFor<Block>>
>(
&self,
_: &Self::StateBackend,
_: Option<&T>,
_: <Block as sp_api::BlockT>::Hash,
) -> std::result::Result<sp_api::StorageChanges<Self::StateBackend, Block>, String>
where Self: Sized
{
unimplemented!("Not required for testing!")
}
}
impl ParachainHost<Block> for RuntimeApi {
......
......@@ -19,7 +19,6 @@
//! This fulfills the `polkadot_validation::Network` trait, providing a hook to be called
//! each time validation leaf work begins on a new chain head.
use sp_runtime::traits::ProvideRuntimeApi;
use sc_network::PeerId;
use polkadot_validation::{
Network as ParachainNetwork, SharedTable, Collators, Statement, GenericStatement, SignedStatement,
......@@ -29,6 +28,7 @@ use polkadot_primitives::parachain::{
Id as ParaId, Collation, OutgoingMessages, ParachainHost, CandidateReceipt, CollatorId,
ValidatorId, PoVBlock,
};
use sp_api::ProvideRuntimeApi;
use futures::prelude::*;
use futures::task::SpawnExt;
......@@ -93,7 +93,7 @@ impl<P, E: Clone, T: Clone> Clone for ValidationNetwork<P, E, T> {
}
impl<P, E, T> ValidationNetwork<P, E, T> where
P: ProvideRuntimeApi + Send + Sync + 'static,
P: ProvideRuntimeApi<Block> + Send + Sync + 'static,
P::Api: ParachainHost<Block>,
E: Clone + Future<Output=()> + Send + Sync + 'static,
T: Clone + Executor + Send + Sync + 'static,
......@@ -177,7 +177,7 @@ impl<P, E, T> ValidationNetwork<P, E, T> {
/// A long-lived network which can create parachain statement routing processes on demand.
impl<P, E, T> ParachainNetwork for ValidationNetwork<P, E, T> where
P: ProvideRuntimeApi + Send + Sync + 'static,
P: ProvideRuntimeApi<Block> + Send + Sync + 'static,
P::Api: ParachainHost<Block, Error = sp_blockchain::Error>,
E: Clone + Future<Output=()> + Send + Sync + Unpin + 'static,
T: Clone + Executor + Send + Sync + 'static,
......@@ -235,7 +235,7 @@ impl<P, E, T> ParachainNetwork for ValidationNetwork<P, E, T> where
pub struct NetworkDown;
impl<P, E: Clone, N: Clone> Collators for ValidationNetwork<P, E, N> where
P: ProvideRuntimeApi + Send + Sync + 'static,
P: ProvideRuntimeApi<Block> + Send + Sync + 'static,
P::Api: ParachainHost<Block>,
{
type Error = NetworkDown;
......@@ -572,7 +572,7 @@ impl<P, E: Clone, T: Clone> Clone for LeafWorkDataFetcher<P, E, T> {
}
}
impl<P: ProvideRuntimeApi + Send, E, T> LeafWorkDataFetcher<P, E, T> where
impl<P: ProvideRuntimeApi<Block> + Send, E, T> LeafWorkDataFetcher<P, E, T> where
P::Api: ParachainHost<Block>,
T: Clone + Executor + Send + 'static,