From 4dcc02fcc2fdfb63c9216f1f72e4bf153d66dd20 Mon Sep 17 00:00:00 2001 From: jstr1121 Date: Wed, 11 Oct 2023 23:50:32 +0800 Subject: [PATCH] GetRequiredBlockState call ProcessBlock --- internal/ethapi/api.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index bac6b99e48..f6429734ed 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -967,6 +967,11 @@ func (s *BlockChainAPI) GetRequiredBlockState(ctx context.Context, blockNrOrHash // When the block doesn't exist, the RPC method should return JSON null return nil, nil } + state, _, err := s.b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash) + if err != nil { + return nil, nil + } + s.ProcessBlock(ctx, block, state, vm.Config{}) return s.traceBlock(ctx, block) }