Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion indexer/beacon/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (c *Client) processHeadEvent(headEvent *v1.HeadEvent) error {
epochStats := c.indexer.epochCache.createOrGetEpochStats(epoch, dependentRoot)

if epoch >= absoluteMinInMemoryEpoch {
c.indexer.epochCache.ensureEpochDependentState(epochStats, currentBlock.Root)
c.indexer.epochCache.ensureEpochDependentState(epochStats)
}
if !epochStats.addRequestedBy(c) {
break
Expand Down
2 changes: 1 addition & 1 deletion indexer/beacon/epochcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (cache *epochCache) createOrGetEpochStats(epoch phase0.Epoch, dependentRoot
return epochStats
}

func (cache *epochCache) ensureEpochDependentState(epochStats *EpochStats, firstBlockRoot phase0.Root) {
func (cache *epochCache) ensureEpochDependentState(epochStats *EpochStats) {
cache.cacheMutex.Lock()
defer cache.cacheMutex.Unlock()

Expand Down
2 changes: 1 addition & 1 deletion indexer/beacon/finalization.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func (indexer *Indexer) finalizeEpoch(epoch phase0.Epoch, justifiedRoot phase0.R
// if the state is not yet loaded, we set it to high priority and wait for it to be loaded
if !epochStats.ready {
if epochStats.dependentState == nil {
indexer.epochCache.ensureEpochDependentState(epochStats, canonicalBlocks[0].Root)
indexer.epochCache.ensureEpochDependentState(epochStats)
}
if epochStats.dependentState != nil && epochStats.dependentState.loadingStatus != 2 && epochStats.dependentState.retryCount < 10 {
indexer.logger.Infof("epoch %d state (%v) not yet loaded, waiting for state to be loaded", epoch, dependentRoot.String())
Expand Down
2 changes: 1 addition & 1 deletion indexer/beacon/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ func (indexer *Indexer) StartIndexer() {
indexer.logger.Warnf("genesis block not found in cache")
} else {
epochStats := indexer.epochCache.createOrGetEpochStats(0, genesisBlock[0].Root)
indexer.epochCache.ensureEpochDependentState(epochStats, genesisBlock[0].Root)
indexer.epochCache.ensureEpochDependentState(epochStats)
}
}

Expand Down
2 changes: 1 addition & 1 deletion indexer/beacon/pruning.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (indexer *Indexer) processEpochPruning(pruneEpoch phase0.Epoch) (uint64, ui
// if the state is not yet loaded, we set it to high priority and wait for it to be loaded
if epochStats != nil && !epochStats.ready {
if epochStats.dependentState == nil {
indexer.epochCache.ensureEpochDependentState(epochStats, blocks[0].Root)
indexer.epochCache.ensureEpochDependentState(epochStats)
}
if epochStats.dependentState != nil && epochStats.dependentState.loadingStatus != 2 && epochStats.dependentState.retryCount < 10 {
indexer.logger.Infof("epoch %d state (%v) not yet loaded, waiting for state to be loaded", pruneEpoch, dependentRoot.String())
Expand Down