Skip to content

Commit

Permalink
Merge pull request #3326 from jorgemmsilva/fix/indexing
Browse files Browse the repository at this point in the history
fix: indexing
  • Loading branch information
jorgemmsilva authored Mar 6, 2024
2 parents 2a791fc + bd72620 commit 3c4ff26
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
11 changes: 0 additions & 11 deletions packages/evm/jsonrpc/evmchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,6 @@ func NewEVMChain(
}
}()

if isArchiveNode {
latestState, err := backend.ISCLatestState()
if err != nil {
log.Warnf("could not fetch latest state; skipping first indexing: %s", err.Error())
} else {
log.Infof("indexing from block index #%d; this may take some time...", latestState.BlockIndex())
e.index.IndexBlock(latestState.TrieRoot())
log.Info("indexing done")
}
}

return e
}

Expand Down
3 changes: 0 additions & 3 deletions packages/evm/jsonrpc/jsonrpcindex/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ func (c *Index) IndexBlock(trieRoot trie.Hash) {
if lastBlockIndexed != nil {
cacheUntil = *lastBlockIndexed
}
if blockIndexToCache <= cacheUntil {
return
}

// we need to look at the next block to get the trie commitment of the block we want to cache
nextBlockInfo, found := blocklog.NewStateAccess(state).BlockInfo(blockIndexToCache + 1)
Expand Down
2 changes: 1 addition & 1 deletion packages/vm/core/testcore/blocklog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func TestBlocklogPruning(t *testing.T) {
require.ErrorContains(t, err, "not found")
// evm has the jsonrpcindex
_, err = ch.EVM().BlockByNumber(big.NewInt(int64(i)))
require.NoError(t, err)
require.ErrorContains(t, err, "not found")
}
for i := uint32(11); i <= 20; i++ {
bi, err := ch.GetBlockInfo(i)
Expand Down

0 comments on commit 3c4ff26

Please sign in to comment.