Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Chain Selection Subsystem Logic #3277

Merged
85 commits merged into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
66bf4b2
crate skeleton and type definitions
rphmeier Jun 16, 2021
dfb09e5
add ChainSelectionMessage
rphmeier Jun 16, 2021
5a474eb
add error type
rphmeier Jun 16, 2021
9c2340b
run loop
rphmeier Jun 16, 2021
3c49a32
fix overseer
rphmeier Jun 16, 2021
06e92a6
simplify determine_new_blocks API
rphmeier Jun 16, 2021
a2b0250
write an overlay struct and fetch new blocks
rphmeier Jun 16, 2021
8790e52
add new function to overlay
rphmeier Jun 16, 2021
d0f0f45
more flow
rphmeier Jun 16, 2021
60196bf
add leaves to overlay and add a strong type around leaves-set
rphmeier Jun 16, 2021
a023348
add is_parent_viable
rphmeier Jun 16, 2021
537e59b
implement block import, ignoring reversions
rphmeier Jun 16, 2021
22705aa
add stagnant-at to overlay
rphmeier Jun 16, 2021
c71d5b2
add stagnant
rphmeier Jun 17, 2021
422afc4
add revert consensus log
rphmeier Jun 17, 2021
70e5d8a
flow for reversions
rphmeier Jun 17, 2021
a792b1c
extract and import block reversions
rphmeier Jun 17, 2021
3487cf3
recursively update viability
rphmeier Jun 17, 2021
4a1f610
remove redundant parameter from WriteBlockEntry
rphmeier Jun 17, 2021
ae74536
do some removal of viable leaves
rphmeier Jun 17, 2021
b678828
address grumbles
rphmeier Jun 17, 2021
645327a
refactor
rphmeier Jun 17, 2021
2a40721
address grumbles
rphmeier Jun 17, 2021
f76d410
add comment about non-monotonicity
rphmeier Jun 17, 2021
2602e50
extract backend to submodule
rphmeier Jun 17, 2021
efc0963
begin the hunt for viable leaves
rphmeier Jun 17, 2021
5ec0064
viability pivots for updating the active leaves
rphmeier Jun 17, 2021
750b8d7
remove LeafSearchFrontier
rphmeier Jun 17, 2021
bb1de40
partially -> explicitly viable and untwist some booleans
rphmeier Jun 17, 2021
8f3c533
extract tree to submodule
rphmeier Jun 17, 2021
ec48118
implement block finality update
rphmeier Jun 17, 2021
82c1817
Implement block approval routine
rphmeier Jun 17, 2021
6f2edf3
implement stagnant detection
rphmeier Jun 17, 2021
a1d9169
ensure blocks pruned on finality are removed from the active leaves set
rphmeier Jun 17, 2021
a969a2b
write down some planned test cases
rphmeier Jun 17, 2021
6ed7ac4
floww
rphmeier Jun 17, 2021
0577ed6
leaf loading
rphmeier Jun 17, 2021
c10d52c
implement best_leaf_containing
rphmeier Jun 17, 2021
5407dae
write down a few more tests to do
rphmeier Jun 17, 2021
53e4539
Merge branch 'master' into rh-chain-selection-subsystem
rphmeier Jun 17, 2021
f975bf2
remove dependence of tree on header
rphmeier Jun 17, 2021
2518a17
guide: ChainApiMessage::BlockWeight
rphmeier Jun 18, 2021
32d73a1
node: BlockWeight ChainAPI
rphmeier Jun 18, 2021
ca45cc3
fix compile issue
rphmeier Jun 18, 2021
d08f418
Merge branch 'rh-block-weight-message' into rh-chain-selection-subsystem
rphmeier Jun 18, 2021
8a97b71
note a few TODOs for the future
rphmeier Jun 18, 2021
05dc72a
fetch block weight using new BlockWeight ChainAPI
rphmeier Jun 18, 2021
f95d23e
implement unimplemented
rphmeier Jun 18, 2021
5c2d2d9
sort leaves by block number after weight
rphmeier Jun 18, 2021
fc13846
remove warnings and add more TODOs
rphmeier Jun 18, 2021
fabc28d
create test module
rphmeier Jun 18, 2021
46d2416
storage for test backend
rphmeier Jun 18, 2021
14e8518
wrap inner in mutex
rphmeier Jun 18, 2021
c4457ae
add write waker query to test backend
rphmeier Jun 18, 2021
6308490
Add OverseerSignal -> FromOverseer conversion
rphmeier Jun 18, 2021
45a07c8
add test harnes
rphmeier Jun 18, 2021
f439ed7
add no-op test
rphmeier Jun 18, 2021
d163da5
add some more test helpers
rphmeier Jun 18, 2021
c838388
the first test
rphmeier Jun 18, 2021
b8c12ee
more progress on tests
rphmeier Jun 19, 2021
a05cb2b
test two subtrees
rphmeier Jun 19, 2021
1711f11
determine-new-blocks: cleaner genesis avoidance and tighter ancestry …
rphmeier Jun 19, 2021
0586dbc
don't make ancestry requests when asking for one block
rphmeier Jun 19, 2021
d73d621
add a couple more tests
rphmeier Jun 19, 2021
1185b75
Merge branch 'master' into rh-chain-selection-subsystem
rphmeier Jun 19, 2021
2dd5358
add to AllMessages in guide
rphmeier Jun 19, 2021
f42230c
remove bad spaces from bridge
rphmeier Jun 19, 2021
99b4392
compact iterator
rphmeier Jun 19, 2021
5afd66a
test import with gaps
rphmeier Jun 19, 2021
bf15a67
more reversion tests
rphmeier Jun 19, 2021
1aabcb3
test finalization pruning subtrees
rphmeier Jun 19, 2021
8dff999
fixups
rphmeier Jun 19, 2021
16c26e8
test clobbering and fix bug in overlay
rphmeier Jun 19, 2021
2b075b1
exhaustive backend state after finalizaiton tested
rphmeier Jun 19, 2021
5a7abf9
more finality tests
rphmeier Jun 20, 2021
a512985
leaf tests
rphmeier Jun 20, 2021
cb2d136
test approval
rphmeier Jun 20, 2021
4e01714
test ChainSelectionMessage::Leaves thoroughly
rphmeier Jun 20, 2021
9a16ffc
remove TODO
rphmeier Jun 20, 2021
31f47de
avoid Ordering::is_ne so CI can build
rphmeier Jun 20, 2021
eeb4c89
comment algorithmic complexity
rphmeier Jun 20, 2021
085b612
Merge branch 'master' into rh-chain-selection-subsystem
rphmeier Jun 20, 2021
4132129
Update node/core/chain-selection/src/lib.rs
rphmeier Jun 21, 2021
16ceda8
Merge branch 'master' into rh-chain-selection-subsystem
rphmeier Jun 21, 2021
0465903
Merge branch 'rh-chain-selection-subsystem' of https://github.com/par…
rphmeier Jun 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ members = [
"node/core/bitfield-signing",
"node/core/candidate-validation",
"node/core/chain-api",
"node/core/chain-selection",
"node/core/dispute-coordinator",
"node/core/dispute-participation",
"node/core/parachains-inherent",
Expand Down
21 changes: 21 additions & 0 deletions node/core/chain-selection/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "polkadot-node-core-chain-selection"
description = "Chain Selection Subsystem"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

[dependencies]
futures = "0.3.15"
tracing = "0.1.26"
polkadot-primitives = { path = "../../../primitives" }
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
kvdb = "0.9.0"
thiserror = "1.0.23"
parity-scale-codec = "2"

[dev-dependencies]
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
kvdb-memorydb = "0.9.0"
Loading