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

Add some supporting stuff for future plum trees #33

Closed
wants to merge 3 commits into from

Conversation

xash
Copy link
Contributor

@xash xash commented Nov 19, 2024

  • some random WGPS IDs for now
  • store events forward those IDs
  • new store EventPayloadNoOp if a peer tried to give use a payload we already have (so we can set that peer to lazy in a plum tree later)
  • metadata to change eagerness
  • sendEntry to explicitly send an entry (and a test for that)

Currently, there is WGPS' this.reconcilerMap which maps intersections (based on the peers' aoi handles) to a Reconciler. isEager could be squeezed in there, renaming the map to intersectionMap or something, which hosts both the Reconciler and isEager. Not sure what's cleaner: keeping them together under one Intersection, or have them separated because they don't actually share anything. Also in pre-willow earthstar it seems the live syncing was done after reconciliation. However, I think it needs to be done at the same time, for the case when an entry gets inserted during reconciliation.

Down the road we also need an efficient way of finding intersections based on an entry's position for the requested eagerness.

For the plum tree manager I thought of the following architecture: a plum tree manager that the user adds WGPS to. WGPS dispatches 'intersection' events. For each intersection the manager either creates a new plum tree or gets a running one. This plum tree listens to the intersection.namespace's store for PayloadEvents, and forwards entries/changes eagerness with the API of this PR. So the WGPS doesn't need to know about PlumtreeManager and can run without one.

Any oversights/things I should change? :-)

xash added 2 commits November 19, 2024 02:10
So it can be used in the future by both DataSendEntry and ReconciliationSendEntry.
@xash
Copy link
Contributor Author

xash commented Nov 19, 2024

Thanks to the failing tests there is still a concurrency bug with currentlyReceivedEntry and delayed handling of SendEntrys/SendPayload

Fix race condition where decoder sets received entry/payload while data channel lags behind.
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