Skip to content

Commit 8d5951a

Browse files
committed
add baseBlock comment, fix referencing befor StateAt
1 parent 0227c54 commit 8d5951a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

eth/state_accessor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import (
4747
// - reexec: The maximum number of blocks to reprocess trying to obtain the desired state
4848
// - base: If the caller is tracing multiple blocks, the caller can provide the parent
4949
// state continuously from the callsite.
50+
// - baseBlock: Arbitrum specific: caller can provide the block from which reprocessing should start. Previous argument (base) is assumed to be the state at the block. If base is not provided, baseBlock is ignored.
5051
// - readOnly: If true, then the live 'blockchain' state database is used. No mutation should
5152
// be made from caller, e.g. perform Commit or other 'save-to-disk' changes.
5253
// Otherwise, the trash generated by caller may be persisted permanently.
@@ -68,7 +69,7 @@ func (eth *Ethereum) StateAtBlock(ctx context.Context, block *types.Block, reexe
6869
// function to deref it.
6970

7071
// Try referencing the root, if it isn't in dirties cache then Reference will have no effect
71-
statedb.Database().TrieDB().Reference(block.Root(), common.Hash{})
72+
eth.blockchain.StateCache().TrieDB().Reference(block.Root(), common.Hash{})
7273
if statedb, err = eth.blockchain.StateAt(block.Root()); err == nil {
7374
return statedb, func() {
7475
statedb.Database().TrieDB().Dereference(block.Root())

0 commit comments

Comments
 (0)