11# beacon_chain
2- # Copyright (c) 2020-2024 Status Research & Development GmbH
2+ # Copyright (c) 2020-2025 Status Research & Development GmbH
33# Licensed and distributed under either of
44# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
55# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@@ -11,19 +11,20 @@ import
1111 stew/ assign2,
1212 ./ spec/ forks
1313
14- func diffModIncEpoch [maxLen , T](hl: HashArray [maxLen, T], startSlot: uint64 ):
15- array [SLOTS_PER_EPOCH , T] =
16- static : doAssert maxLen .uint64 mod SLOTS_PER_EPOCH == 0
14+ func diffModIncEpoch [maxLength , T](
15+ hl: HashArray [maxLength, T], startSlot: uint64 ): array [SLOTS_PER_EPOCH , T] =
16+ static : doAssert maxLength .uint64 mod SLOTS_PER_EPOCH == 0
1717 doAssert startSlot mod SLOTS_PER_EPOCH == 0
1818 for i in startSlot ..< startSlot + SLOTS_PER_EPOCH :
19- result [i mod SLOTS_PER_EPOCH ] = hl[i mod maxLen .uint64 ]
19+ result [i mod SLOTS_PER_EPOCH ] = hl[i mod maxLength .uint64 ]
2020
21- func applyModIncrement [maxLen, T](
22- ha: var HashArray [maxLen, T], hl: array [SLOTS_PER_EPOCH , T], slot: uint64 ) =
21+ func applyModIncrement [maxLength, T](
22+ ha: var HashArray [maxLength, T], hl: array [SLOTS_PER_EPOCH , T],
23+ slot: uint64 ) =
2324 var indexSlot = slot
2425
2526 for item in hl:
26- ha[indexSlot mod maxLen .uint64 ] = item
27+ ha[indexSlot mod maxLength .uint64 ] = item
2728 indexSlot += 1
2829
2930func applyValidatorIdentities (
@@ -51,9 +52,9 @@ func setValidatorStatusesNoWithdrawals(
5152 validator[].exit_epoch = hl[i].exit_epoch
5253 validator[].withdrawable_epoch = hl[i].withdrawable_epoch
5354
54- func replaceOrAddEncodeEth1Votes [T, maxLen ](
55- votes0: openArray [T], votes0_len: int , votes1: HashList [T, maxLen ]):
56- (bool , List [T, maxLen ]) =
55+ func replaceOrAddEncodeEth1Votes [T, maxLength ](
56+ votes0: openArray [T], votes0_len: int , votes1: HashList [T, maxLength ]):
57+ (bool , List [T, maxLength ]) =
5758 let
5859 num_votes0 = votes0.len
5960 lower_bound =
@@ -67,17 +68,17 @@ func replaceOrAddEncodeEth1Votes[T, maxLen](
6768 else :
6869 num_votes0
6970
70- var res = (lower_bound == 0 , default (List [T, maxLen ]))
71+ var res = (lower_bound == 0 , default (List [T, maxLength ]))
7172 for i in lower_bound ..< votes1.len:
7273 if not result [1 ].add votes1[i]:
7374 raiseAssert " same limit"
7475 res
7576
76- func replaceOrAddDecodeEth1Votes [T, maxLen ](
77- votes0: var HashList [T, maxLen ], eth1_data_votes_replaced: bool ,
78- votes1: List [T, maxLen ]) =
77+ func replaceOrAddDecodeEth1Votes [T, maxLength ](
78+ votes0: var HashList [T, maxLength ], eth1_data_votes_replaced: bool ,
79+ votes1: List [T, maxLength ]) =
7980 if eth1_data_votes_replaced:
80- votes0 = HashList [T, maxLen ]()
81+ votes0 = HashList [T, maxLength ]()
8182
8283 for item in votes1:
8384 if not votes0.add item:
@@ -209,8 +210,8 @@ func applyDiff*(
209210 state: var capella.BeaconState ,
210211 immutableValidators: openArray [ImmutableValidatorData2 ],
211212 stateDiff: BeaconStateDiff ) =
212- template assign [T, maxLen ](
213- tgt: var HashList [T, maxLen ], src: List [T, maxLen ]) =
213+ template assign [T, maxLength ](
214+ tgt: var HashList [T, maxLength ], src: List [T, maxLength ]) =
214215 assign (tgt.data, src)
215216 tgt.resetCache ()
216217
0 commit comments