Make BlockImport and Verifier async (#8472)

* Make grandpa work

* Introduce `SharedData`

* Add test and fix bugs

* Switch to `SharedData`

* Make grandpa tests working

* More Babe work

* Make it async

* Fix fix

* Use `async_trait` in sc-consensus-slots

This makes the code a little bit easier to read and also expresses that
there can always only be one call at a time to `on_slot`.

* Make grandpa tests compile

* More Babe tests work

* Fix network test

* Start fixing service test

* Finish service-test

* Fix sc-consensus-aura

* Fix fix fix

* More fixes

* Make everything compile *yeah*

* Fix build when we have Rust 1.51

* Update client/consensus/common/src/shared_data.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Update client/consensus/common/src/shared_data.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Update client/consensus/common/src/shared_data.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Update client/consensus/common/src/shared_data.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Update client/consensus/common/src/shared_data.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Update client/consensus/babe/src/tests.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Update client/consensus/babe/src/tests.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Fix warning

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
Bastian Köcher
2021-03-30 11:19:49 +02:00
committed by GitHub
parent 2998b42311
commit 217c4be226
65 changed files with 1241 additions and 715 deletions
+13 -1
View File
@@ -4171,6 +4171,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"futures 0.3.13",
"node-primitives",
"node-runtime",
"node-testing",
@@ -7106,6 +7107,7 @@ dependencies = [
name = "sc-consensus"
version = "0.9.0"
dependencies = [
"parking_lot 0.11.1",
"sc-client-api",
"sp-blockchain",
"sp-consensus",
@@ -7116,6 +7118,7 @@ dependencies = [
name = "sc-consensus-aura"
version = "0.9.0"
dependencies = [
"async-trait",
"derive_more",
"futures 0.3.13",
"futures-timer 3.0.2",
@@ -7157,6 +7160,7 @@ dependencies = [
name = "sc-consensus-babe"
version = "0.9.0"
dependencies = [
"async-trait",
"derive_more",
"fork-tree",
"futures 0.3.13",
@@ -7243,8 +7247,8 @@ version = "0.9.0"
dependencies = [
"fork-tree",
"parity-scale-codec 2.0.1",
"parking_lot 0.11.1",
"sc-client-api",
"sc-consensus",
"sp-blockchain",
"sp-runtime",
]
@@ -7254,6 +7258,7 @@ name = "sc-consensus-manual-seal"
version = "0.9.0"
dependencies = [
"assert_matches",
"async-trait",
"derive_more",
"futures 0.3.13",
"jsonrpc-core",
@@ -7291,6 +7296,7 @@ dependencies = [
name = "sc-consensus-pow"
version = "0.9.0"
dependencies = [
"async-trait",
"derive_more",
"futures 0.3.13",
"futures-timer 3.0.2",
@@ -7442,6 +7448,7 @@ name = "sc-finality-grandpa"
version = "0.9.0"
dependencies = [
"assert_matches",
"async-trait",
"derive_more",
"dyn-clone",
"finality-grandpa",
@@ -7680,6 +7687,7 @@ name = "sc-network-test"
version = "0.8.0"
dependencies = [
"async-std",
"async-trait",
"futures 0.3.13",
"futures-timer 3.0.2",
"libp2p",
@@ -7860,6 +7868,7 @@ name = "sc-service"
version = "0.9.0"
dependencies = [
"async-std",
"async-trait",
"directories",
"exit-future",
"futures 0.1.31",
@@ -8665,6 +8674,7 @@ dependencies = [
name = "sp-consensus"
version = "0.9.0"
dependencies = [
"async-trait",
"futures 0.3.13",
"futures-timer 3.0.2",
"libp2p",
@@ -9488,6 +9498,7 @@ dependencies = [
name = "substrate-test-client"
version = "2.0.1"
dependencies = [
"async-trait",
"futures 0.1.31",
"futures 0.3.13",
"hash-db",
@@ -9519,6 +9530,7 @@ dependencies = [
"frame-support",
"frame-system",
"frame-system-rpc-runtime-api",
"futures 0.3.13",
"log",
"memory-db",
"pallet-babe",