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
In ssz spec, the list type must have a limit to calculate the merkle tree root. So we define a method to get the limit of the slice.
eg IndexedAttestation, the field attesting_indices is a slice, so it must have a method ${fieldName}_limit
pub const IndexedAttestation = struct {
// # [Modified in Electra:EIP7549] size: MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT
attesting_indices: []primitives.ValidatorIndex,
data: AttestationData,
signature: primitives.BLSSignature,
// limit for slice type from spec, the method name must be field name + "_limit"
pub fn attesting_indices_limit() u64 {
return preset.ActivePreset.get().MAX_VALIDATORS_PER_COMMITTEE;
}
};
There is a side efffect, Because call the method through reflection is comptime, so we have to add method for all Slice type field, even it's not a ssz type.
The text was updated successfully, but these errors were encountered:
In ssz spec, the list type must have a limit to calculate the merkle tree root. So we define a method to get the limit of the slice.
eg
IndexedAttestation
, the fieldattesting_indices
is a slice, so it must have a method${fieldName}_limit
There is a side efffect, Because call the method through reflection is comptime, so we have to add method for all Slice type field, even it's not a ssz type.
The text was updated successfully, but these errors were encountered: