fix: make 1-based indexing in tbls implementation#279
Conversation
emlautarom1
left a comment
There was a problem hiding this comment.
LGTM. The tests that rely on test-cluster where the issue was found work as intended, so we're good to go.
|
@claude can you review this PR? |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
@claude review this PR |
|
Claude finished @varex83's task in 2m 47s —— View job PR Review
SummaryThis PR fixes a parity gap with the Go ( Findings[Low] The variant The variant is still declared but never constructed anywhere in the workspace. Because it's [Low] This is a pre-existing pattern (not introduced by this PR) but worth noting: // crates/crypto/src/blst_impl.rs:115-122
let share_points: Vec<Index> = shares.keys().copied().collect();
let share_secrets: Vec<BlstSecretKey> = shares.values().map(…).collect()?;The Lagrange interpolation at let (share_points, share_secrets): (Vec<Index>, Vec<BlstSecretKey>) = shares
.iter()
.map(|(&idx, bytes)| {
BlstSecretKey::from_bytes(bytes)
.map(|sk| (idx, sk))
.map_err(|e| Error::InvalidSecretKey(e.into()))
})
.collect::<Result<Vec<_>, _>>()?
.into_iter()
.unzip();The same applies to Parity Matrix
Tests
OverallThe core fix is correct and the approach is clean. The review feedback from @iamquang95 has been addressed with proper typed error variants ( |
|
Guess we need to remove |
Fixes the implementation difference between Rust and Go pointed by @emlautarom1 in the PR