Skip to content

Commit

Permalink
Add lookahead collator and enable async backing in all runtimes (#448)
Browse files Browse the repository at this point in the history
* first steps for lookahead collator implementation

* experiment lookahead collator with current 12s

* fix zombie test

* set capacity to 1 in dancebox

* fix dev nodes

* set six seconds in all runtimes

* add async backing params to zombienet config

* fix some zombie tests

* fmt and cleanup

* toml fmt

* fix ts tests

* use custom branches

* fix rust tests

* add end_lookahead channel

* changes in zombie test

* fmt

* toml fmt

* change velocity to 1

* use proper polkadot-sdk branches

* increase timeout in zombie_rotation tests

* add relay config for all zombienet suites

* point at new moonkit commit with expectedBlockTime

* replace with our own custom fork of chopsticks

* update lock

* always ask the runtime for the slot duration, otherwise there will be downtime and node needs to reboot

* fix staking ts tests

* update api-augment

* use previous timeout in zombie_parathreads

* fmt

* use proper Receiver

* cleanup some comments

* Read aura slot duration at parent block, not best block

Fixes a rare bug where collators will try to build a block before the
runtime upgrade using the slot duration from the latest block, which is
after the runtime upgrade, resulting in a stall

* adjust inflation

* pr comments

* refactor imports

---------

Co-authored-by: girazoki <[email protected]>
Co-authored-by: Tomasz Polaczyk <[email protected]>
  • Loading branch information
3 people authored Mar 21, 2024
1 parent e5e5862 commit f11c837
Show file tree
Hide file tree
Showing 39 changed files with 1,254 additions and 487 deletions.
620 changes: 313 additions & 307 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ test-relay-sproof-builder = { git = "https://github.com/moondance-labs/dancekit"
dc-orchestrator-chain-interface = { git = "https://github.com/moondance-labs/dancekit", branch = "tanssi-polkadot-v1.6.0" }

# Moonkit (wasm)
async-backing-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.6.0", default-features = false }
nimbus-consensus = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.6.0" }
nimbus-primitives = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.6.0", default-features = false }
pallet-async-backing = { git = "https://github.com/moondance-labs/moonkit", branch = "tanssi-polkadot-v1.6.0", default-features = false }
Expand Down Expand Up @@ -218,6 +219,7 @@ westend-runtime-constants = { git = "https://github.com/moondance-labs/polkadot-

# Polkadot (client)
polkadot-cli = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.6.0" }
polkadot-node-subsystem = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.6.0" }
polkadot-overseer = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.6.0" }
polkadot-primitives = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.6.0", default-features = false }
polkadot-service = { git = "https://github.com/moondance-labs/polkadot-sdk", branch = "tanssi-polkadot-v1.6.0" }
Expand Down
4 changes: 3 additions & 1 deletion client/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ cumulus-relay-chain-interface = { workspace = true }

# Polkadot
polkadot-node-primitives = { workspace = true }
polkadot-node-subsystem = { workspace = true }
polkadot-overseer = { workspace = true }
polkadot-primitives = { workspace = true }

# Nimbus Dependencies
async-backing-primitives = { workspace = true }
nimbus-consensus = { workspace = true }
nimbus-primitives = { workspace = true, features = [ "std" ] }

Expand All @@ -62,6 +64,7 @@ async-trait = { workspace = true }
futures = { workspace = true }
log = { workspace = true }
parity-scale-codec = { workspace = true, features = [ "derive" ] }
tokio = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
Expand All @@ -76,4 +79,3 @@ sc-network-test = { workspace = true }
sp-keyring = { workspace = true }
substrate-test-runtime-client = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true }
1 change: 1 addition & 0 deletions client/consensus/src/collators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// along with Tanssi. If not, see <http://www.gnu.org/licenses/>.

pub mod basic;
pub mod lookahead;

use {
crate::{find_pre_digest, AuthorityId, OrchestratorAuraWorkerAuxData},
Expand Down
Loading

0 comments on commit f11c837

Please sign in to comment.