celo-org / optics-monorepo

🔮 OPTimistic Interchain Communication
Other
119 stars 37 forks source link

refactor/feature: split up indexing/contract/db logic + make watcher functional again #925

Closed luketchang closed 3 years ago

luketchang commented 3 years ago

CommonIndexer/HomeIndexer: Interface by which chain-specific homes/replicas bubble up event data (each chain will have a different implementation/library used retrieve this data which is why we need a trait to provide common interface). Bubbles up data to a ContractSync, which takes that data and stores it in agent's db. ContractSync: Drives syncing between agent db and on-chain data in loop. Continuously calls out to an indexer to retrieve event data and stores it in agent's db. CachingHome/CachingReplica: Both contain a sync function which spawns a new ContractSync to keep db up-to-date.

Closes #870

luketchang commented 3 years ago

Documentation: