1

I was trying to make a program in which I store the attestations of the validators. But When I started running the program I ran into an error, which was that the number of validators in the committee was not equal to the number of bits in the aggregation_bits.

My process:

  1. I am using a Quicknode's api endpoint to get the data
  2. I find the validator_index array for all the committees in an epoch
  3. I find the aggregation_bits of those committee's and convert that to a binary

for eg: epoch = 214606, slot = 6867392, committee_index = 63 has 323 validators in the validator_array but 328 bits in the aggregation_bits

enter image description here

enter image description here

enter image description here

The validator_array: ["559913","413343","8525","607457","226317","164392","711999","555946","517328","542094","181725","283107","199206","634804","125039","446716","636700","176082","709371","100118","310620","659153","144355","472118","407158","480502","586063","513281","493842","401062","622236","7186","637055","349917","322378","474559","684714","185873","28709","161249","243333","341441","429303","611261","696582","39948","50709","149254","365963","602120","500668","409815","438232","701073","165006","8432","660065","448139","97308","582921","471664","93113","143219","205140","162969","733709","472506","14894","658356","462726","284222","649330","444864","372668","213115","40810","715049","268688","740047","114599","3825","136696","510171","583412","527097","459054","394566","527049","42395","423433","560913","10523","633645","276735","98189","436591","486579","174637","229759","741173","323497","505584","202919","543624","207213","357526","683316","168211","252968","154941","190610","413862","280908","84265","133626","529485","124204","625377","280041","111630","352201","393022","739150","712771","725867","346270","7472","520136","699977","653006","163799","402241","205674","576501","484085","398035","698073","397732","392895","452738","686515","494715","119942","404164","54766","3018","541637","237172","308887","518456","392251","37827","709141","214586","650748","342961","689229","287574","162231","677377","594611","459583","5345","659573","720866","302223","666826","600951","12975","9657","218328","327203","739833","666278","350003","315382","435605","518781","698164","175092","665394","345163","635127","304672","436536","222764","412651","303447","6129","550575","472180","213159","25905","22934","106642","633036","143891","216343","721160","72304","633207","632731","736826","432548","181759","551632","725815","215195","223011","622685","92753","10762","550305","383087","363668","43551","177141","401034","20770","306480","284016","59844","667708","542725","113457","739458","508828","441223","559998","435591","405420","696334","576543","261890","402065","527836","533962","441188","723652","192466","229968","715738","558008","609711","597990","236922","426472","582802","390760","69663","544928","254581","442349","366927","282594","254602","480000","201584","686417","54735","694045","252780","217394","708532","335875","674447","20631","608816","384122","496875","261062","655033","90521","733932","98413","617125","165241","520537","337343","180848","632951","547653","331593","290825","416266","124845","155385","695300","507701","352980","627625","15020","118961","804","535270","276059","69839","196053","633462","10108","323306","409528","57772","567295","190019","306220","585255","341242","119663","98240","729135","663361","254584","275303","328490","337747","197292","302560","270309","712011","631081","478268","400476"]

1 Answer 1

1

The string 0xfffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffeffffff7ffffffffff0f encodes 41 bytes. This in total would give 328 bits as you suggest however the last 4 bits are zero as you can see from 0x0f that makes 324. Finally you need to remove the last bit which marks the end, which gives 323 as you expect.

1
  • Thank you so much for clarifying my doubt about this. I have one more question is the first validator would align with the left side or the right side. Jul 13, 2023 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.