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

Implement Lean BEEFY #10882

Merged
merged 59 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
e47067a
consolidate set best beefy block operation
acatangiu Feb 16, 2022
f0fc691
add new beefy future to be used for core logic
acatangiu Feb 16, 2022
26887ed
add logic to init best beefy
acatangiu Feb 16, 2022
f56eb0b
beefy: only hold single active round
acatangiu Feb 16, 2022
f5eab4a
move beefy voting logic to separate async task
acatangiu Feb 16, 2022
606a5fa
beefy voting logic - wip 2
acatangiu Feb 17, 2022
e956de9
beefy voting logic - wip 3
acatangiu Feb 17, 2022
02e85f7
beefy keep track of votes for multiple blocks within one session
acatangiu Feb 17, 2022
38c1b48
improve self-equivocation logic
acatangiu Feb 17, 2022
bbd3487
beefy voting logic - wip 4
acatangiu Feb 18, 2022
d236c7f
beefy fix gossip rounds - wip 5
acatangiu Feb 18, 2022
9d1cbca
remove leftover commented code
acatangiu Feb 18, 2022
81b61d7
replace channel with a custom `impl Stream` object
acatangiu Feb 21, 2022
28e0c3d
fix beefy-gadged tests
acatangiu Feb 21, 2022
db02909
Apply suggestions from code review
acatangiu Feb 21, 2022
d5e84ab
explicitly handle no best beefy block
acatangiu Feb 21, 2022
0a045b1
fix walk up the chain looking for session boundary
acatangiu Feb 21, 2022
5b3f28f
pallet-beefy: correctly change session
acatangiu Feb 22, 2022
ef28ce3
fix tests
acatangiu Feb 22, 2022
6a55e9a
better contain beefy gossip code
acatangiu Feb 22, 2022
e35faf0
address issues from code review
acatangiu Feb 22, 2022
92b4813
disallow voting rounds older than the best concluded one
acatangiu Feb 22, 2022
baab53d
add sanity check with debug error message for trying to add older bes…
acatangiu Feb 22, 2022
5ca12fe
better contain round conclusion logic
acatangiu Feb 22, 2022
5e1bf9c
enforce voting target always bigger than current best beefy
acatangiu Feb 22, 2022
5664dd9
impl review suggestions
acatangiu Feb 23, 2022
0107be0
beefy gossip: add tests
acatangiu Feb 23, 2022
8642cba
beefy rounds: add tests
acatangiu Feb 23, 2022
adfcd71
Merge branch 'master' of github.com:paritytech/substrate
acatangiu Feb 25, 2022
bbfd8b6
remove async ticker, use specialized sync functions
acatangiu Feb 25, 2022
6893234
Lean BEEFY - simplify beefy worker logic
acatangiu Feb 25, 2022
d633ce2
beefy rounds and gossip implement review suggestions
acatangiu Feb 25, 2022
2e0e0ab
pause beefy worker while network is on major sync
acatangiu Feb 28, 2022
b7cf889
Pause BEEFY worker until BEEFY runtime pallet is available
acatangiu Mar 1, 2022
1085195
sign BEEFY mandatory blocks with ending-session's validator set
acatangiu Mar 1, 2022
c172b74
Merge branch 'master' of github.com:paritytech/substrate into lean-beefy
acatangiu Mar 1, 2022
5c3a588
remove leftover debug log line
acatangiu Mar 1, 2022
e39a390
Merge branch 'master' of github.com:paritytech/substrate into lean-beefy
acatangiu Mar 2, 2022
2f8c052
add BEEFY worker tests infrastructure
acatangiu Feb 24, 2022
5f17950
Merge branch 'master' of github.com:paritytech/substrate into lean-beefy
acatangiu Mar 7, 2022
62a1d33
fix merge damage
acatangiu Mar 7, 2022
14b451c
beefy worker remove custom runtime param
acatangiu Mar 7, 2022
45ecdea
beefy worker enable run tests with mock runtime pallet
acatangiu Mar 7, 2022
624df42
avoid leaking test data in public api
acatangiu Mar 7, 2022
01d06db
add more beefy unit tests
acatangiu Mar 7, 2022
1ccfc55
add more more beefy unit tests - wip
acatangiu Mar 8, 2022
533e2a9
fix build
acatangiu Mar 9, 2022
bc2d555
add test for session init
acatangiu Mar 9, 2022
636b3cf
explicitly verify when beefy should NOT finalize blocks
acatangiu Mar 9, 2022
90a28c5
beefy full test also verify signed commitments
acatangiu Mar 9, 2022
253007b
fix BEEFY bug where some older valid round would not be gossiped
acatangiu Mar 9, 2022
3c0313c
add test with adversarial node voting on bad blocks
acatangiu Mar 11, 2022
95ccf07
Merge branch 'master' of github.com:paritytech/substrate into lean-beefy
acatangiu Mar 22, 2022
9a89f87
address review comments
acatangiu Mar 22, 2022
d807c65
fix clippy
acatangiu Mar 22, 2022
94f3b2f
review suggestions
acatangiu Mar 25, 2022
06f564a
fix known votes memory leak
acatangiu Mar 25, 2022
c04bcfb
avoid quadratic loop in getting signatures
acatangiu Mar 25, 2022
ad5d8ea
Merge branch 'master' of github.com:paritytech/substrate into lean-beefy
acatangiu Mar 25, 2022
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
9 changes: 9 additions & 0 deletions Cargo.lock

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

