File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff 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
340344func 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 }
You can’t perform that action at this time.
0 commit comments