ChainSafe / ChainSafe/lodestar

Error processing attestation on a restart

Open
#5,727 4 comments 0 reactions 1 assignee Claimed by @twoeths View on GitHub
good first issue help wanted prio-low scope-logging scope-ux
Dominant language
TypeScript
Stars
1.4k
Forks
483
Avg merge
1d 18h
Merged PRs (30d)
156

Description

### Describe the bug

On a restart, we can get an error like, see https://discord.com/channels/593655374469660673/593655641445367808/1123615328761552958

```
Jun-28 09:39:18.639[chain] warn: Error processing attestations from block slot=6761276, erroredAttestations=5 code=FORKCHOICE_ERROR_INVALID_ATTESTATION, err=code=UNKNOWN_HEAD_BLOCK, beaconBlockRoot=0x961ee2ae2a7b0cb8f2623edcb1c7a408c8258ddfcd3a2a5c71cb6640ed2e5ed0
Error: FORKCHOICE_ERROR_INVALID_ATTESTATION
at ForkChoice.validateAttestationData (file:///home/seamonkey/Downloads/lodestar/packages/fork-choice/src/forkChoice/forkChoice.ts:1048:13)
at ForkChoice.validateOnAttestation (file:///home/seamonkey/Downloads/lodestar/packages/fork-choice/src/forkChoice/forkChoice.ts:976:12)
at ForkChoice.onAttestation (file:///home/seamonkey/Downloads/lodestar/packages/fork-choice/src/forkChoice/forkChoice.ts:517:10)
at BeaconChain.importBlock (file:///home/seamonkey/Downloads/lodestar/packages/beacon-node/src/chain/blocks/importBlock.ts:129:27)
at BeaconChain.processBlocks (file:///home/seamonkey/Downloads/lodestar/packages/beacon-node/src/chain/blocks/index.ts:111:7)
at JobItemQueue.runJob (file:///home/seamonkey/Downloads/lodestar/packages/beacon-node/src/util/queue/itemQueue.ts:101:22)
```
[beacon-2023-06-28-trunc.log](https://github.com/ChainSafe/lodestar/files/11924648/beacon-2023-06-28-trunc.log)

@nflaig also got this error consistently
```
Jun-30 10:15:54.899[chain] warn: Error processing attestations from block slot=5967650, erroredAttestations=17 code=FORKCHOICE_ERROR_INVALID_ATTESTATION, err=code=UNKNOWN_TARGET_ROOT, root=0xc4d460df1cc7c4da058433f035f9a4b40cb9bc4ef2b4011e93425dc20b5259b5
Error: FORKCHOICE_ERROR_INVALID_ATTESTATION
at ForkChoice.validateAttestationData (file:///home/devops/goerli/lodestar/packages/fork-choice/src/forkChoice/forkChoice.ts:1028:13)
at ForkChoice.validateOnAttestation (file:///home/devops/goerli/lodestar/packages/fork-choice/src/forkChoice/forkChoice.ts:975:12)
at ForkChoice.onAttestation (file:///home/devops/goerli/lodestar/packages/fork-choice/src/forkChoice/forkChoice.ts:516:10)
at BeaconChain.importBlock (file:///home/devops/goerli/lodestar/packages/beacon-node/src/chain/blocks/importBlock.ts:133:27)
at BeaconChain.processBlocks (file:///home/devops/goerli/lodestar/packages/beacon-node/src/chain/blocks/index.ts:111:7)
at JobItemQueue.runJob (file:///home/devops/goerli/lodestar/packages/beacon-node/src/util/queue/itemQueue.ts:101:22)
```

### Expected behavior

- Investigate the error
- If there's no other way and it does not affect the sync, consider using `verbose/debug` log level

### Steps to reproduce

_No response_

### Additional context

_No response_

### Operating system

Linux

### Lodestar version or commit hash

v1.9.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.