Skip to content
Open
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
237 changes: 151 additions & 86 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ testcontainers = "0.26"
test-case = "3.3"
tree_hash = "0.12"
tree_hash_derive = "0.12"
tar = "0.4"
flate2 = "1.1"
wiremock = "0.6"

# Crates in the workspace
Expand Down
5 changes: 4 additions & 1 deletion crates/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ serde_json.workspace = true
hex.workspace = true
k256.workspace = true
bon.workspace = true
flate2.workspace = true
tar.workspace = true
tempfile.workspace = true
pluto-cluster.workspace = true
pluto-k1util.workspace = true
pluto-crypto.workspace = true
Expand All @@ -36,8 +39,8 @@ pluto-crypto.workspace = true
pluto-build-proto.workspace = true

[dev-dependencies]
tempfile.workspace = true
wiremock.workspace = true
test-case.workspace = true

[lints]
workspace = true
3 changes: 3 additions & 0 deletions crates/app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ pub mod eth2wrap;

/// Private key locking service.
pub mod privkeylock;

/// Utility helpers for archiving, extracting, and comparing files/directories.
pub mod utils;
8 changes: 8 additions & 0 deletions crates/app/src/obolapi/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ pub enum Error {
#[error("signature string has invalid size: {0}")]
InvalidSignatureSize(usize),

/// Failed to convert share index to u8.
#[error("failed to convert share index to u8: {0}")]
FailedToConvertShareIndexToU8(#[from] std::num::TryFromIntError),

/// Math overflow error.
#[error("math overflow error")]
MathOverflow,

/// Epoch parsing error.
#[error("epoch parsing error: {0}")]
EpochParse(#[from] std::num::ParseIntError),
Expand Down
7 changes: 5 additions & 2 deletions crates/app/src/obolapi/exit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,12 @@ impl Client {
let mut sig = [0u8; 96];
sig.copy_from_slice(&sig_bytes);

// `BlstImpl::threshold_aggregate` shifts the index to 1-based internally
// Convert 0-indexed array position to 1-indexed share ID (API stores signatures
// at array position share_id-1, e.g., share 1 at position 0)
let share_idx = u8::try_from(sig_idx)
.map_err(|_| Error::InvalidSignatureSize(sig_idx.saturating_add(1)))?;
.map_err(Error::FailedToConvertShareIndexToU8)?
.checked_add(1)
.ok_or(Error::MathOverflow)?;
raw_signatures.insert(share_idx, sig);
}

Expand Down
Loading
Loading