14 changes: 12 additions & 2 deletions client/beefy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ hex = "0.4.2"
log = "0.4"
parking_lot = "0.12.0"
thiserror = "1.0"
tokio = { version = "1.15", features = ["time"] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removed if we use futures_timer instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

wasm-timer = "0.2.5"

codec = { version = "3.0.0", package = "parity-scale-codec", features = ["derive"] }
Expand All @@ -23,22 +24,31 @@ sp-api = { version = "4.0.0-dev", path = "../../primitives/api" }
sp-application-crypto = { version = "6.0.0", path = "../../primitives/application-crypto" }
sp-arithmetic = { version = "5.0.0", path = "../../primitives/arithmetic" }
sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" }
sp-consensus = { version = "0.10.0-dev", path = "../../primitives/consensus/common" }
sp-core = { version = "6.0.0", path = "../../primitives/core" }
sp-keystore = { version = "0.12.0", path = "../../primitives/keystore" }
sp-runtime = { version = "6.0.0", path = "../../primitives/runtime" }

sc-chain-spec = { version = "4.0.0-dev", path = "../../client/chain-spec" }
sc-utils = { version = "4.0.0-dev", path = "../utils" }
sc-client-api = { version = "4.0.0-dev", path = "../api" }
sc-finality-grandpa = { version = "0.10.0-dev", path = "../../client/finality-grandpa" }
sc-keystore = { version = "4.0.0-dev", path = "../keystore" }
sc-network = { version = "0.10.0-dev", path = "../network" }
sc-network-gossip = { version = "0.10.0-dev", path = "../network-gossip" }
sc-utils = { version = "4.0.0-dev", path = "../utils" }

beefy-primitives = { version = "4.0.0-dev", path = "../../primitives/beefy" }

[dev-dependencies]
sp-tracing = { version = "5.0.0", path = "../../primitives/tracing" }
sc-consensus = { version = "0.10.0-dev", path = "../consensus/common" }
sc-network-test = { version = "0.8.0", path = "../network/test" }

sp-finality-grandpa = { version = "4.0.0-dev", path = "../../primitives/finality-grandpa" }
sp-keyring = { version = "6.0.0", path = "../../primitives/keyring" }
sp-tracing = { version = "5.0.0", path = "../../primitives/tracing" }
substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" }

serde = "1.0.136"
strum = { version = "0.23", features = ["derive"] }
tokio = "1.15"
tempfile = "3.1.0"
Loading