Skip to content

Add validation for endblock on finite chains#191

Merged
JonoPrest merged 5 commits into
mainfrom
jp/add-endblock-for-goerli
Sep 12, 2024
Merged

Add validation for endblock on finite chains#191
JonoPrest merged 5 commits into
mainfrom
jp/add-endblock-for-goerli

Conversation

@JonoPrest

Copy link
Copy Markdown
Collaborator

Closes #183

  • Adds validation for chains that have a known finite end_block (currently only goerli and mumbai). This prevents a user from running a multichain indexer without unordered_multichain_mode or an end_block for this chain.
  • Automatically adds the end_block for contract import generated indexers

@JonoPrest JonoPrest requested a review from DZakh September 11, 2024 14:02
Comment on lines +140 to +144
Err(anyhow!(
"Network {} has a finite end block of {}. Please set an end_block that is \
less than or equal to the finite end block in your config or set \
\"unordered_multichain_mode\" to true. Your multichain indexer will \
otherwise be stuck when it reaches the end of this chain.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What do you think of setting it by ourselves when we parse human config to system config?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I would rather it's explicit than inferred. In case we make a mistake. Say we added another deprecated chain and mess up the finite end_block, then it's easier to get this reported.

@JonoPrest JonoPrest requested a review from DZakh September 11, 2024 15:12
@JonoPrest JonoPrest force-pushed the jp/add-endblock-for-goerli branch from 4efec9a to deebf1b Compare September 12, 2024 09:28
@JonoPrest JonoPrest enabled auto-merge (squash) September 12, 2024 09:30
@JonoPrest JonoPrest merged commit 5933ba1 into main Sep 12, 2024
@JonoPrest JonoPrest deleted the jp/add-endblock-for-goerli branch September 12, 2024 09:37
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.

Indexer freezes at a certain event count

2 participants