Skip to content
Merged
Changes from all 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
15 changes: 15 additions & 0 deletions arbitrum/apibackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,21 @@ func StateAndHeaderFromHeader(ctx context.Context, chainDb ethdb.Database, bc *c
if archiveClientsManager != nil && header.Number.Uint64() <= archiveClientsManager.lastAvailableBlock() {
return nil, header, &types.ErrUseArchiveFallback{BlockNum: header.Number.Uint64()}
}

// use upstream path for PathScheme, as:
// - intermediate state recreation and trie node referencing doesn't apply to pathdb
// - HistoricState is supported only by pathdb
if bc.TrieDB().Scheme() == rawdb.PathScheme {
statedb, err := bc.StateAt(header.Root)
if err != nil {
statedb, err = bc.HistoricState(header.Root)
if err != nil {
return nil, nil, err
}
}
return statedb, header, nil
}

stateFor := func(db state.Database, snapshots *snapshot.Tree) func(header *types.Header) (*state.StateDB, StateReleaseFunc, error) {
return func(header *types.Header) (*state.StateDB, StateReleaseFunc, error) {
if header.Root != (common.Hash{}) {
Expand Down