Skip to content

Commit

Permalink
Add sync backing logic & refactor client to be closer to AURA api (#14)
Browse files Browse the repository at this point in the history
* early steps

* modify author-inherent and add custom FixedVelocityConsensusHook trait

* minor changes

* add test

* wip: refactor mooonkit closer to aura api (not compile yet)

* make client compile

* ref: move async backing logic in a new pallet

* add rust tests

* fmt

* cleanup some useless diff

* cleanup

* refactor

* rename pallet

* fix licence comment

* chore: rename folder nimbus-async-backing -> async-backing

* fix compilation

* add runtime API UnincludedSegmentApi

* wip

* implement lookahead collator

* rename and reorder params

* template: fix consensus task name

* fix template build (std feature)

* remove useless dev-dependency

* ref: more consistent rust features

* add default-features = false for sp-consensus-slots

* allow force-authoring in lookahead mode

* remove unused generic P

* fix nimbus-consensus package compilation

* fix: max pov size was divided by 2 twice

* missing Some

* add TimeFromRelaySlot

* TimeFromRelaySlot should be public

* Remove TimeFromRelaySlot

---------

Co-authored-by: Agusrodri <[email protected]>
  • Loading branch information
librelois and Agusrodri authored Jan 4, 2024
1 parent 76ad8d4 commit a7fc337
Show file tree
Hide file tree
Showing 23 changed files with 1,829 additions and 555 deletions.
54 changes: 54 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
[workspace]
members = [
"client/consensus/nimbus-consensus",
"pallets/aura-style-filter",
"pallets/author-inherent",
"pallets/author-mapping",
"pallets/author-slot-filter",
"pallets/migrations",
"pallets/maintenance-mode",
"pallets/randomness",
"primitives/nimbus-primitives",
"pallets/*",
"primitives/*",
"template/node",
"template/runtime",
"template/pallets/template",
Expand Down Expand Up @@ -87,6 +81,7 @@ sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release
sp-application-crypto = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
sp-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
sp-debug-derive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
sp-externalities = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
Expand Down Expand Up @@ -159,6 +154,7 @@ parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch =
cumulus-client-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
cumulus-client-consensus-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
cumulus-client-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
Expand All @@ -171,6 +167,7 @@ cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/polka
pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
polkadot-node-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
polkadot-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
Expand All @@ -182,16 +179,19 @@ staging-xcm-executor = { git = "https://github.com/paritytech/polkadot-sdk", bra
# Polkadot (client)
kusama-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
polkadot-node-subsystem = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
polkadot-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
rococo-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
xcm-simulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }

# Local (wasm)
async-backing-primitives = { path = "primitives/async-backing", default-features = false }
pallet-author-inherent = { path = "pallets/author-inherent", default-features = false }
pallet-author-mapping = { path = "pallets/author-mapping", default-features = false }
pallet-author-slot-filter = { path = "pallets/author-slot-filter", default-features = false }
pallet-async-backing = { path = "pallets/async-backing", default-features = false }
pallet-maintenance_mode = { path = "pallets/maintenance_mode", default-features = false }
pallet-migrations = { path = "pallets/migrations", default-features = false }
nimbus-primitives = { path = "primitives/nimbus-primitives", default-features = false }
Expand Down
12 changes: 11 additions & 1 deletion client/consensus/nimbus-consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ version = "0.9.0"
sc-client-api = { workspace = true }
sc-consensus = { workspace = true }
sc-consensus-manual-seal = { workspace = true }
sp-consensus-slots = { workspace = true }
sp-api = { workspace = true }
sp-application-crypto = { workspace = true }
sp-block-builder = { workspace = true }
Expand All @@ -20,12 +21,21 @@ sp-runtime = { workspace = true }
substrate-prometheus-endpoint = { workspace = true }

# Cumulus dependencies
cumulus-client-collator = { workspace = true }
cumulus-client-consensus-common = { workspace = true }
cumulus-client-consensus-proposer = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-parachain-inherent = { workspace = true }
cumulus-relay-chain-interface = { workspace = true }

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

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

# Other deps
async-trait = { workspace = true }
Expand Down
Loading

0 comments on commit a7fc337

Please sign in to comment.