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

packages/gossiplog - add branches to gossiplog #303

Merged
merged 17 commits into from
Jun 24, 2024

Conversation

rjwebb
Copy link
Contributor

@rjwebb rjwebb commented Jun 18, 2024

This is part of #206

This PR adds a branch value to GossipLog which lets us implement a more efficient version of isAncestor by allowing us to traverse the causal log's branches instead of visiting each message one at a time.

To do:

  • Add a child index, this is the inverse of AncestorIndex
  • When a message is applied in the GossipLog, compute the "branch" based on its parent messages
  • Update a table of where branches merge into each other ("branch merges")

How has this been tested?

Unit tests

Branch values:

  • For a sequential chain of messages assert that the branch value is 0
  • For a set of unconnected messages (i.e. none of them share a parent) assert that the branch values are all different
  • For branching and merging messages test a variety of scenarios

Branch merges:

  • Add assertions to the branch values tests but for the branch merges table as well

Regressions:

  • CI tests pass
  • Tested with example-chat (including login, all signers, and exchanging messages)
  • Tested with @canvas-js/test-network: (optional)

Does this contain any breaking changes to external interfaces?

  • Contract interfaces
  • Core interface
  • CLI
  • Data storage formats, including IndexedDB, SQLite, or filesystem storage (will this break existing apps?)

@rjwebb rjwebb marked this pull request as ready for review June 19, 2024 15:38
@joeltg joeltg merged commit a4257f1 into main Jun 24, 2024
3 checks passed
@rjwebb rjwebb deleted the rjwebb/add-child-index-and-branches-to-gossiplog branch June 24, 2024 15:35
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.

None yet

2 participants