Skip to content

Commit be38c7e

Browse files
committed
fix: revert safrole fallback order
1 parent 7a98900 commit be38c7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jam/state/transitions/safrole/safrole.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def arrange_fallback(entropy: Bytes, validators: Kappa) -> GammaS:
263263
for i in range(EPOCH_LENGTH):
264264
# Add entropy to encoded4(i)
265265
hashed = Hash.blake2b(bytes(entropy) + U32(i).encode())
266-
index = int.from_bytes(hashed, "little")
267-
val_key = validators[index % len(validators)].bandersnatch
266+
index, _ = U32.decode_from(bytes(Bytes(hashed[:4])))
267+
val_key = validators[int(index) % len(validators)].bandersnatch
268268
fallback.append(val_key)
269269
return GammaS(GammaSFallback(fallback))

0 commit comments

Comments
 (0)