I need to list the validators who have attested to a specific slot, to do so I'm interacting with an API exposed by a beacon node.
The first step I do is to call /eth/v1/beacon/states/15687030/committees
{
"index": "0",
"slot": "15687024",
"validators": [] // 220 validators indices.
},
Then I call to /eth/v1/beacon/blocks/15687031/attestations
{
"aggregation_bits": "0xfff7fffffeffffffffffffffffdffffbffffffffff7fffffa7ffff1f",
"data": {
"slot": "15687030",
"index": "0",
"beacon_block_root":
"0x79bdffb873504d33390246527fb29e4995b588534ad1250384c28606877618a2",
"source": {
"epoch": "980438",
"root": "0xea3cf5b69a4d04d20384de127f489c9509be9d51021684bff6c655115dedb5bc"
},
"target": {
"epoch": "980439",
"root": "0x144f47a9838e0e82048c9070c2205eda912acaa7432e2ee3c4a2aa1ce59c9659"
}
},
"signature": "0x8bd0bfe48b06c63381ba36552d88fc671cfb8bc44894f44d1b45e37f476e705465a40afd1ceff21328df1301e9a6900619d06ed63e069fa398845ea7548267009c442f4a3569a53833bd07e79031cd1d45db37e9594e3b408ee3b113691018f2"
},
The resulting binary converting aggregation_bits is: 11111111111101111111111111111111111111101111111111111111111111111111111111111111111111111111111111111111110111111111111111111011111111111111111111111111111111111111111101111111111111111111111110100111111111111111111100011111
these 224 bits don't match the 220 validators from the committee.
Comparing the same slot and index from gnosischa.in, I can see the signature is the same, and the bits are 220:
1111111111101111111111111111111101111111111111111111111111111111111111111111111111111111111111111111111111111011111111111101111111111111111111111111111111111111111111111111111011111111111111111110010111111111111111111111
matching with the same number of validators in the committee.
I'm not able to understand how to process the bits. So my questions are:
- What should I do to shrink the 224 to get the 220 from the committee? Are they formatted in some way?
- Why the bits I get from converting the hexadecimal differ in different places from the ones I get from gnosischa.in?
I've found a similar question here but it didn't help me much.