Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sassafras Consensus Pallet #1577

Merged
merged 132 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
3b1f85f
Sassafras pallet draft
davxy Aug 31, 2023
d8e5bb6
Remove copyright year
davxy Aug 31, 2023
a216de6
Address some of the open points
davxy Sep 12, 2023
31334fd
Remove code for epoch change management via external session-pallet
davxy Sep 12, 2023
ddc9d7d
Begin Sassafras benchmarking
davxy Sep 12, 2023
201c853
Test using pre-built tickets
davxy Sep 12, 2023
d30f701
Max tickets is bounded to slots per epoch
davxy Sep 13, 2023
d5bdb91
Benchmarking experiments
davxy Sep 13, 2023
c5a1cdb
Benchmarking support in the node template
davxy Sep 13, 2023
893c25e
Merge branch 'master' into sassafras-pallet
davxy Sep 13, 2023
7b37a1b
Fix after master merge
davxy Sep 13, 2023
418bf4d
Remove not required timestamp pallet
davxy Sep 13, 2023
c459601
Temporary patch ring-proof deps (broken no-std compat)
davxy Sep 14, 2023
b6b4630
Benchmarks and first weights results
davxy Sep 14, 2023
76f08ff
Some more benches
davxy Sep 14, 2023
bf36518
Clean open TODOs
davxy Sep 14, 2023
c667ddf
cleanup
davxy Sep 14, 2023
dc25a95
Cleanup
davxy Sep 14, 2023
4e74f89
Add license to weights file
davxy Sep 14, 2023
adf34b0
Prepare code for verifier persistence
davxy Sep 15, 2023
cec9eb5
No need to store the whole SlotClaim
davxy Sep 15, 2023
b84a342
Use next epoch authorities for ring verifier
davxy Sep 15, 2023
27ed420
Merge branch 'master' into davxy-sassafras-pallet
davxy Sep 19, 2023
da4e1ae
Patch only ring-proof and fflonk
davxy Sep 19, 2023
ccb7bea
Remove versions from pallets referenced by path
davxy Sep 19, 2023
c0ca577
Use experimental bandersnatch_vrfs with host functions
davxy Sep 27, 2023
0196d75
Merge branch 'master' into davxy-sassafras-pallet
davxy Sep 27, 2023
303bfbb
Introduce ark host functions
davxy Sep 27, 2023
b96b6fa
Workaround while waiting for serializable Verifier
davxy Oct 5, 2023
48a2dc5
Use patched bandersnatch_vrfs
davxy Oct 7, 2023
dafaab5
Make clippy happy
davxy Oct 7, 2023
5fbee17
Merge branch 'master' into davxy-sassafras-pallet
davxy Oct 7, 2023
0d0c181
Zepter fix
davxy Oct 7, 2023
8c95324
More Zepter hints
davxy Oct 7, 2023
ba35931
Zepter 😁
davxy Oct 7, 2023
db33af0
Merge branch 'master' into davxy-sassafras-pallet
davxy Oct 16, 2023
89a398a
Fix after master merge
davxy Oct 16, 2023
06505bb
Make clippy happy
davxy Oct 16, 2023
6116b31
remove unused clone
davxy Oct 17, 2023
1a13de3
Boost ring context construction perfs by:
davxy Oct 19, 2023
eea2516
Fix benchmark results
davxy Oct 19, 2023
200ba5f
Fix clippy
davxy Oct 19, 2023
84e7321
Update readme
davxy Oct 19, 2023
b64d530
Merge branch 'master' into davxy-sassafras-pallet
davxy Oct 19, 2023
3649d47
Remove hardcoded value
davxy Oct 19, 2023
3ddc578
Docs cleanup
davxy Oct 20, 2023
ed54065
Outstanding unsorted segments have all the same size
davxy Oct 20, 2023
bb60ae9
Update weights
davxy Oct 20, 2023
f2aceea
Cleanup
davxy Oct 23, 2023
3647da9
Restore upstream fflonk crate
davxy Oct 23, 2023
83d3492
Add license to weights file
davxy Oct 23, 2023
288e443
Merge branch 'master' into davxy-sassafras-pallet
davxy Oct 31, 2023
c02702b
Bump bandersnatch_vrfs rev
davxy Oct 31, 2023
df1139c
Use new host functions
davxy Oct 31, 2023
90e7c8a
Merge branch 'master' into davxy-sassafras-pallet
davxy Nov 1, 2023
3a2749c
Patch bandersnatch
davxy Nov 1, 2023
6c5dd08
Update fflonk
davxy Nov 1, 2023
ec8eb0a
Benchmark notes update
davxy Nov 1, 2023
de21bf8
Merge branch 'master' into davxy-sassafras-pallet
davxy Nov 1, 2023
209037e
Merge branch 'master' into davxy-sassafras-pallet
davxy Nov 2, 2023
b45ce50
Integration of pallet-sassafras in kitchensink node for the sake of b…
davxy Nov 3, 2023
6a07572
Independence from periodic time
davxy Nov 3, 2023
ceab697
Cleanup some TODOs
davxy Nov 3, 2023
7f7255c
Move the benchmarking to kitchensink
davxy Nov 3, 2023
a8b4f6b
Restore master template
davxy Nov 3, 2023
59feb26
Remove some allocations
davxy Nov 3, 2023
518dee7
Tests/Benches refactory and bigger ring size
davxy Nov 3, 2023
ea370dd
Update weights
davxy Nov 3, 2023
72288ed
Fix some dependencies required by some auxiliary stuff
davxy Nov 4, 2023
99d9cae
Fix new serde gated stuff in bandersnatch
davxy Nov 4, 2023
2d4d32f
Revert to node-template
davxy Nov 4, 2023
ba8000f
Expand ring vrf domain size to 2048
davxy Nov 4, 2023
a057593
Update benchmark-results.md
davxy Nov 4, 2023
f7774b8
Update benchmark-results.md
davxy Nov 4, 2023
ea5c966
Update benchmark-results.md
davxy Nov 4, 2023
a7bd12d
Small fix and better docs
davxy Nov 6, 2023
de873c4
Merge branch 'master' into davxy-sassafras-pallet
davxy Nov 6, 2023
6ea2b14
Merge branch 'master' into davxy-sassafras-pallet
davxy Nov 8, 2023
bb16327
Use #2190 fix
davxy Nov 8, 2023
b1c468f
Trivial tweaks
davxy Nov 11, 2023
02cdcba
Structs fields order inline with Sassafras RFC
davxy Nov 11, 2023
5c345b3
Apply suggestions from code review
davxy Nov 13, 2023
a66f9d8
Use separate bounded vector for sorted candidates
davxy Nov 13, 2023
ced5b81
Merge branch 'davxy-sassafras-pallet' of github.com:paritytech/polkad…
davxy Nov 13, 2023
edb0e39
on_initialize weight
davxy Nov 13, 2023
d9607b6
Proper on_initialize weight
davxy Nov 13, 2023
2c63652
Fix test
davxy Nov 13, 2023
4ddc48d
Fix markdown
davxy Nov 13, 2023
294265b
Apply suggestions from code review
davxy Nov 14, 2023
67c565b
Apply suggestions
davxy Nov 14, 2023
ffefc22
Duplicate tickets must be discarded
davxy Nov 14, 2023
649f245
Apply code suggestions
davxy Nov 14, 2023
a304802
Apply suggestions from code review
davxy Nov 14, 2023
0b21a57
Add some corner cases for outside in sortition
davxy Nov 14, 2023
64406b6
Apply suggestions from code review
davxy Nov 14, 2023
c1cc3ef
Rename 'todo' variable
davxy Nov 14, 2023
e4ac081
Apply suggestions from code review
davxy Nov 14, 2023
42371d6
Add reference to the w3f layman overview
davxy Nov 14, 2023
2e88209
Apply suggestions from code review
davxy Nov 14, 2023
f45ef2f
Skip 3 epochs in the test
davxy Nov 14, 2023
0471c6b
Docs adjustments
davxy Nov 15, 2023
ac074bb
Utility accessors
davxy Nov 15, 2023
1af7fef
Remove cruft
davxy Nov 15, 2023
5a19e0c
Check for submission epoch related constraint in extrinsic
davxy Nov 15, 2023
35e742d
Ticket sorting graph
davxy Nov 15, 2023
b52f339
Amend pic
davxy Nov 15, 2023
115934c
Trigger worst case when computing 'enact_epoch_change' weight
davxy Nov 16, 2023
1b659c8
Improve ticket_id_threshold docs
davxy Nov 16, 2023
ea94758
Optimize segments sorting
davxy Nov 16, 2023
4d42558
Recompute weights
davxy Nov 16, 2023
2c70a7b
Zepter fix
davxy Nov 16, 2023
41a34ff
Epoch length type set to u32
davxy Nov 16, 2023
a889c2c
Fix a codepath where metadata was not written back in storage
davxy Nov 16, 2023
431d18c
Update weights
davxy Nov 16, 2023
1841896
Make clippy happy
davxy Nov 16, 2023
b0bfcff
Fix doc
davxy Nov 20, 2023
4ca8eb0
Post genesis pallet initialization
davxy Nov 23, 2023
30d9c7c
Fix tests after new randomness initialization policy
davxy Nov 23, 2023
6188189
Include both genesis hash and base slot number in post-genesis random…
davxy Nov 23, 2023
6ebfaa6
Apply suggestions from code review
davxy Nov 29, 2023
d68d992
Include missing traits
davxy Nov 30, 2023
c1750ed
Use derive_impl to construct frame_system Config
davxy Nov 30, 2023
2af09df
Merge branch 'master' into davxy-sassafras-pallet
davxy Nov 30, 2023
4420b00
Apply suggestions from code review
davxy Nov 30, 2023
1ccba97
Temporary patch ring-proof
davxy Nov 30, 2023
67712a7
Remove leftover
davxy Nov 30, 2023
255f90e
Restore working tests
davxy Nov 30, 2023
8aca3b6
Apply suggestions from code review
davxy Nov 30, 2023
41139dc
Merge branch 'master' into davxy-sassafras-pallet
davxy Nov 30, 2023
4fd7f7a
Revert node-template
davxy Dec 1, 2023
3b29570
Merge branch 'master' into davxy-sassafras-pallet
davxy Dec 1, 2023
f110a14
Fix lock
davxy Dec 1, 2023
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
50 changes: 39 additions & 11 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 @@ -346,6 +346,7 @@ members = [
"substrate/frame/root-testing",
"substrate/frame/safe-mode",
"substrate/frame/salary",
"substrate/frame/sassafras",
"substrate/frame/scheduler",
"substrate/frame/scored-pool",
"substrate/frame/session",
Expand Down
59 changes: 59 additions & 0 deletions substrate/frame/sassafras/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[package]
name = "pallet-sassafras"
version = "0.3.5-dev"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "Consensus extension module for Sassafras consensus."
readme = "README.md"
publish = false

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
scale-codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] }
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
frame-benchmarking = { path = "../benchmarking", default-features = false, optional = true }
frame-support = { path = "../support", default-features = false }
frame-system = { path = "../system", default-features = false }
log = { version = "0.4.17", default-features = false }
sp-consensus-sassafras = { path = "../../primitives/consensus/sassafras", default-features = false, features = ["serde"] }
sp-io = { path = "../../primitives/io", default-features = false }
sp-runtime = { path = "../../primitives/runtime", default-features = false }
sp-std = { path = "../../primitives/std", default-features = false }

[dev-dependencies]
array-bytes = "6.1"
sp-core = { path = "../../primitives/core" }

[features]
default = [ "std" ]
std = [
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"log/std",
"scale-codec/std",
"scale-info/std",
"sp-consensus-sassafras/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
# Construct dummy ring context on genesis.
# Mostly used for testing and development.
construct-dummy-ring-context = []
8 changes: 8 additions & 0 deletions substrate/frame/sassafras/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Runtime module for SASSAFRAS consensus.

- Tracking issue: https://github.com/paritytech/polkadot-sdk/issues/41
- Protocol RFC proposal: https://github.com/polkadot-fellows/RFCs/pull/26

# ⚠️ WARNING ⚠️

The crate interfaces and structures are experimental and may be subject to changes.
Loading