We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a98900 commit be38c7eCopy full SHA for be38c7e
jam/state/transitions/safrole/safrole.py
@@ -263,7 +263,7 @@ def arrange_fallback(entropy: Bytes, validators: Kappa) -> GammaS:
263
for i in range(EPOCH_LENGTH):
264
# Add entropy to encoded4(i)
265
hashed = Hash.blake2b(bytes(entropy) + U32(i).encode())
266
- index = int.from_bytes(hashed, "little")
267
- val_key = validators[index % len(validators)].bandersnatch
+ index, _ = U32.decode_from(bytes(Bytes(hashed[:4])))
+ val_key = validators[int(index) % len(validators)].bandersnatch
268
fallback.append(val_key)
269
return GammaS(GammaSFallback(fallback))
0 commit comments