Skip to content

Commit

Permalink
Sassafras Consensus Pallet (#1577)
Browse files Browse the repository at this point in the history
This PR introduces the pallet for Sassafras consensus.

## Non Goals

The pallet delivers only the bare-bones and doesn't deliver support for
auxiliary functionalities such as equivocation report and support for
epoch change via session pallet.

These functionalities were drafted in the [main
PR](#1336), but IMO is
better to introduce this auxiliary stuff in a follow up PR and after
client code.

## Potential follow ups

#2364

---------

Co-authored-by: Sebastian Kunert <[email protected]>
Co-authored-by: Koute <[email protected]>
Co-authored-by: Michal Kucharczyk <[email protected]>
Co-authored-by: André Silva <[email protected]>
Co-authored-by: Bastian Köcher <[email protected]>
  • Loading branch information
6 people authored Dec 1, 2023
1 parent 7f0beaf commit 095f4bd
Show file tree
Hide file tree
Showing 21 changed files with 3,763 additions and 127 deletions.
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

0 comments on commit 095f4bd

Please sign in to comment.