-
Notifications
You must be signed in to change notification settings - Fork 997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_attesting_indices set instead of sorted #1225
Conversation
@@ -566,7 +569,8 @@ def process_bit_challenge(state: BeaconState, | |||
chunk_count = get_custody_chunk_count(attestation.data.crosslink) | |||
assert verify_bitfield(challenge.chunk_bits, chunk_count) | |||
# Verify the first bit of the hash of the chunk bits does not equal the custody bit | |||
custody_bit = get_bitfield_bit(attestation.custody_bitfield, attesters.index(challenge.responder_index)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bugfix: The previous accessor here for the responder bit just from the list of attestors would likely correspond to the incorrect bit in the bitfield. Instead it should be the index of the responder within the entire committee.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified the Sequence
-> Set
change part of the PR
Thanks for putting this together so quickly. |
Co-Authored-By: Preston Van Loon <[email protected]>
It came to my attention that
get_attesting_indices
was still unnecessarily sorting instead of returning aset
. The only case that needs sorting is when it is used inconvert_to_indexed
rather than in all of the attester accessors used in rewards processing during epoch processing.This actually let me to uncover a small bug in phase 1 that has been resolved.
Thanks @prestonvanloon for bringing this to my attention. I hope this relieves that hotspot you found in your epoch processing.