Skip to content

Commit

Permalink
feat: use ListUintNum64Type for BeaconState.balances
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths committed Mar 16, 2024
1 parent bdb38be commit 7da5063
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/types/src/phase0/sszTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ListBasicType,
ListCompositeType,
VectorBasicType,
ListUintNum64Type,
VectorCompositeType,
} from "@chainsafe/ssz";
import {
Expand Down Expand Up @@ -245,7 +246,8 @@ export const Validator = ValidatorNodeStruct;

// Export as stand-alone for direct tree optimizations
export const Validators = new ListCompositeType(ValidatorNodeStruct, VALIDATOR_REGISTRY_LIMIT);
export const Balances = new ListBasicType(UintNum64, VALIDATOR_REGISTRY_LIMIT);
// this ListUintNum64Type is used to cache Leaf Nodes of BeaconState.balances after epoch transition
export const Balances = new ListUintNum64Type(VALIDATOR_REGISTRY_LIMIT);
export const RandaoMixes = new VectorCompositeType(Bytes32, EPOCHS_PER_HISTORICAL_VECTOR);
/**
* This is initially a Gwei (BigInt) vector, however since Nov 2023 it's converted to UintNum64 (number) vector in the state transition because:
Expand Down

0 comments on commit 7da5063

Please sign in to comment.