mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-09 13:56:23 +00:00
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
|
block_root* {.serializedFieldName: "block".}: Eth2Digest
|
||||||
optimistic* {.serializedFieldName: "execution_optimistic".}: Option[bool]
|
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 head*(dag: ChainDAGRef): BlockRef = dag.headState.blck
|
||||||
|
|
||||||
template frontfill*(dagParam: ChainDAGRef): Opt[BlockId] =
|
template frontfill*(dagParam: ChainDAGRef): Opt[BlockId] =
|
||||||
|
@ -104,7 +104,7 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||||||
res
|
res
|
||||||
|
|
||||||
let optimistic = node.getShufflingOptimistic(
|
let optimistic = node.getShufflingOptimistic(
|
||||||
qepoch.shufflingDependentSlot,
|
shufflingRef.attester_dependent_slot,
|
||||||
shufflingRef.attester_dependent_root)
|
shufflingRef.attester_dependent_root)
|
||||||
|
|
||||||
return RestApiResponse.jsonResponseWRoot(
|
return RestApiResponse.jsonResponseWRoot(
|
||||||
|
@ -254,6 +254,10 @@ template start_slot*(period: SyncCommitteePeriod): Slot =
|
|||||||
if period >= maxPeriod: FAR_FUTURE_SLOT
|
if period >= maxPeriod: FAR_FUTURE_SLOT
|
||||||
else: Slot(period * SLOTS_PER_SYNC_COMMITTEE_PERIOD)
|
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 =
|
func `$`*(t: BeaconTime): string =
|
||||||
if t.ns_since_genesis >= 0:
|
if t.ns_since_genesis >= 0:
|
||||||
$(timer.nanoseconds(t.ns_since_genesis))
|
$(timer.nanoseconds(t.ns_since_genesis))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user