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

Client-side changes for event streams #20804

Draft
wants to merge 1 commit into
base: deepak/light-client-minor-refactor
Choose a base branch
from

Conversation

mskd12
Copy link
Contributor

@mskd12 mskd12 commented Jan 7, 2025

Description

This PR prototypes the client-side of the event streams design. The high-level logic is as follows.

Every X seconds, do:

  • fetch the latest stream head object & verify it with the committee keys (if we had object subscriptions, we wouldn't have to poll this way)
  • if it got updated since we last checked, fetch the newly emitted events and verify them against the new stream head.

Thoughts

Some design decisions that can help simplify the design (things I noticed as I prototyped this):

  • Deterministic derivation of the stream head's object ID from the event type
  • Whether the client needs to download the full checkpoint data or not: Would be nice to avoid if possible. A few places this crops up:
    - ADS choice: Using hash chains or similar data structures avoids it (as opposed to counters)
    - Object inclusion (verifying the latest state of the stream head object). The below prototype downloads the full checkpoint to verify the object's latest state (the only part of the prototype I don't like). To avoid this, we'd have to include a new field in the summary that contains a hash of all the object references (or a Merkle tree if we want to future-proof it).
  • In the below design, the StreamHead contains a:
    - digest (e.g. hash chain head)
    - a pointer to the last emitted event (to help figure out where to start looking)
    - counter (to help determine how many events to request)

Copy link

vercel bot commented Jan 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Jan 7, 2025 11:58am
sui-kiosk ⬜️ Ignored (Inspect) Jan 7, 2025 11:58am
sui-typescript-docs ⬜️ Ignored (Inspect) Jan 7, 2025 11:58am

@mskd12 mskd12 temporarily deployed to sui-typescript-aws-kms-test-env January 7, 2025 11:58 — with GitHub Actions Inactive
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.

1 participant