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

Make block ranges vs sequence ranges less confusing; ensure at compile time that indexer and cursor pairs have consistent range types #3266

Open
Tracked by #3414
tkporter opened this issue Feb 15, 2024 · 0 comments
Assignees

Comments

@tkporter
Copy link
Collaborator

tkporter commented Feb 15, 2024

After this task, we should have:

  • less confusing treatment of sequence ranges vs block ranges. E.g. the current pattern of returning a single RangeInclusive that can mean either a block range or sequence range is pretty confusing. Consider something like Dan's suggestion here Sequence-aware indexing refactor #3262 (comment)
  • We shouldn't need to implement SequenceAwareIndexer for types that don't involve sequences. E.g. atm we need to impl SequenceAwareIndexer<InterchainGasPayment> for Cosmos and Ethereum, when we don't actually need it. It just returns None as the option
  • Possibly remove Indexer as a supertrait of SequenceAwareIndexer
  • For an Indexer + Cursor pair, we should have a compile-time guarantee that they agree on what indexing range mode they use (sequence range vs block range). See picture in https://www.notion.so/hyperlanexyz/Indexing-Refactor-7220f23de5fd4592beb30af801b6f61a?pvs=4#799205eedd7741baad03d4174ec73ede for details. Leading idea is to within ContractSync, store (Indexer, Cursor) pairs as variants of an enum that enforces either Block or Sequence traits. Alternatively, the enum could be replaced by dynamic dispatch.
@avious00 avious00 moved this to Next Sprint in Hyperlane Tasks Feb 17, 2024
@tkporter tkporter changed the title Indexer and Cursor pairs are either Block or Sequence type, and this is enforced at compile time Make block ranges vs sequence ranges less confusing; ensure at compile time that indexer and cursor pairs have consistent range types Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants