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

Start indexing settlement contract as its creation as latest #3114

Merged

Conversation

m-lord-renkse
Copy link
Contributor

@m-lord-renkse m-lord-renkse commented Nov 6, 2024

Description

Start indexing settlement contract as its creation as latest. Starts from index block 0 if the contract has no deployment information (e2e test cases which deploy the contracts from scratch only).

The problem is that when we add a new network, it starts indexing from block 0 until it finds the first settlement contract event. Once the first event is found, it is stored in the database. By starting from the settlement contract creation block, we start indexing in a more efficient way.

@m-lord-renkse m-lord-renkse force-pushed the start-indexing-from-settlement-contract-start-block branch 7 times, most recently from 3d8def0 to 4bb24f4 Compare November 11, 2024 12:14
@m-lord-renkse m-lord-renkse force-pushed the start-indexing-from-settlement-contract-start-block branch from 4bb24f4 to 839ce25 Compare November 11, 2024 12:50
@m-lord-renkse m-lord-renkse marked this pull request as ready for review November 11, 2024 12:56
@m-lord-renkse m-lord-renkse requested a review from a team as a code owner November 11, 2024 12:56
Copy link
Contributor

@squadgazzz squadgazzz left a comment

Choose a reason for hiding this comment

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

LG

@m-lord-renkse m-lord-renkse merged commit 1d59e95 into main Nov 20, 2024
11 checks passed
@m-lord-renkse m-lord-renkse deleted the start-indexing-from-settlement-contract-start-block branch November 20, 2024 15:31
@github-actions github-actions bot locked and limited conversation to collaborators Nov 20, 2024
@@ -11,14 +11,16 @@ impl_event_retrieving! {

pub struct Indexer {
db: Postgres,
start_index: u64,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: could have been eth::BlockNo to make the code clearer

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants