Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NONEVM-1325 fix lp memory #1063

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions pkg/solana/logpoller/blocks_sorter.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ func (p *blocksSorter) readNextReadyBlock() *Block {
if !ok {
return nil
}
delete(p.readyBlocks, slotNumber)

p.queue.Remove(element)
return &block
Expand Down
14 changes: 10 additions & 4 deletions pkg/solana/logpoller/log_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,18 @@ func (lp *Service) backfillFilters(ctx context.Context, filters []Filter, to int
}
}

err := lp.processBlocksRange(ctx, addresses, minSlot, to)
if err != nil {
return err
if minSlot < to {
err := lp.processBlocksRange(ctx, addresses, minSlot, to)
if err != nil {
return err
}

lp.lggr.Infow("Done backfilling filters", "filters", len(filters), "from", minSlot, "to", to)
} else {
lp.lggr.Infow("Starting block for filters backfill is greater than the latest processed block - marking filters as backfilled and starting global processing", "filters", len(filters), "from", minSlot, "to", to)
}

lp.lggr.Infow("Done backfilling filters", "filters", len(filters), "from", minSlot, "to", to)
var err error
for _, filter := range filters {
filterErr := lp.filters.MarkFilterBackfilled(ctx, filter.ID)
if filterErr != nil {
Expand Down
Loading