Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions eth/tracers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,20 @@ func (api *API) blockByNumberAndHash(ctx context.Context, number rpc.BlockNumber
// getAllBlockTransactions returns all blocks transactions including state-sync transaction if present
// along with a flag and it's hash (which is calculated differently than regular transactions)
func (api *API) getAllBlockTransactions(ctx context.Context, block *types.Block) (types.Transactions, bool, common.Hash) {
txs := block.Transactions()
var (
txs types.Transactions = block.Transactions()
stateSyncPresent bool
stateSyncHash common.Hash
)

stateSyncPresent := false
stateSyncHash := common.Hash{}
isMadhugiri := api.backend.ChainConfig().Bor != nil && api.backend.ChainConfig().Bor.IsMadhugiri(block.Number())
if isMadhugiri {
if len(txs) > 0 && txs[len(txs)-1].Type() == types.StateSyncTxType {
stateSyncPresent = true
stateSyncHash = txs[len(txs)-1].Hash()
}
return txs, stateSyncPresent, stateSyncHash
}

borReceipt := rawdb.ReadBorReceipt(api.backend.ChainDb(), block.Hash(), block.NumberU64(), api.backend.ChainConfig())
if borReceipt != nil {
Expand Down Expand Up @@ -1088,7 +1098,7 @@ func (api *API) standardTraceBlockToFile(ctx context.Context, block *types.Block
if chainConfig.IsPrague(block.Number()) {
core.ProcessParentBlockHash(block.ParentHash(), evm)
}
for i, tx := range block.Transactions() {
for i, tx := range txs {
// Prepare the transaction for un-traced execution
var (
msg, _ = core.TransactionToMessage(tx, signer, block.BaseFee())
Expand Down
Loading