[DRAFT] Observe multiple contracts for ETH flow #3249
Draft
+22
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Explores the idea explained here: #3248 (comment)
My intuition says this should be enough, under the assumption that
eth_getLogs
works properly with multiple addresses.This solution has one downside: we can't define block number from which we want to start indexing new contract. The reason is how the indexing is continued after the autopilot restart: we check the latest indexed block in the database, and use that to continue indexing. And this solution assumes that old and new contract indexing is completely synchronised and atomically inserted into database. So, bottom line, new contract events would be inserted from the point when new contract address is added to the autopilot configuration.
IMO, this tradeoff is fine considering other solutions complexity.
To verify, e2e test will be written.
TODOS:
Changes
How to test