diff --git a/helper_functions/src/error.rs b/helper_functions/src/error.rs index dfe4958c..c7abe1e1 100644 --- a/helper_functions/src/error.rs +++ b/helper_functions/src/error.rs @@ -11,8 +11,11 @@ pub(crate) enum Error { AttestingIndicesNotSortedAndUnique, #[error("commitee index is out of bounds")] CommitteeIndexOutOfBounds, - #[error("aggregation bitlist length does not match committee length")] - CommitteeLengthMismatch, + #[error("aggregation bitlist length {aggregation_bitlist_length} does not match committee length {committee_length}")] + CommitteeLengthMismatch { + aggregation_bitlist_length: usize, + committee_length: usize, + }, #[error("epoch is after next one relative to state")] EpochAfterNext, #[error("epoch is before previous one relative to state")] diff --git a/helper_functions/src/phase0.rs b/helper_functions/src/phase0.rs index ab64c9a1..c86a1dd7 100644 --- a/helper_functions/src/phase0.rs +++ b/helper_functions/src/phase0.rs @@ -54,7 +54,10 @@ pub fn get_attesting_indices<'all, P: Preset>( ensure!( committee.len() == aggregation_bits.len(), - Error::CommitteeLengthMismatch, + Error::CommitteeLengthMismatch { + aggregation_bitlist_length: aggregation_bits.len(), + committee_length: committee.len(), + }, ); // `Itertools::zip_eq` is slower than `Iterator::zip` when iterating over packed indices.