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

in-memory realtime sync #1115

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

in-memory realtime sync #1115

wants to merge 11 commits into from

Conversation

kyscott18
Copy link
Collaborator

@kyscott18 kyscott18 commented Sep 20, 2024

The "sync" portion of ponder handling extracting and ordering events is entirely in-memory, removing the need for database queries. Another property is that only finalized data is added to the sync-store. This is a combination of #1092 and #1103. Closes #1091.

This involves:

  • storing child address information in memory
  • filtering, formatting, and ordering events, (replacing getEvents())

Child address methodology

  • separate unfinalizedChildAddresses and finalizedChildAddresses
  • track factoryLogsPerBlock, so that unfinalizedChildAddresses can always be recomputed
  • on reorg, evict reorged blocks from factoryLogsPerBlock and recompute unfinalizedChildAddresses
  • on finalization, add child addresses from finalized blocks to finalizedChildAddresses, evict finalized blocks from factoryLogsPerBlock and recompute unfinalizedChildAddresses

TODO

  • pass factory information to buildEvents
  • handle back-pressure when a block becomes finalized before it has been indexed
  • test (address casing + getChildAddress, + buildEvents)

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.

Hold all factory child addresses in memory
1 participant