From c2a332d79498e1f831994e7f2d8500293a3034f0 Mon Sep 17 00:00:00 2001 From: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:03:51 +0200 Subject: [PATCH] rpcdaemon: Add missing flag (#12451) Cherry pick #12364 into `release/2.61` Co-authored-by: Shoham Chakraborty --- turbo/jsonrpc/tracing.go | 20 ++++++++++---------- turbo/transactions/tracing.go | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/turbo/jsonrpc/tracing.go b/turbo/jsonrpc/tracing.go index bc3664107a5..0d6ef400337 100644 --- a/turbo/jsonrpc/tracing.go +++ b/turbo/jsonrpc/tracing.go @@ -84,16 +84,6 @@ func (api *PrivateDebugAPIImpl) traceBlock(ctx context.Context, blockNrOrHash rp } engine := api.engine() - _, blockCtx, _, ibs, _, err := transactions.ComputeTxEnv(ctx, engine, block, chainConfig, api._blockReader, tx, 0, api.historyV3(tx), false) - if err != nil { - stream.WriteNil() - return err - } - - signer := types.MakeSigner(chainConfig, block.NumberU64(), block.Time()) - rules := chainConfig.Rules(block.NumberU64(), block.Time()) - stream.WriteArrayStart() - txns := block.Transactions() var borStateSyncTxn types.Transaction if *config.BorTraceEnabled { @@ -109,6 +99,16 @@ func (api *PrivateDebugAPIImpl) traceBlock(ctx context.Context, blockNrOrHash rp } } + _, blockCtx, _, ibs, _, err := transactions.ComputeTxEnv(ctx, engine, block, chainConfig, api._blockReader, tx, 0, api.historyV3(tx), borStateSyncTxn != nil) + if err != nil { + stream.WriteNil() + return err + } + + signer := types.MakeSigner(chainConfig, block.NumberU64(), block.Time()) + rules := chainConfig.Rules(block.NumberU64(), block.Time()) + stream.WriteArrayStart() + for idx, txn := range txns { isBorStateSyncTxn := borStateSyncTxn == txn var txnHash common.Hash diff --git a/turbo/transactions/tracing.go b/turbo/transactions/tracing.go index a704a77cf73..1ee638bb558 100644 --- a/turbo/transactions/tracing.go +++ b/turbo/transactions/tracing.go @@ -128,7 +128,7 @@ func ComputeTxEnv(ctx context.Context, engine consensus.EngineReader, block *typ } if isBorStateSyncTxn && txIndex == len(block.Transactions()) { - // tx is a state sync transaction + // we can reach here if the block has 0 normal transactions but has state sync transactions return nil, blockContext, evmtypes.TxContext{}, statedb, reader, nil }