Skip to content

Commit

Permalink
Produce and aggregate BLS Signatures in BEEFY
Browse files Browse the repository at this point in the history
  • Loading branch information
drskalman committed Jun 2, 2024
1 parent c8af3df commit 53d90d3
Show file tree
Hide file tree
Showing 12 changed files with 424 additions and 150 deletions.
66 changes: 64 additions & 2 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 substrate/client/consensus/beefy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ sp-crypto-hashing = { path = "../../../primitives/crypto/hashing" }
sp-keystore = { path = "../../../primitives/keystore" }
sp-runtime = { path = "../../../primitives/runtime" }
tokio = "1.37"
jsonrpc = "*"
reqwest = {version = "*" , features = ["blocking", "json"]}
serde = { workspace = true, default-features = true }
serde_json = "*"

[dev-dependencies]
serde = { workspace = true, default-features = true }
Expand All @@ -52,6 +56,7 @@ sp-keyring = { path = "../../../primitives/keyring" }
sp-mmr-primitives = { path = "../../../primitives/merkle-mountain-range" }
sp-tracing = { path = "../../../primitives/tracing" }
substrate-test-runtime-client = { path = "../../../test-utils/runtime/client" }
env_logger = "*"

[features]
# This feature adds BLS crypto primitives. It should not be used in production since
Expand Down
6 changes: 3 additions & 3 deletions substrate/client/consensus/beefy/src/aux_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub(crate) mod tests {
use super::*;
use crate::tests::BeefyTestNet;
use sc_network_test::TestNetFactory;
use sp_consensus_beefy::ecdsa_crypto;
use sp_consensus_beefy::ecdsa_bls_crypto;

// also used in tests.rs
pub fn verify_persisted_version<B: BlockT, BE: Backend<B>>(backend: &BE) -> bool {
Expand All @@ -100,15 +100,15 @@ pub(crate) mod tests {
let backend = net.peer(0).client().as_backend();

// version not available in db -> None
assert_eq!(load_persistent::<_, _, ecdsa_crypto::AuthorityId>(&*backend).unwrap(), None);
assert_eq!(load_persistent::<_, _, ecdsa_bls_crypto::AuthorityId>(&*backend).unwrap(), None);

// populate version in db
write_current_version(&*backend).unwrap();
// verify correct version is retrieved
assert_eq!(load_decode(&*backend, VERSION_KEY).unwrap(), Some(CURRENT_VERSION));

// version is available in db but state isn't -> None
assert_eq!(load_persistent::<_, _, ecdsa_crypto::AuthorityId>(&*backend).unwrap(), None);
assert_eq!(load_persistent::<_, _, ecdsa_bls_crypto::AuthorityId>(&*backend).unwrap(), None);

// full `PersistedState` load is tested in `tests.rs`.
}
Expand Down
Loading

0 comments on commit 53d90d3

Please sign in to comment.