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

feat: add new message_hash column to the archive protocol #2112

Closed
4 tasks done
Tracked by #57
Ivansete-status opened this issue Oct 5, 2023 · 7 comments
Closed
4 tasks done
Tracked by #57

feat: add new message_hash column to the archive protocol #2112

Ivansete-status opened this issue Oct 5, 2023 · 7 comments
Assignees
Labels
E:2.3: Basic distributed Store services See https://github.com/waku-org/pm/issues/64 for details

Comments

@Ivansete-status
Copy link
Collaborator

Ivansete-status commented Oct 5, 2023

Problem

We have the id column in sqlite and postgres databases that is not unique.

Suggested solution (defined by @jm-clius)

Create a unique field, message_hash, which will be computed following RFC: https://rfc.vac.dev/spec/14/#deterministic-message-hashing.
The message_hash will become the PRIMARY KEY.
This should also be how the CURSOR gets computed when doing a database lookup. So querying for the next page will become much simpler - find the PRIMARY KEY that matches the CURSOR and query from that point
Drop the current id field from the current databases schemas.

Acceptance criteria

  • The message_hash attribute should be present SQLite.
  • The message_hash attribute should be present Postgres.
  • The current id column should be ignored and removed from the database schema.
  • Store protocol behaves well and pagination works well.

Epic

waku-org/pm#57

CC: @chair28980 @fryorcraken

@Ivansete-status Ivansete-status added the E:2.3: Basic distributed Store services See https://github.com/waku-org/pm/issues/64 for details label Oct 5, 2023
@Ivansete-status Ivansete-status moved this to In Progress in Waku Oct 5, 2023
@ABresting
Copy link
Contributor

achieved

  • worked on the current issue-related PRs this week, launched initial PR already, others lined up.
  • finalized all remaining tasks associated with the retention policy, including infra-testing.

next

  • (short-term) aim to finalize the current issue by the end of next week.
  • (long-term) continuing focus on developing the sync mechanism for archive clients.

blocker

  • NA.

@ABresting
Copy link
Contributor

achieved

  • worked on the current issue-related PRs this week, and refactored PRs based on components.
  • worked on pagination in the light of new attribute

next

  • PRs are lined up but linearly dependent so one at a time
  • migration of new attribute

blocking

  • not exactly blocking but awaiting reviews.

@ABresting
Copy link
Contributor

ABresting commented Oct 27, 2023

Weekly Update

  • achieved: On SQLite's schema transition (i.e. this PR) to messageHash feature complete PR posted (awaiting reviews), Gained insight into the connection and interplay between the store and archive components, and how they may be leveraged into making a sync protocol. Small stuff - bug fix on the jsWaku which was this PR dependent (that too was time-consuming since my first time interacting with JS code of waku), PR on vacuum on time-based retention policy, thought through the nitty gritty details of node based roles and incentives.

  • next:

    • The sync protocol formulation totally based on the messages sync without any external factors into POV
    • Review PostgreSQL PRs by Ivan to gain more knowledge on the storage/archive feature.

@ABresting
Copy link
Contributor

Weekly Update

  • achieved: PR to support SQLite code to support messageHash attribute without interrupting the existing cursor-related functionality, id field stays for now. Skelton for sync in progress.

  • next:

    • finalize the SQLite messageHash attribute and add a research page about it.
    • start a research page about the sync mechanism for nWaku, doing request/reply a PoC on the same.

@ABresting
Copy link
Contributor

Weekly Update

  • achieved: PRs and research issues related to messageHash and vacuum, pending code reviews.

  • next:

    • finalizing the sync documents ranging from basic sync communication to sync databases.

@ABresting
Copy link
Contributor

ABresting commented Nov 26, 2023

Weekly Update

  • achieved: PRs on various issues and advanced research on Prolly trees use cases for Wakunode, investigated how Gossiplog sits outside of our priorities now.

  • next: solidify the Prolly trees approach for sync based on different criteria/filters, fix some database code issues/feat.

@ABresting
Copy link
Contributor

closing this issue since all tasks seem to be done now.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Waku Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E:2.3: Basic distributed Store services See https://github.com/waku-org/pm/issues/64 for details
Projects
Archived in project
Development

No branches or pull requests

2 participants