Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dist/
evm/out/
evm/cache/
evm/broadcast/
evm/lib/forge-std/
evm/integration-tests/target/
evm/foundry.lock

Expand Down
24 changes: 15 additions & 9 deletions Cargo.lock

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

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ members = [
"modules/utils/subxt",
"modules/utils/serde",
"modules/utils/crypto",
"modules/utils/bls-utils",

# tesseract
"tesseract/messaging/primitives",
Expand Down Expand Up @@ -252,6 +253,7 @@ ibc-proto = { version = "0.52.0", default-features = false, package = "ibc-proto
ismp = { version = "2512.1.0", path = "./modules/ismp/core", default-features = false }
serde-hex-utils = { version = "0.2.0", path = "modules/utils/serde", default-features = false }
crypto-utils = { version = "0.3.0", path = "modules/utils/crypto", default-features = false }
bls-utils = { path = "modules/utils/bls-utils", default-features = false }
grandpa-verifier-primitives = { version = "2512.1.0", path = "./modules/consensus/grandpa/primitives", default-features = false }
grandpa-verifier = { version = "2512.1.0", path = "./modules/consensus/grandpa/verifier", default-features = false }
ismp-grandpa = { version = "2512.1.0", path = "./modules/ismp/clients/grandpa", default-features = false }
Expand All @@ -268,14 +270,14 @@ substrate-state-machine = { version = "2512.1.0", path = "modules/ismp/state-mac

# local crates
ismp-testsuite = { path = "./modules/ismp/testsuite" }
ismp-abi = { path = "./evm/rust", default-features = false }
ismp-abi = { version = "0.1.1", path = "./evm/rust", default-features = false }
simnode-tests = { path = "parachain/simtests" }
integration-tests = { path = "parachain/integration-tests" }
hyperclient = { path = "modules/hyperclient", default-features = false }
subxt-utils = { path = "modules/utils/subxt", default-features = false }

# consensus provers & verifiers
beefy-verifier-primitives = { path = "./modules/consensus/beefy/primitives", default-features = false }
beefy-verifier-primitives = { version = "0.1.1", path = "./modules/consensus/beefy/primitives", default-features = false }
beefy-prover = { path = "./modules/consensus/beefy/prover" }
beefy-verifier = { path = "./modules/consensus/beefy/verifier", default-features = false }
bsc-prover = { path = "./modules/consensus/bsc/prover" }
Expand Down
1 change: 1 addition & 0 deletions evm/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.1.1"
edition = "2021"
authors = ["Polytope Labs <hello@polytope.technology>"]
description = "Generated rust types for the ISMP solidity ABI"
license = "Apache-2.0"
repository = "https://github.com/polytope-labs/hyperbridge"

[dependencies]
Expand Down
3 changes: 2 additions & 1 deletion modules/consensus/beefy/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ version = "0.1.1"
edition = "2021"
authors = ["Polytope Labs <hello@polytope.technology>"]
description = "Primitive types for the BEEFY consensus client"
publish = false
license = "Apache-2.0"
repository = "https://github.com/polytope-labs/hyperbridge"


[package.metadata.docs.rs]
Expand Down
4 changes: 2 additions & 2 deletions modules/consensus/bsc/verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ primitive-types = { workspace = true }
codec = { workspace = true }
ismp = { workspace = true, default-features = false }
geth-primitives = { workspace = true, default-features = false }
crypto-utils = { workspace = true, default-features = false }
bls-utils = { workspace = true, default-features = false }
sync-committee-primitives = { workspace = true, default-features = false }
bls = { workspace = true }
ssz-rs = { git = "https://github.com/polytope-labs/ssz-rs", branch = "main", default-features = false }
Expand All @@ -39,7 +39,7 @@ std = [
"alloy-primitives/std",
"alloy-rlp/std",
"bls/std",
"crypto-utils/std",
"bls-utils/std",
"sync-committee-primitives/std",
"geth-primitives/std",
"ssz-rs/std",
Expand Down
2 changes: 1 addition & 1 deletion modules/consensus/bsc/verifier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use polkadot_sdk::*;

use alloc::vec::Vec;
use crypto_utils::aggregate_public_keys;
use bls_utils::aggregate_public_keys;
use geth_primitives::{CodecHeader, Header};
use ismp::messaging::Keccak256;
use primitives::{BscClientUpdate, Config, VALIDATOR_BIT_SET_SIZE, parse_extra};
Expand Down
4 changes: 2 additions & 2 deletions modules/consensus/pharos/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false
[dependencies]
codec = { workspace = true, features = ["derive"] }
alloy-primitives = { workspace = true }
crypto-utils = { workspace = true, default-features = false }
bls-utils = { workspace = true, default-features = false }
primitive-types = { workspace = true, features = ["serde_no_std", "impl-codec"] }
hex-literal = { workspace = true }
serde = { workspace = true, optional = true, features = ["derive"] }
Expand All @@ -24,7 +24,7 @@ default = ["std"]
std = [
"codec/std",
"alloy-primitives/std",
"crypto-utils/std",
"bls-utils/std",
"primitive-types/std",
"anyhow/std",
"sp-io/std",
Expand Down
2 changes: 1 addition & 1 deletion modules/consensus/pharos/primitives/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use alloy_primitives::Address;

/// Re-export BLS types from crypto-utils
pub use crypto_utils::{
pub use bls_utils::{
BlsPublicKey, BlsSignature, BLS_PUBLIC_KEY_BYTES_LEN, BLS_SIGNATURE_BYTES_LEN,
};

Expand Down
4 changes: 2 additions & 2 deletions modules/consensus/pharos/verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish = false

[dependencies]
pharos-primitives = { workspace = true, default-features = false }
crypto-utils = { workspace = true, default-features = false }
bls-utils = { workspace = true, default-features = false }
geth-primitives = { workspace = true, default-features = false }
ismp = { workspace = true, default-features = false }
bls = { workspace = true }
Expand All @@ -21,7 +21,7 @@ primitive-types = { workspace = true }
default = ["std"]
std = [
"pharos-primitives/std",
"crypto-utils/std",
"bls-utils/std",
"geth-primitives/std",
"ismp/std",
"log/std",
Expand Down
2 changes: 1 addition & 1 deletion modules/consensus/pharos/verifier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ fn verify_bls_signature(
}

let aggregate_pubkey =
crypto_utils::aggregate_public_keys(participants).map_err(Error::BlsError)?;
bls_utils::aggregate_public_keys(participants).map_err(Error::BlsError)?;

// The message signed is the block_proof_hash
let message = block_proof_hash.as_bytes().to_vec();
Expand Down
4 changes: 2 additions & 2 deletions modules/consensus/sync-committee/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ serde = { workspace = true, optional = true, features = ["derive"] }
hex = { workspace = true, default-features = false, features = ["alloc"] }
anyhow = { workspace = true, default-features = false }
serde-hex-utils = { workspace = true, default-features = false }
crypto-utils = { workspace = true, default-features = false }
bls-utils = { workspace = true, default-features = false }

ssz-rs = { git = "https://github.com/polytope-labs/ssz-rs", branch = "main", default-features = false }

Expand All @@ -32,6 +32,6 @@ std = [
"primitive-types/std",
"serde",
"serde-hex-utils/std",
"crypto-utils/std",
"bls-utils/std",
]
nofulu = []
2 changes: 1 addition & 1 deletion modules/consensus/sync-committee/primitives/src/ssz/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ fn write_bytes_to_lower_hex<T: AsRef<[u8]>>(f: &mut fmt::Formatter<'_>, data: T)
}

pub use byte_list::ByteList;
pub use crypto_utils::ssz::ByteVector;
pub use bls_utils::ByteVector;
28 changes: 28 additions & 0 deletions modules/utils/bls-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "bls-utils"
version = "0.1.0"
edition = "2021"
authors = ["Polytope Labs <hello@polytope.technology>"]
license = "Apache-2.0"
repository = "https://github.com/polytope-labs/hyperbridge"
description = "BLS12-381 and SSZ ByteVector utilities for consensus clients"
publish = false

[dependencies]
codec = { workspace = true }
serde = { workspace = true, optional = true }
ssz-rs = { git = "https://github.com/polytope-labs/ssz-rs", branch = "main", default-features = false }
serde-hex-utils = { workspace = true, default-features = false }
bls = { workspace = true, default-features = false }

[features]
default = ["std"]
std = [
"codec/std",
"serde",
"serde/std",
"ssz-rs/default",
"ssz-rs/serde",
"serde-hex-utils/std",
"bls/std",
]
File renamed without changes.
26 changes: 26 additions & 0 deletions modules/utils/bls-utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (C) Polytope Labs Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
extern crate alloc;

pub mod bls;
pub mod ssz;

pub use bls::{
aggregate_public_keys, pubkey_to_projective, BlsPublicKey, BlsSignature,
BLS_PUBLIC_KEY_BYTES_LEN, BLS_SIGNATURE_BYTES_LEN,
};
pub use ssz::ByteVector;
12 changes: 0 additions & 12 deletions modules/utils/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ anyhow = { workspace = true }
scale-info = { workspace = true }
sp-core = { workspace = true, default-features = false }
sp-io = { workspace = true, default-features = false }
hex = { version = "0.4", default-features = false, features = ["alloc"] }
serde = { workspace = true, optional = true }
ssz-rs = { git = "https://github.com/polytope-labs/ssz-rs", branch = "main", default-features = false }
serde-hex-utils = { workspace = true, default-features = false }
bls = { workspace = true, default-features = false }

[features]
default = ["std"]
Expand All @@ -30,11 +25,4 @@ std = [
"scale-info/std",
"sp-core/std",
"sp-io/std",
"hex/std",
"serde",
"serde/std",
"ssz-rs/default",
"ssz-rs/serde",
"serde-hex-utils/std",
"bls/std",
]
8 changes: 0 additions & 8 deletions modules/utils/crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,4 @@
#![cfg_attr(not(feature = "std"), no_std)]
extern crate alloc;

pub mod bls;
pub mod ssz;
pub mod verification;

pub use bls::{
aggregate_public_keys, pubkey_to_projective, BlsPublicKey, BlsSignature,
BLS_PUBLIC_KEY_BYTES_LEN, BLS_SIGNATURE_BYTES_LEN,
};
pub use ssz::ByteVector;
2 changes: 1 addition & 1 deletion modules/utils/serde/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ std = [
]

[dev-dependencies]
ismp = { workspace = true, default-features = true }
ismp = { path = "../../ismp/core", default-features = true }
primitive-types = { workspace = true, features = ["codec", "scale-info", "serde_no_std"] }
serde_json = { version = "1.0.99", default-features = false, features = ["alloc"] }
1 change: 1 addition & 0 deletions sdk/packages/core/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ Thumbs.db
# Foundry artifacts
out/
cache/
lib/
Loading