fix research/searialized_sizes.nim
This commit is contained in:
parent
b46183047f
commit
7a7903535c
|
@ -1,7 +1,7 @@
|
||||||
import
|
import
|
||||||
confutils,
|
confutils,
|
||||||
../beacon_chain/[extras, ssz],
|
../beacon_chain/[extras, ssz],
|
||||||
../beacon_chain/spec/[beaconstate, datatypes, digest],
|
../beacon_chain/spec/[beaconstate, datatypes, digest, validator],
|
||||||
../tests/testutil
|
../tests/testutil
|
||||||
|
|
||||||
proc stateSize(deposits: int, maxContent = false) =
|
proc stateSize(deposits: int, maxContent = false) =
|
||||||
|
@ -13,8 +13,10 @@ proc stateSize(deposits: int, maxContent = false) =
|
||||||
# of attestations, and each block has a cap on the number of
|
# of attestations, and each block has a cap on the number of
|
||||||
# attestations it may hold, so we'll just add so many of them
|
# attestations it may hold, so we'll just add so many of them
|
||||||
state.latest_attestations.setLen(MAX_ATTESTATIONS * EPOCH_LENGTH * 2)
|
state.latest_attestations.setLen(MAX_ATTESTATIONS * EPOCH_LENGTH * 2)
|
||||||
let validatorsPerCommittee =
|
let
|
||||||
len(state.shard_committees_at_slots[0][0].committee) # close enough..
|
crosslink_committees = get_crosslink_committees_at_slot(state, 0)
|
||||||
|
validatorsPerCommittee =
|
||||||
|
len(crosslink_committees[0].a) # close enough..
|
||||||
for a in state.latest_attestations.mitems():
|
for a in state.latest_attestations.mitems():
|
||||||
a.participation_bitfield.setLen(validatorsPerCommittee)
|
a.participation_bitfield.setLen(validatorsPerCommittee)
|
||||||
echo "Validators: ", deposits, ", total: ", state.serialize().len
|
echo "Validators: ", deposits, ", total: ", state.serialize().len
|
||||||
|
|
Loading…
Reference in New Issue