From e8160c2126cd9d4b29b32c3f97cbc8cfe86cce0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mamy=20Andr=C3=A9-Ratsimbazafy?= Date: Tue, 26 Mar 2019 10:07:49 +0100 Subject: [PATCH] more logs to investigate epoch underflow/overflow https://github.com/status-im/nim-beacon-chain/issues/207 --- beacon_chain/spec/validator.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beacon_chain/spec/validator.nim b/beacon_chain/spec/validator.nim index 11f3ae0ed..b00bb7c72 100644 --- a/beacon_chain/spec/validator.nim +++ b/beacon_chain/spec/validator.nim @@ -137,7 +137,7 @@ func get_crosslink_committees_at_slot*(state: BeaconState, slot: Slot|uint64, ## ``slot`` in the next epoch -- with and without a `registry_change` let - epoch = slot_to_epoch(slot) + epoch = slot_to_epoch(slot) # TODO, enforce slot to be a Slot current_epoch = get_current_epoch(state) previous_epoch = get_previous_epoch(state) next_epoch = current_epoch + 1 @@ -145,11 +145,13 @@ func get_crosslink_committees_at_slot*(state: BeaconState, slot: Slot|uint64, doAssert previous_epoch <= epoch, "Previous epoch: " & $humaneEpochNum(previous_epoch) & ", epoch: " & $humaneEpochNum(epoch) & + " (slot: " & $humaneSlotNum(slot.Slot) & ")" & ", Next epoch: " & $humaneEpochNum(next_epoch) doAssert epoch <= next_epoch, "Previous epoch: " & $humaneEpochNum(previous_epoch) & ", epoch: " & $humaneEpochNum(epoch) & + " (slot: " & $humaneSlotNum(slot.Slot) & ")" & ", Next epoch: " & $humaneEpochNum(next_epoch) template get_epoch_specific_params(): auto =