From 567e6ce937d8b28b426e7bd0d1b9e93048d8eec4 Mon Sep 17 00:00:00 2001 From: Maciej Kulawik Date: Mon, 11 Dec 2023 18:46:54 +0000 Subject: [PATCH] add baseBlock comment, fix referencing befor StateAt --- eth/state_accessor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eth/state_accessor.go b/eth/state_accessor.go index cf780de7f1..6083ddbb34 100644 --- a/eth/state_accessor.go +++ b/eth/state_accessor.go @@ -47,6 +47,7 @@ import ( // - reexec: The maximum number of blocks to reprocess trying to obtain the desired state // - base: If the caller is tracing multiple blocks, the caller can provide the parent // state continuously from the callsite. +// - 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. // - readOnly: If true, then the live 'blockchain' state database is used. No mutation should // be made from caller, e.g. perform Commit or other 'save-to-disk' changes. // 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 // function to deref it. // Try referencing the root, if it isn't in dirties cache then Reference will have no effect - statedb.Database().TrieDB().Reference(block.Root(), common.Hash{}) + bc.StateCache().TrieDB().Reference(block.Root(), common.Hash{}) if statedb, err = eth.blockchain.StateAt(block.Root()); err == nil { return statedb, func() { statedb.Database().TrieDB().Dereference(block.Root())