fix missing shuffling dependent slot computation
This commit is contained in:
parent
adcabf9ad7
commit
3acbb3ea6c
|
@ -353,6 +353,9 @@ type
|
|||
block_root* {.serializedFieldName: "block".}: Eth2Digest
|
||||
optimistic* {.serializedFieldName: "execution_optimistic".}: Option[bool]
|
||||
|
||||
func attester_dependent_slot*(shuffling: ShufflingRef): Slot =
|
||||
dependent_slot((if shuffling.epoch == 0: Epoch(0) else: shuffling.epoch - 1))
|
||||
|
||||
template head*(dag: ChainDAGRef): BlockRef = dag.headState.blck
|
||||
|
||||
template frontfill*(dagParam: ChainDAGRef): Opt[BlockId] =
|
||||
|
|
|
@ -104,7 +104,7 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||
res
|
||||
|
||||
let optimistic = node.getShufflingOptimistic(
|
||||
qepoch.shufflingDependentSlot,
|
||||
shufflingRef.attester_dependent_slot,
|
||||
shufflingRef.attester_dependent_root)
|
||||
|
||||
return RestApiResponse.jsonResponseWRoot(
|
||||
|
|
|
@ -254,6 +254,10 @@ template start_slot*(period: SyncCommitteePeriod): Slot =
|
|||
if period >= maxPeriod: FAR_FUTURE_SLOT
|
||||
else: Slot(period * SLOTS_PER_SYNC_COMMITTEE_PERIOD)
|
||||
|
||||
func dependent_slot*(epoch: Epoch): Slot =
|
||||
if epoch == 0: Slot(0)
|
||||
else: epoch.start_slot() - 1
|
||||
|
||||
func `$`*(t: BeaconTime): string =
|
||||
if t.ns_since_genesis >= 0:
|
||||
$(timer.nanoseconds(t.ns_since_genesis))
|
||||
|
|
Loading…
Reference in New Issue