Closed
Conversation
Member
prestonvanloon
left a comment
There was a problem hiding this comment.
The changes look good to me, but I am curious how other attestation aggregate tests are not impacted by this change
Contributor
|
Thanks for the contribution @mitmotw !! We're very grateful. As Preston mentioned, here is the gosec failure: |
…tual result Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Contributor
|
Hi @mitmotw , I know it's been a very long time since the last activity in this PR. There is a conflict that prevents us from merging it. Can you please resolve it? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Other
What does this PR do? Why is it needed?
filterContained is checking 'contains' between the 'last element of filtered' and new attestation from given attestation list.
So what I'm worrying is like below case.
let the given attestation list has 3 attestations and aggregation bits are like below.
(Just assumed aggregation bits are 6 bits for convenience)
attestation[0].AggregationBits = [1, 1, 1, 1, 0, 0]
attestation[1].AggregationBits = [0, 0, 0, 0, 1, 1]
attestation[2].AggregationBits = [0, 0, 0, 1, 0, 0]
Here I expect all the 3 elements will be included in the final returned list, filtered.
At the first iteration,
attestation[1] will be appended because attestation[0].AggregationBits does not contain attestation[1].AggregationBits.
At the second iteration,
attestation[2] will be appended because attestation[1].AggregationBits (which is the final element of filtered) does not contain attestation[2].AggregationBits.
Like this, all 3 elements will be included in filtered list even though attestation[0].AggregationBits contains attestation[2].AggregationBits.
So this fix stores coveredBits for holding the bits covered so far during the iteration, and
use this for checking 'contains' instead of the 'last element of filtered'.
Which issues(s) does this PR fix?
#12727