Skip to content

add a work pool to fetch check points - #473

Closed
FelixFan1992 wants to merge 7 commits into
developfrom
improve-chain-poller-2
Closed

add a work pool to fetch check points#473
FelixFan1992 wants to merge 7 commits into
developfrom
improve-chain-poller-2

Conversation

@FelixFan1992

Copy link
Copy Markdown
Collaborator

Describe your changes

..

Issue ticket number and link

..

Describe highly relevant files or code snippets that are critical in the review

..

Are there other PRs that should be merged first?

..

@FelixFan1992
FelixFan1992 changed the base branch from improve-chain-poller-1 to develop July 22, 2026 22:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR speeds up chain catch-up by fetching checkpoint data in parallel (while still committing checkpoints in-order) and reduces per-checkpoint DB work in the TransactionsIndexer by caching the decoded transmitter set from the latest ConfigSet event.

Changes:

  • Add a concurrent fetch stage to ChainPoller.catchUp, committing checkpoints strictly in sequence order.
  • Add a transmitter cache (TTL + “refresh grace” window) to avoid re-querying/re-decoding ConfigSet on every checkpoint.
  • Optimize event filtering by precomputing normalized selector type strings; add/adjust unit tests for the new behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
relayer/chainreader/indexer/transactions_indexer.go Adds transmitter caching and invalidation based on seeing ConfigSet in a checkpoint batch.
relayer/chainreader/indexer/transactions_indexer_unit_test.go Adds a unit test for detecting ConfigSet presence within a checkpoint batch.
relayer/chainreader/indexer/chain_poller.go Introduces concurrent checkpoint fetching for catch-up, splits fetch vs commit, and optimizes event filtering comparisons.
relayer/chainreader/indexer/chain_poller_test.go Makes catch-up tests concurrency-safe (mutex + order-independent assertions).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread relayer/chainreader/indexer/chain_poller.go Outdated
Comment thread relayer/chainreader/indexer/transactions_indexer.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

relayer/chainreader/indexer/transactions_indexer.go:557

  • getTransmitters() documents that callers should not be able to mutate the shared transmitter cache, but on a cache miss it returns the slice from fetchTransmitters() directly. That slice can be mutated by the caller and diverge from the cached copy, and it also violates the function comment.
	return transmitters, nil

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread relayer/chainreader/indexer/transactions_indexer.go
Comment thread relayer/chainreader/indexer/chain_poller_test.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@FelixFan1992
FelixFan1992 deleted the improve-chain-poller-2 branch July 27, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants