You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_getMessageAttestationsStorage()[digest].attestedTransceivers & uint64(1 << index) == 1;
The call at the beginning is getting a bitmap of attested transceivers. So, 7 (b111) would be 3 accepted transceivers.
Next, we are computing the index to compare on the bitmap with transceiver index. So, if we want check the second index then 1 << 1 would work to produce 2 or the middle bit out of the 3 in the example.
Finally, we're comparing this with 1, which is where the bug is at. This is ONLY true if we're checking the first index. For instance, if we're checking the second index (value of 1) then we'd do 7 & (1 << 1) == 1 or 7 & 2 == 1 which is 2 == 1 . So, the comparison will fail on all indexes that aren't the first one (value of 0).
So, the fix is to check if the value is greater than 0. This means that if the singular bit is set, then it's already been attested to
0 commit comments