-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from spectrum-finance/batched-vrf-proofs-dev-1295
Batched VRF proofs + Validation framework
- Loading branch information
Showing
44 changed files
with
1,018 additions
and
563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Modifier Application | ||
|
||
|
||
**BlockHeader:** | ||
```mermaid | ||
flowchart TD | ||
D(Diffusion) | ||
NV(NodeView) | ||
H([History]) | ||
S([State]) | ||
D-->|"Apply(BlockHeader)"|NV | ||
H-->|Log|NV | ||
NV-->|"Apply(Valid(BlockHeader))"|H | ||
S-->|State|NV | ||
``` | ||
|
||
**BlockBody:** | ||
```mermaid | ||
flowchart TD | ||
D(Diffusion) | ||
NV(NodeView) | ||
H([History]) | ||
S([State]) | ||
D-->|"Apply(BlockBody)"|NV | ||
H-->|Log|NV | ||
NV-->|"Apply(Valid(BlockBody))"|H | ||
S-->|State|NV | ||
NV-->|"[Apply(Valid(Tx))]"|S | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
name = "spectrum-consensus" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.71.0" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
futures = "0.3.21" | ||
libp2p = { version = "0.52.0", features = ["websocket", "noise", "yamux", "ping", "tcp", "dns", "async-std", "secp256k1"] } | ||
async-std = { version = "1.10.0", features = ["attributes"] } | ||
spectrum-crypto = { version = "0.1.0", path = "../spectrum-crypto" } | ||
spectrum-network = { version = "0.1.0", path = "../spectrum-network" } | ||
spectrum-ledger = { version = "0.1.0", path = "../spectrum-ledger" } | ||
spectrum-view = { version = "0.1.0", path = "../spectrum-view" } | ||
rand = "0.8.5" | ||
log = "0.4.17" | ||
log4rs = "1.2.0" | ||
k256 = { version = "0.13.*", features = ["serde", "arithmetic"] } | ||
serde = { version = "1.0.147", features = ["derive"] } | ||
base16 = "0.2.1" | ||
serde_yaml = "0.9.21" | ||
tokio = { version = "1.28.*", features = ["rt", "rt-multi-thread"] } | ||
thiserror = "1.0.34" | ||
async-trait = "0.1.68" | ||
nonempty = "0.8.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mod block_header; | ||
mod validation; | ||
mod rules; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use spectrum_ledger::consensus::AnyRuleId; | ||
|
||
#[derive(Debug, Copy, Clone, Eq, PartialEq)] | ||
pub struct RuleSpec { | ||
/// Essential rules cannot be disabled. | ||
pub essential: bool, | ||
/// Is rule active | ||
pub active: bool, | ||
pub description: *const str, | ||
} | ||
|
||
/// Consensus rules table. | ||
pub trait ConsensusRuleSet { | ||
fn get_rule(&self, rule_id: AnyRuleId) -> RuleSpec; | ||
} |
Oops, something went wrong.