-
Hi all, These days I got curious of attestations, so was reading prysm codes, and As the comment says in code, However it's checking 'contains' between the 'last element of filtered' and new attestation from given attestation list. let the given attestation list has 3 attestations and aggregation bits are like below. attestation[0].AggregationBits = [1, 1, 1, 1, 0, 0] Here I expect all the 3 elements will be included in the final returned list, filtered. At the first iteration, At the second iteration, Like this, all 3 elements will be included in filtered list even though attestation[0].AggregationBits contains attestation[2].AggregationBits. Is this intended behavior for this function? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thank you for spotting this, this code from early 2020 seems wrong to me as well, here's a test that fails with your parameters func TestFilterContained(t *testing.T) {
sign := bls.NewAggregateSignature().Marshal()
al := attList{
{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00111100, 0b1}, Signature: sign},
{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000011, 0b1}, Signature: sign},
{AggregationBits: bitfield.Bitlist{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0b00000100, 0b1}, Signature: sign},
}
filtered, err := al.filterContained()
require.NoError(t, err)
require.Equal(t, 2, len(filtered))
} |
Beta Was this translation helpful? Give feedback.
Thank you for spotting this, this code from early 2020 seems wrong to me as well, here's a test that fails with your parameters