Skip to content

Commit 545a026

Browse files
authored
Merge branch 'develop' into jt/l1-follower-mode-update-da-codec
2 parents 3c21f4e + 127845d commit 545a026

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

eth/api.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,11 @@ func (api *PublicDebugAPI) ExecutionWitness(ctx context.Context, blockNrOrHash r
334334
}
335335

336336
witness, err := generateWitness(api.eth.blockchain, block)
337-
return ToExecutionWitness(witness), err
337+
if err != nil {
338+
return nil, fmt.Errorf("failed to generate witness: %w", err)
339+
}
340+
341+
return ToExecutionWitness(witness), nil
338342
}
339343

340344
func generateWitness(blockchain *core.BlockChain, block *types.Block) (*stateless.Witness, error) {
@@ -344,7 +348,8 @@ func generateWitness(blockchain *core.BlockChain, block *types.Block) (*stateles
344348
}
345349

346350
parentHeader := witness.Headers[0]
347-
statedb, err := blockchain.StateAt(parentHeader.Root)
351+
// Avoid using snapshots to properly collect the witness data for all reads
352+
statedb, err := state.New(parentHeader.Root, blockchain.StateCache(), nil)
348353
if err != nil {
349354
return nil, fmt.Errorf("failed to retrieve parent state: %w", err)
350355
}

0 commit comments

Comments
 (0)