fix `findShufflingRef` slot compute around genesis (#4910)

`dependent_slot` for epoch 2 is epoch 1's start slot - 1, not 0.
This commit is contained in:
Etan Kissling 2023-05-11 10:39:40 +02:00 committed by GitHub
parent a35c2c15b0
commit a09b05bc27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -474,7 +474,7 @@ func findShufflingRef*(
## Lookup a shuffling in the cache, returning `none` if it's not present - see
## `getShufflingRef` for a version that creates a new instance if it's missing
let
dependent_slot = if epoch > 2: (epoch - 1).start_slot() - 1 else: Slot(0)
dependent_slot = if epoch >= 2: (epoch - 1).start_slot() - 1 else: Slot(0)
dependent_bsi = dag.atSlot(bid, dependent_slot).valueOr:
return Opt.none(ShufflingRef)