From fe368f6fbb7dbca7d21a7fece6ce34e52c06575b Mon Sep 17 00:00:00 2001 From: lightclient Date: Mon, 5 May 2025 14:12:48 -0600 Subject: [PATCH] eth: add comment on stateAtTransaction method --- eth/state_accessor.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eth/state_accessor.go b/eth/state_accessor.go index 306c1e7c48..3c3e79a584 100644 --- a/eth/state_accessor.go +++ b/eth/state_accessor.go @@ -217,7 +217,13 @@ func (eth *Ethereum) stateAtBlock(ctx context.Context, block *types.Block, reexe return eth.pathState(block) } -// stateAtTransaction returns the execution environment of a certain transaction. +// stateAtTransaction returns the execution environment of a certain +// transaction. +// +// Note: when a block is empty and the state for tx index 0 is requested, this +// function will return the state of block after the pre-block operations have +// been completed (e.g. updating system contracts), but before post-block +// operations are completed (e.g. processing withdrawals). func (eth *Ethereum) stateAtTransaction(ctx context.Context, block *types.Block, txIndex int, reexec uint64) (*types.Transaction, vm.BlockContext, *state.StateDB, tracers.StateReleaseFunc, error) { // Short circuit if it's genesis block. if block.NumberU64() == 0 {