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

Sassafras consensus - Prototype #1 #11678

Merged
merged 28 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
82500c8
First draft of Sassafras components structure
davxy May 24, 2022
d7bef64
Implementation of Sassafras test node
davxy May 24, 2022
59e5b53
Start filling the placeholders
davxy May 24, 2022
e5a8239
Implemented epoch change using internal trigger
davxy May 31, 2022
7a456e2
Epoch randomness computation using blocks VRF accumulator
davxy Jun 1, 2022
11e009a
Verification on block import
davxy Jun 13, 2022
717a16f
Tickets generation procedure
davxy Jun 14, 2022
d86aef1
Publish tickets on-chain using unsigned extrinsic
davxy Jun 16, 2022
33c163d
Introduced first implementation of secondary slot claiming
davxy Jun 22, 2022
b82cccf
Use ticket to claim slot without proof check
davxy Jun 27, 2022
5e9c1f5
Enact epoch tickets on last epoch block
davxy Jun 28, 2022
9865938
Small refactory
davxy Jun 28, 2022
c3660f5
Unify primary and secondary pre-digest
davxy Jun 28, 2022
b50d9f9
Bump Sassafras components version to 0.1.0
davxy Jun 29, 2022
d78f6a2
Use BTreeSet instead of Vec to store next epoch tickets
davxy Jul 1, 2022
2508a5e
Trick to fetch the fist ticket on epoch change
davxy Jul 1, 2022
1e0e092
Fix epoch ticket get api
davxy Jul 2, 2022
8f4b18c
Blocks verification on import
davxy Jul 4, 2022
622b183
Merge branch 'master' into davxy-sassafras-consensus-prototype1
davxy Jul 19, 2022
cfd4c6a
Fix after master merge
davxy Jul 19, 2022
442d901
Restore good old Cargo.lock
davxy Jul 19, 2022
be27264
Fix unused fields warnings
davxy Jul 19, 2022
2a25d82
Try to make the compiler happy
davxy Jul 19, 2022
0e44362
Removed num-bigint dependency
davxy Jul 20, 2022
cd1ef1c
More robust tickets handling
davxy Jul 20, 2022
3d92632
TODOs priority classification
davxy Jul 20, 2022
3d8d2a8
Resolved TODOs with P1
davxy Jul 20, 2022
ccdfd37
Fix github link
davxy Jul 20, 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
153 changes: 153 additions & 0 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ members = [
"bin/node/rpc",
"bin/node/runtime",
"bin/node/testing",
"bin/node-sassafras/node",
"bin/node-sassafras/runtime",
"bin/utils/chain-spec-builder",
"bin/utils/subkey",
"client/api",
Expand All @@ -30,6 +32,7 @@ members = [
"client/consensus/epochs",
"client/consensus/manual-seal",
"client/consensus/pow",
"client/consensus/sassafras",
"client/consensus/slots",
"client/consensus/uncles",
"client/db",
Expand Down Expand Up @@ -121,6 +124,7 @@ members = [
"frame/recovery",
"frame/referenda",
"frame/remark",
"frame/sassafras",
"frame/scheduler",
"frame/scored-pool",
"frame/session",
Expand Down Expand Up @@ -168,6 +172,7 @@ members = [
"primitives/consensus/babe",
"primitives/consensus/common",
"primitives/consensus/pow",
"primitives/consensus/sassafras",
"primitives/consensus/vrf",
"primitives/core",
"primitives/core/hashing",
Expand Down
16 changes: 16 additions & 0 deletions bin/node-sassafras/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
indent_style=space
indent_size=2
tab_width=2
end_of_line=lf
charset=utf-8
trim_trailing_whitespace=true
insert_final_newline = true

[*.{rs,toml}]
indent_style=tab
indent_size=tab
tab_width=4
max_line_length=100
72 changes: 72 additions & 0 deletions bin/node-sassafras/node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[package]
name = "node-sassafras"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Node testbed for Sassafras consensus."
homepage = "https://substrate.io/"
edition = "2021"
license = "Unlicense"
publish = false
build = "build.rs"

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

[[bin]]
name = "node-sassafras"

[dependencies]
clap = { version = "3.1.18", features = ["derive"] }

sc-cli = { version = "0.10.0-dev", path = "../../../client/cli", features = ["wasmtime"] }
sp-core = { version = "6.0.0", path = "../../../primitives/core" }
sc-executor = { version = "0.10.0-dev", path = "../../../client/executor", features = ["wasmtime"] }
sc-service = { version = "0.10.0-dev", path = "../../../client/service", features = ["wasmtime"] }
sc-telemetry = { version = "4.0.0-dev", path = "../../../client/telemetry" }
sc-keystore = { version = "4.0.0-dev", path = "../../../client/keystore" }
sc-transaction-pool = { version = "4.0.0-dev", path = "../../../client/transaction-pool" }
sc-transaction-pool-api = { version = "4.0.0-dev", path = "../../../client/transaction-pool/api" }
sc-consensus-sassafras = { version = "0.1.0", path = "../../../client/consensus/sassafras" }
sp-consensus-sassafras = { version = "0.1.0", path = "../../../primitives/consensus/sassafras" }
sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/common" }
sc-consensus = { version = "0.10.0-dev", path = "../../../client/consensus/common" }
sc-finality-grandpa = { version = "0.10.0-dev", path = "../../../client/finality-grandpa" }
sp-finality-grandpa = { version = "4.0.0-dev", path = "../../../primitives/finality-grandpa" }
sc-client-api = { version = "4.0.0-dev", path = "../../../client/api" }
sp-runtime = { version = "6.0.0", path = "../../../primitives/runtime" }
sp-timestamp = { version = "4.0.0-dev", path = "../../../primitives/timestamp" }
sp-inherents = { version = "4.0.0-dev", path = "../../../primitives/inherents" }
sp-keyring = { version = "6.0.0", path = "../../../primitives/keyring" }
frame-system = { version = "4.0.0-dev", path = "../../../frame/system" }
pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, path = "../../../frame/transaction-payment" }

# These dependencies are used for the node template's RPCs
jsonrpsee = { version = "0.14.0", features = ["server"] }
sc-rpc = { version = "4.0.0-dev", path = "../../../client/rpc" }
sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" }
sc-rpc-api = { version = "0.10.0-dev", path = "../../../client/rpc-api" }
sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" }
sp-block-builder = { version = "4.0.0-dev", path = "../../../primitives/block-builder" }
sc-basic-authorship = { version = "0.10.0-dev", path = "../../../client/basic-authorship" }
substrate-frame-rpc-system = { version = "4.0.0-dev", path = "../../../utils/frame/rpc/system" }
pallet-transaction-payment-rpc = { version = "4.0.0-dev", path = "../../../frame/transaction-payment/rpc/" }

# These dependencies are used for runtime benchmarking
frame-benchmarking = { version = "4.0.0-dev", path = "../../../frame/benchmarking" }
frame-benchmarking-cli = { version = "4.0.0-dev", path = "../../../utils/frame/benchmarking-cli" }

# Local Dependencies
node-sassafras-runtime = { version = "0.1.0", path = "../runtime" }

# CLI-specific dependencies
try-runtime-cli = { version = "0.10.0-dev", optional = true, path = "../../../utils/frame/try-runtime/cli" }

[build-dependencies]
substrate-build-script-utils = { version = "3.0.0", path = "../../../utils/build-script-utils" }

[features]
default = []
runtime-benchmarks = ["node-sassafras-runtime/runtime-benchmarks"]
# Enable features that allow the runtime to be tried and debugged. Name might be subject to change
# in the near future.
try-runtime = ["node-sassafras-runtime/try-runtime", "try-runtime-cli"]
7 changes: 7 additions & 0 deletions bin/node-sassafras/node/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed};

fn main() {
generate_cargo_keys();

rerun_if_git_head_changed();
}
Loading