@@ -77,20 +77,20 @@ def get_block_hash(
7777 recent_block_hashes : Sequence [Hash32 ],
7878 current_block_slot_number : int ,
7979 slot : int ,
80- cycle_length : int ) -> Hash32 :
80+ epoch_length : int ) -> Hash32 :
8181 """
8282 Return the blockhash from ``ActiveState.recent_block_hashes`` by
8383 ``current_block_slot_number``.
8484 """
85- if len (recent_block_hashes ) != cycle_length * 2 :
85+ if len (recent_block_hashes ) != epoch_length * 2 :
8686 raise ValueError (
87- "Length of recent_block_hashes != cycle_length * 2"
87+ "Length of recent_block_hashes != epoch_length * 2"
8888 "\t expected: %s, found: %s" % (
89- cycle_length * 2 , len (recent_block_hashes )
89+ epoch_length * 2 , len (recent_block_hashes )
9090 )
9191 )
9292
93- slot_relative_position = current_block_slot_number - cycle_length * 2
93+ slot_relative_position = current_block_slot_number - epoch_length * 2
9494 return _get_element_from_recent_list (
9595 recent_block_hashes ,
9696 slot ,
@@ -104,7 +104,7 @@ def get_hashes_from_recent_block_hashes(
104104 current_block_slot_number : int ,
105105 from_slot : int ,
106106 to_slot : int ,
107- cycle_length : int ) -> Iterable [Hash32 ]:
107+ epoch_length : int ) -> Iterable [Hash32 ]:
108108 """
109109 Returns the block hashes between ``from_slot`` and ``to_slot``.
110110 """
@@ -113,24 +113,24 @@ def get_hashes_from_recent_block_hashes(
113113 recent_block_hashes ,
114114 current_block_slot_number ,
115115 slot ,
116- cycle_length ,
116+ epoch_length ,
117117 )
118118
119119
120120@to_tuple
121121def get_hashes_to_sign (recent_block_hashes : Sequence [Hash32 ],
122122 block : 'BaseBeaconBlock' ,
123- cycle_length : int ) -> Iterable [Hash32 ]:
123+ epoch_length : int ) -> Iterable [Hash32 ]:
124124 """
125125 Given the head block to attest to, collect the list of hashes to be
126126 signed in the attestation.
127127 """
128128 yield from get_hashes_from_recent_block_hashes (
129129 recent_block_hashes ,
130130 block .slot_number ,
131- from_slot = block .slot_number - cycle_length + 1 ,
131+ from_slot = block .slot_number - epoch_length + 1 ,
132132 to_slot = block .slot_number - 1 ,
133- cycle_length = cycle_length ,
133+ epoch_length = epoch_length ,
134134 )
135135 yield block .hash
136136
@@ -139,17 +139,17 @@ def get_hashes_to_sign(recent_block_hashes: Sequence[Hash32],
139139def get_signed_parent_hashes (recent_block_hashes : Sequence [Hash32 ],
140140 block : 'BaseBeaconBlock' ,
141141 attestation : 'AttestationRecord' ,
142- cycle_length : int ) -> Iterable [Hash32 ]:
142+ epoch_length : int ) -> Iterable [Hash32 ]:
143143 """
144144 Given an attestation and the block they were included in,
145145 the list of hashes that were included in the signature.
146146 """
147147 yield from get_hashes_from_recent_block_hashes (
148148 recent_block_hashes ,
149149 block .slot_number ,
150- from_slot = attestation .slot - cycle_length + 1 ,
150+ from_slot = attestation .slot - epoch_length + 1 ,
151151 to_slot = attestation .slot - len (attestation .oblique_parent_hashes ),
152- cycle_length = cycle_length ,
152+ epoch_length = epoch_length ,
153153 )
154154 yield from attestation .oblique_parent_hashes
155155
@@ -173,19 +173,19 @@ def get_new_recent_block_hashes(old_block_hashes: Sequence[Hash32],
173173def get_shards_and_committees_for_slot (
174174 crystallized_state : 'CrystallizedState' ,
175175 slot : int ,
176- cycle_length : int ) -> Iterable [ShardCommittee ]:
176+ epoch_length : int ) -> Iterable [ShardCommittee ]:
177177 """
178178 FIXME
179179 """
180- if len (crystallized_state .shard_committee_for_slots ) != cycle_length * 2 :
180+ if len (crystallized_state .shard_committee_for_slots ) != epoch_length * 2 :
181181 raise ValueError (
182- "Length of shard_committee_for_slots != cycle_length * 2"
182+ "Length of shard_committee_for_slots != epoch_length * 2"
183183 "\t expected: %s, found: %s" % (
184- cycle_length * 2 , len (crystallized_state .shard_committee_for_slots )
184+ epoch_length * 2 , len (crystallized_state .shard_committee_for_slots )
185185 )
186186 )
187187
188- slot_relative_position = crystallized_state .last_state_recalc - cycle_length
188+ slot_relative_position = crystallized_state .last_state_recalc - epoch_length
189189
190190 yield from _get_element_from_recent_list (
191191 crystallized_state .shard_committee_for_slots ,
@@ -197,7 +197,7 @@ def get_shards_and_committees_for_slot(
197197@to_tuple
198198def get_attestation_indices (crystallized_state : 'CrystallizedState' ,
199199 attestation : 'AttestationRecord' ,
200- cycle_length : int ) -> Iterable [int ]:
200+ epoch_length : int ) -> Iterable [int ]:
201201 """
202202 FIXME
203203 Return committee of the given attestation.
@@ -207,7 +207,7 @@ def get_attestation_indices(crystallized_state: 'CrystallizedState',
207207 shards_and_committees_for_slot = get_shards_and_committees_for_slot (
208208 crystallized_state ,
209209 attestation .slot ,
210- cycle_length ,
210+ epoch_length ,
211211 )
212212
213213 for shard_committee in shards_and_committees_for_slot :
@@ -248,7 +248,7 @@ def get_new_shuffling(*,
248248 seed : Hash32 ,
249249 validators : Sequence ['ValidatorRecord' ],
250250 crosslinking_start_shard : int ,
251- cycle_length : int ,
251+ epoch_length : int ,
252252 target_committee_size : int ,
253253 shard_count : int ) -> Iterable [Iterable [ShardCommittee ]]:
254254 """
@@ -297,14 +297,14 @@ def get_new_shuffling(*,
297297 active_validators_size = len (active_validators )
298298 committees_per_slot = clamp (
299299 1 ,
300- shard_count // cycle_length ,
301- active_validators_size // cycle_length // target_committee_size ,
300+ shard_count // epoch_length ,
301+ active_validators_size // epoch_length // target_committee_size ,
302302 )
303303 # Shuffle with seed
304304 shuffled_active_validator_indices = shuffle (active_validators , seed )
305305
306306 # Split the shuffled list into epoch_length pieces
307- validators_per_slot = split (shuffled_active_validator_indices , cycle_length )
307+ validators_per_slot = split (shuffled_active_validator_indices , epoch_length )
308308 for index , slot_indices in enumerate (validators_per_slot ):
309309 # Split the shuffled list into committees_per_slot pieces
310310 shard_indices = split (slot_indices , committees_per_slot )
@@ -321,11 +321,11 @@ def get_new_shuffling(*,
321321#
322322def get_block_committees_info (parent_block : 'BaseBeaconBlock' ,
323323 crystallized_state : 'CrystallizedState' ,
324- cycle_length : int ) -> BlockCommitteesInfo :
324+ epoch_length : int ) -> BlockCommitteesInfo :
325325 shards_and_committees = get_shards_and_committees_for_slot (
326326 crystallized_state ,
327327 parent_block .slot_number ,
328- cycle_length ,
328+ epoch_length ,
329329 )
330330 """
331331 FIXME
0 commit comments