ChainSafe / ChainSafe/lodestar

Error upgrading BeaconState

Open
#6,811 4 comments 0 reactions 0 assignees View on GitHub
meta-bug
Dominant language
TypeScript
Stars
1.4k
Forks
483
Avg merge
1d 16h
Merged PRs (30d)
150

Description

### Describe the bug

There is a TODO when upgrading state from capella to deneb: https://github.com/ChainSafe/lodestar/blob/8ed9109ddd394e6406c3c4feefb9140d71e88082/packages/state-transition/src/slot/upgradeStateToDeneb.ts#L28

if we migrate this way:
```
stateDeneb.latestExecutionPayloadHeader.excessBlobGas = BigInt(0);
stateDeneb.latestExecutionPayloadHeader.blobGasUsed = BigInt(0);
```

then got this error in spec test:
```
Error: LeafNode has no left node
❯ LeafNode.get left [as left] ../../node_modules/@chainsafe/ssz/node_modules/@chainsafe/persistent-merkle-tree/lib/node.js:109:15
❯ Object.getNodeAtDepth ../../node_modules/@chainsafe/ssz/node_modules/@chainsafe/persistent-merkle-tree/lib/tree.js:280:44
❯ CustomContainerTreeViewDU.set [as excessBlobGas] ../../node_modules/@chainsafe/ssz/src/viewDU/container.ts:193:52
❯ Module.upgradeStateToDeneb ../state-transition/src/slot/upgradeStateToDeneb.ts:34:56
```

### Expected behavior

no error

### Steps to reproduce

_No response_

### Additional context

_No response_

### Operating system

Linux

### Lodestar version or commit hash

v1.18.0

Contributor guide

Open the contributing guide

Research direction

Start in packages/state-transition/src/slot/upgradeStateToDeneb.ts at the TODO and inspect the SSZ tree access shown in the error stack. Reproduce the Capella-to-Deneb migration in the relevant spec test and confirm that the upgrade completes without the LeafNode error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.