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

Implement Approval Voting Subsystem #2112

Merged
merged 210 commits into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
210 commits
Select commit Hold shift + click to select a range
21d108e
skeleton
rphmeier Dec 10, 2020
7c0a083
skeleton aux-schema module
rphmeier Dec 11, 2020
f1308f0
start approval types
rphmeier Dec 11, 2020
6a6c5c0
start aux schema with aux store
rphmeier Dec 11, 2020
7173066
doc
rphmeier Dec 11, 2020
006dfa7
finish basic types
rphmeier Dec 11, 2020
557b518
start approval types
rphmeier Dec 11, 2020
dc55799
doc
rphmeier Dec 11, 2020
fe79b4f
finish basic types
rphmeier Dec 11, 2020
e772603
Merge branch 'master' into rh-approval-types
rphmeier Dec 11, 2020
8c0cef1
write out schema types
rphmeier Dec 11, 2020
5ec3cfb
add debug and codec impls to approval types
rphmeier Dec 11, 2020
f415724
add debug and codec impls to approval types
rphmeier Dec 11, 2020
1088ec3
add debug and codec impls to approval types
rphmeier Dec 11, 2020
3ce7414
getters for block and candidate entries
rphmeier Dec 11, 2020
c9af5a0
grumbles
rphmeier Dec 11, 2020
65f9fed
remove unused AssignmentId
rphmeier Dec 11, 2020
321d43b
Merge branch 'rh-approval-types' into rh-approval-voting
rphmeier Dec 11, 2020
910982a
load_decode utility
rphmeier Dec 11, 2020
76bcfac
implement DB clearing
rphmeier Dec 12, 2020
9a04615
function for adding new block entry to aux store
rphmeier Dec 12, 2020
bc6dcc2
start `canonicalize` implementation
rphmeier Dec 15, 2020
834d776
more skeleton
rphmeier Dec 17, 2020
31e840e
Merge branch 'master' into rh-approval-voting
rphmeier Dec 18, 2020
5d1fafb
Merge branch 'master' into rh-approval-voting
rphmeier Dec 22, 2020
aebfecc
finish implementing canonicalize
rphmeier Dec 23, 2020
7faa0c3
tag TODO
rphmeier Dec 23, 2020
4a49ffb
implement a test AuxStore
rphmeier Dec 23, 2020
0f1a8d6
add allow(unused)
rphmeier Dec 23, 2020
f7d7c49
basic loading and deleting test
rphmeier Dec 23, 2020
0d384f7
block_entry test function
rphmeier Dec 23, 2020
b07f7a9
add a test for `add_block_entry`
rphmeier Dec 23, 2020
ec798fb
ensure range is exclusive at end
rphmeier Dec 23, 2020
10613b4
test clear()
rphmeier Dec 23, 2020
bbe4b0c
test that add_block sets children
rphmeier Dec 23, 2020
a13d54c
add a test for canonicalize
rphmeier Dec 24, 2020
ab9b9bf
extract Pre-digest from header
rphmeier Dec 25, 2020
9709fa6
utilities for extracting RelayVRFStory from the header-chain
rphmeier Dec 25, 2020
630d79a
add approval voting message types
rphmeier Dec 25, 2020
6a5b892
approval distribution message type
rphmeier Dec 25, 2020
70c2075
subsystem skeleton
rphmeier Dec 25, 2020
f69c8ca
state struct
rphmeier Dec 25, 2020
e80d947
add futures-timer
rphmeier Dec 27, 2020
01bc83a
prepare service for babe slot duration
rphmeier Dec 27, 2020
40dcb00
more skeleton
rphmeier Dec 27, 2020
147ca81
better integrate AuxStore
rphmeier Dec 27, 2020
fc07a6f
RelayVRF -> RelayVRFStory
rphmeier Dec 27, 2020
dd4fd1b
canonicalize
rphmeier Dec 27, 2020
75f868d
implement some tick functionality
rphmeier Dec 27, 2020
a422f12
guide: tweaks
rphmeier Dec 27, 2020
43f298f
check_approval
rphmeier Dec 27, 2020
86a2b20
more tweaks and helpers
rphmeier Dec 27, 2020
8a5321b
guide: add core index to candidate event
rphmeier Dec 27, 2020
97691b4
primitives: add core index to candidate event
rphmeier Dec 27, 2020
b504272
runtime: add core index to candidate events
rphmeier Dec 27, 2020
b854306
head handling (session window)
rphmeier Dec 27, 2020
efe168e
implement `determine_new_blocks`
rphmeier Jan 2, 2021
a4a0e35
add TODO
rphmeier Jan 2, 2021
27a3b37
change error type on functions
rphmeier Jan 2, 2021
3e42b0e
compute RelayVRFModulo assignments
rphmeier Jan 5, 2021
c9ee700
compute RelayVRFDelay assignments
rphmeier Jan 5, 2021
8903b95
fix delay tranche calc
rphmeier Jan 5, 2021
632b93b
assignment checking
rphmeier Jan 5, 2021
0e6d113
pluralize
rphmeier Jan 5, 2021
804c5e3
some dummy code for fetching assignments
rphmeier Jan 5, 2021
59963cd
guide: add babe epoch runtime API
rphmeier Jan 5, 2021
e1f76e6
Merge branch 'master' into rh-approval-voting
rphmeier Jan 5, 2021
31bf98d
implement a current_epoch() runtime API
rphmeier Jan 5, 2021
b2cffb3
compute assignments
rphmeier Jan 5, 2021
90cfdad
candidate events get backing group
rphmeier Jan 5, 2021
edc55e7
import blocks and assignments into DB
rphmeier Jan 5, 2021
8f12a41
push block approval meta
rphmeier Jan 5, 2021
2063f04
add message types, no overseer integration yet
rphmeier Jan 5, 2021
009d8db
notify approval distribution of new blocks
rphmeier Jan 5, 2021
6f7d308
refactor import into separate functions
rphmeier Jan 7, 2021
8ca50c6
impl tranches_to_approve
rphmeier Jan 7, 2021
ffba8a4
guide: improve function signatures
rphmeier Jan 7, 2021
dcbb35c
guide: remove Tick from ApprovalEntry
rphmeier Jan 7, 2021
02a4cae
trigger and broadcast assignment
rphmeier Jan 7, 2021
73078e1
most of approval launching
rphmeier Jan 7, 2021
680e406
remove byteorder crate
rphmeier Jan 8, 2021
5fd4256
Merge branch 'master' into rh-approval-voting
rphmeier Jan 13, 2021
875df33
Merge branch 'master' into rh-approval-voting
rphmeier Jan 14, 2021
9f53085
Merge branch 'master' into rh-approval-voting
rphmeier Jan 19, 2021
68256cc
load blocks back to finality, except on startup
rphmeier Jan 19, 2021
412c18f
check unchecked assignments
rphmeier Jan 19, 2021
1652d67
add claimed core to approval voting message
rphmeier Jan 19, 2021
7c59dc5
fix checks
rphmeier Jan 19, 2021
2e3f040
assign only to backing group
rphmeier Jan 19, 2021
6d338f4
remove import_checked_assignment from guide
rphmeier Jan 19, 2021
69d694c
newline
rphmeier Jan 19, 2021
5b1d881
import assignments
rphmeier Jan 19, 2021
8ebe316
abstract out a bit
rphmeier Jan 19, 2021
4ff83df
check and import approvals
rphmeier Jan 19, 2021
7db5f94
check full approvals from assignment import too
rphmeier Jan 19, 2021
5d56ccc
comment
rphmeier Jan 19, 2021
3f3cc1f
create a Transaction utility
rphmeier Jan 19, 2021
31f1dfc
must_use
rphmeier Jan 19, 2021
e80abad
use transaction in `check_full_approvals`
rphmeier Jan 19, 2021
9e89f7f
wire up wakeups
rphmeier Jan 19, 2021
bff1202
add Ord to CandidateHash
rphmeier Jan 20, 2021
f79a465
wakeup refactoring
rphmeier Jan 20, 2021
b77c378
return candidate info from add_block_entry
rphmeier Jan 20, 2021
d1d0ae2
schedule wakeups
rphmeier Jan 20, 2021
54e3a2c
background task: do candidate validation
rphmeier Jan 20, 2021
f52e4ef
forward candidate validation requests
rphmeier Jan 20, 2021
de6014b
issue approval votes when requested
rphmeier Jan 20, 2021
7cbeea8
clean up a couple TODOs
rphmeier Jan 20, 2021
77c6588
fix up session caching
rphmeier Jan 20, 2021
a193fe6
clean up last unimplemented!() items
rphmeier Jan 20, 2021
7d955fa
fix remaining warnings
rphmeier Jan 20, 2021
fb37872
remove TODO
rphmeier Jan 20, 2021
da701d6
implement handle_approved_ancestor
rphmeier Jan 20, 2021
1785a63
Merge branch 'master' into rh-approval-voting
rphmeier Jan 20, 2021
25893b5
update Cargo.lock
rphmeier Jan 20, 2021
c3fda6d
fix runtime API tests
rphmeier Jan 21, 2021
9f82c7c
Merge branch 'master' into rh-approval-voting
rphmeier Jan 25, 2021
a1a3682
guide: cleanup assignment checking
rphmeier Jan 25, 2021
447a730
use claimed candidate index instead of core
rphmeier Jan 25, 2021
04351ff
extract time to a trait
rphmeier Jan 26, 2021
e711da1
tests module
rphmeier Jan 26, 2021
21c3bdc
write a mock clock for testing
rphmeier Jan 26, 2021
bcacffa
allow swapping out the clock
rphmeier Jan 26, 2021
87d38b4
make abstract over assignment criteria
rphmeier Jan 26, 2021
03c03a6
add some skeleton tests and simplify params
rphmeier Jan 26, 2021
ab767c5
fix backing group check
rphmeier Jan 26, 2021
3970743
do backing group check inside check_assignment_cert
rphmeier Jan 26, 2021
4bac890
write some empty test functions to implement
rphmeier Jan 26, 2021
59b5b20
add a test for non-backing
rphmeier Jan 26, 2021
b41ef2b
test that produced checks pass
rphmeier Jan 27, 2021
3d43c2e
some empty test ideas
rphmeier Jan 27, 2021
93352f3
runtime/inclusion: remove outdated TODO
ordian Jan 27, 2021
3484c01
fix compilation
ordian Jan 27, 2021
ed485a9
merge master, cache current_epoch
ordian Jan 27, 2021
95a1597
av-store: fix tests
ordian Jan 27, 2021
a9d09d3
dummy cert
rphmeier Jan 28, 2021
bc21e54
criteria tests
rphmeier Jan 29, 2021
508cb9c
Merge branch 'rh-approval-voting' of https://github.com/paritytech/po…
rphmeier Jan 29, 2021
657653a
move `TestStore` to main tests file
rphmeier Jan 29, 2021
c251c97
fix unused warning
rphmeier Jan 29, 2021
88a2702
test harness beginnings
rphmeier Jan 29, 2021
43187c4
Merge branch 'master' into rh-approval-voting
rphmeier Jan 29, 2021
7022acb
resolve slots renaming fallout
ordian Jan 29, 2021
2faf02f
merge master and resolve bitvec upgrade fallout
ordian Jan 29, 2021
4a1d757
more compilation fixes
ordian Jan 29, 2021
849f4a7
merge master
ordian Jan 29, 2021
1059ca6
wip: extract pure data into a separate module
ordian Jan 29, 2021
32672b8
wip: extract pure data into a separate module
ordian Jan 29, 2021
0356ae8
Merge remote-tracking branch 'upstream/ao-approvals-schema-refactorin…
rphmeier Jan 29, 2021
673687a
move types completely to v1
rphmeier Jan 29, 2021
64de08f
add persisted_entries
rphmeier Jan 29, 2021
ded9327
add conversion trait impls
rphmeier Jan 29, 2021
0b2a679
clean up some warnings
rphmeier Jan 29, 2021
bd4a338
extract import logic to own module
rphmeier Jan 29, 2021
0770372
schedule wakeups
rphmeier Jan 29, 2021
67d4e1f
experiment with Actions
rphmeier Jan 29, 2021
88897c0
uncomment approval-checking
rphmeier Jan 29, 2021
b9276ef
separate module for approval checking utilities
rphmeier Jan 29, 2021
8faf8e8
port more code to use actions
rphmeier Jan 29, 2021
85d7595
get approval pipeline using actions
rphmeier Jan 29, 2021
ef84125
all logic is uncommented
rphmeier Jan 29, 2021
7cd4c46
main loop processes actions
rphmeier Jan 29, 2021
766e61f
all loop logic uncommented
rphmeier Jan 29, 2021
d0aaaa1
separate function for handling actions
rphmeier Jan 29, 2021
8394cba
remove last unimplemented item
rphmeier Jan 30, 2021
531fbb0
clean up warnings
rphmeier Jan 30, 2021
14a70cd
State gives read-only access to underlying DB
rphmeier Jan 30, 2021
b0dff23
tests for approval checking
rphmeier Jan 30, 2021
1fcb0f9
tests for approval criteria
rphmeier Jan 31, 2021
9605790
skeleton test module for import
rphmeier Jan 31, 2021
08f81ec
list of import tests to do
rphmeier Jan 31, 2021
012787e
some test glue code
ordian Jan 31, 2021
35c5f37
test reject bad assignment
ordian Feb 1, 2021
87a2ff2
merge master
ordian Feb 1, 2021
6ffec77
test slot too far in future
ordian Feb 1, 2021
580c3a3
test reject assignment with unknown candidate
ordian Feb 1, 2021
a7668fa
remove loads_blocks tests
rphmeier Feb 1, 2021
6570762
Merge branch 'rh-approval-voting' of https://github.com/paritytech/po…
rphmeier Feb 1, 2021
3eb8e69
determine_new_blocks back to finalized & harness
rphmeier Feb 2, 2021
272b903
more coverage for determining new blocks
rphmeier Feb 2, 2021
bccac4f
make `imported_block_info` have less reliance on State
rphmeier Feb 2, 2021
b8310ac
candidate_info tests
rphmeier Feb 3, 2021
a878213
tests for session caching
rphmeier Feb 3, 2021
51c1781
remove println
rphmeier Feb 3, 2021
13ffa9f
extricate DB and main TestStores
rphmeier Feb 3, 2021
f3f2f48
rewrite approval checking logic to counteract early delays
rphmeier Feb 4, 2021
c99b47b
move state out of function
rphmeier Feb 4, 2021
54f6962
update approval-checking tests
rphmeier Feb 4, 2021
180fe24
tweak wakeups & scheduling logic
rphmeier Feb 5, 2021
69638e8
Merge branch 'master' into rh-approval-voting
rphmeier Feb 6, 2021
4b229b2
rename check_full_approvals
rphmeier Feb 6, 2021
41ee07a
test that assignment import updates candidate
rphmeier Feb 6, 2021
0869646
some approval import tests
rphmeier Feb 6, 2021
079575e
some tests for check_and_apply_approval
rphmeier Feb 6, 2021
873063e
add 'full' qualifier to avoid confusion
rphmeier Feb 6, 2021
a2e7968
extract should-trigger logic to separate function
rphmeier Feb 6, 2021
a5bfc7a
some tests for all triggering
rphmeier Feb 6, 2021
c0352ce
tests for when we trigger assignments
rphmeier Feb 6, 2021
8025284
test wakeups
rphmeier Feb 8, 2021
ccda952
add block utilities for testing
rphmeier Feb 9, 2021
b048750
some more tests for approval updates
rphmeier Feb 9, 2021
d1ca924
approved_ancestor tests
rphmeier Feb 9, 2021
71c8700
new action type for launch approval
rphmeier Feb 9, 2021
0343f07
process-wakeup tests
rphmeier Feb 9, 2021
2733750
clean up some warnings
rphmeier Feb 9, 2021
6c36404
fix in_future test
rphmeier Feb 9, 2021
febf042
approval checking tests
rphmeier Feb 9, 2021
e702f9f
tighten up too-far-in-future
rphmeier Feb 9, 2021
f013355
special-case genesis when caching sessions
rphmeier Feb 9, 2021
27daa4f
fix bitfield len
rphmeier Feb 11, 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
24 changes: 23 additions & 1 deletion Cargo.lock

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

21 changes: 19 additions & 2 deletions node/core/approval-voting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,33 @@ edition = "2018"

[dependencies]
futures = "0.3.8"
futures-timer = "3.0.2"
parity-scale-codec = { version = "2.0.0", default-features = false, features = ["bit-vec", "derive"] }
tracing = "0.1.22"
tracing-futures = "0.2.4"
bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] }
merlin = "2.0"
schnorrkel = "0.9.1"

polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
polkadot-overseer = { path = "../../overseer" }
polkadot-primitives = { path = "../../../primitives" }
polkadot-node-primitives = { path = "../../primitives" }
bitvec = "0.20.1"

sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-consensus-slots = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, features = ["full_crypto"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }

[dev-dependencies]
[dev-dependencies]
parking_lot = "0.11.1"
rand_core = "0.5.1" # should match schnorrkel
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" }
maplit = "1.0.2"
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
assert_matches = "1.4.0"
Loading