ChainSafe / lodestar

🌟 TypeScript Implementation of Ethereum Consensus
https://lodestar.chainsafe.io
Apache License 2.0
1.1k stars 273 forks source link

Validator monitor error in slot before first epoch transition #6784

Open nflaig opened 1 month ago

nflaig commented 1 month ago

Describe the bug

There is a validator monitor error in the slot right before first epoch transition

[cl-1-lodestar-nethermind] May-15 13:55:00.025[chain]           error: Error on validator monitor onceEveryEndOfEpoch slot=31 - Can only get block root in the past currentSlot=31 slot=31
[cl-1-lodestar-nethermind] Error: Can only get block root in the past currentSlot=31 slot=31
[cl-1-lodestar-nethermind]     at getBlockRootAtSlot (file:///usr/app/packages/state-transition/src/util/blockRoot.ts:14:11)
[cl-1-lodestar-nethermind]     at RootHexCache.getBlockRootAtSlot (file:///usr/app/packages/beacon-node/src/metrics/validatorMonitor.ts:1033:20)
[cl-1-lodestar-nethermind]     at isCanonical (file:///usr/app/packages/beacon-node/src/metrics/validatorMonitor.ts:981:20)
[cl-1-lodestar-nethermind]     at file:///usr/app/packages/beacon-node/src/metrics/validatorMonitor.ts:873:77
[cl-1-lodestar-nethermind]     at Array.find (<anonymous>)
[cl-1-lodestar-nethermind]     at renderAttestationSummary (file:///usr/app/packages/beacon-node/src/metrics/validatorMonitor.ts:873:61)
[cl-1-lodestar-nethermind]     at Object.onceEveryEndOfEpoch (file:///usr/app/packages/beacon-node/src/metrics/validatorMonitor.ts:648:27)
[cl-1-lodestar-nethermind]     at file:///usr/app/packages/beacon-node/src/chain/chain.ts:969:29

Expected behavior

No error

Steps to reproduce

Kurtosis config

participants:
  - el_type: nethermind
    el_image: 192.168.45.152:80/dh/nethermindeth/nethermind:pectra
    cl_type: lodestar
    cl_image: 192.168.45.152:80/dh/ethpandaops/lodestar:electra-fork
    count: 4
network_params:
  electra_fork_epoch: 2 # electra fork epoch does not matter
  seconds_per_slot: 12
  num_validator_keys_per_node: 64
additional_services:
  - dora
  - prometheus_grafana
snooper_enabled: true

Additional context

No response

Operating system

Linux

Lodestar version or commit hash

electra-fork branch

ensi321 commented 1 month ago

It looks like this error happens in the first epoch transition regardless if there is a fork transition.

I ran with electra_fork_epoch: 2, this error shows up in the first epoch transition, and not the fork transition (second epoch transition).