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
2 changes: 2 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions crates/apollo_propeller/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ description = "Implementation of the Propeller algorithm for the Starknet sequen
testing = []

[dependencies]
libp2p.workspace = true
reed-solomon-simd.workspace = true
sha2.workspace = true
thiserror.workspace = true

[dev-dependencies]
rstest.workspace = true
Expand Down
15 changes: 15 additions & 0 deletions crates/apollo_propeller/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Core types for the Propeller protocol.

use libp2p::identity::PeerId;
use thiserror::Error;

use crate::MerkleHash;

#[derive(Debug, Default, PartialEq, Clone, Copy, Ord, PartialOrd, Eq, Hash)]
Expand All @@ -12,3 +15,15 @@ pub struct ShardIndex(pub u32);

#[derive(Debug, Default, PartialEq, Clone, Copy, Ord, PartialOrd, Eq, Hash)]
pub struct MessageRoot(pub MerkleHash);

/// Errors that can occur when verifying a shard signature.
#[derive(Debug, Clone, PartialEq, Eq, Error)]
pub enum ShardSignatureVerificationError {
#[error(
"We could not find a public key for signer/publisher {0}. This suggests that the public \
key cannot be extracted form the peer ID and needs to be provided explicitly."
)]
NoPublicKeyAvailable(PeerId),
#[error("Received a shard with an invalid signature. Sender should be reported...")]
VerificationFailed,
}
Loading