Skip to content

Commit

Permalink
rpcdaemon: Get state at end of the block when generating Bor receipts (
Browse files Browse the repository at this point in the history
…#12436)

We want to get the state at the end of the block when executing state
sync events. `CreateHistoryStateReader` gives us the state before the
transaction at `txIndex` is executed, so we want to get the state at
`txIndex=len(transactions)`.
  • Loading branch information
shohamc1 authored Oct 24, 2024
1 parent 5ca9e25 commit f9527b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion turbo/jsonrpc/receipts/bor_receipts_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (g *BorGenerator) GenerateBorReceipt(ctx context.Context, tx kv.Tx, block *
}

txNumsReader := rawdbv3.TxNums.WithCustomReadTxNumFunc(freezeblocks.ReadTxNumFuncFromBlockReader(ctx, g.blockReader))
ibs, blockContext, _, _, _, err := transactions.ComputeBlockContext(ctx, g.engine, block.HeaderNoCopy(), chainConfig, g.blockReader, txNumsReader, tx, len(blockReceipts)-1)
ibs, blockContext, _, _, _, err := transactions.ComputeBlockContext(ctx, g.engine, block.HeaderNoCopy(), chainConfig, g.blockReader, txNumsReader, tx, len(blockReceipts)) // we want to get the state at the end of the block
if err != nil {
return nil, err
}
Expand Down

0 comments on commit f9527b8

Please sign in to comment.