libp2p / libp2p/research-pubsub

Last Value Cache

Open
#12 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
73
Forks
5
PR merge metrics
No merged PRs in 30d

Description

In the search for a solution to Orbits problem of how to know about the current state of a chat when joining, we had the idea of adding a last value cache to the floodsub implementation.

> This [last value caching] solves the problem of how a new subscriber catches up when it joins the network. The theory is that publishers get notified when a new subscriber joins and subscribes to some specific topics. The publisher can then rebroadcast the last message for those topics.
>
> From http://zguide.zeromq.org/php:chapter5#Last-Value-Caching

I have an experimental implementation for js up here: https://github.com/libp2p/js-libp2p-floodsub/pull/32 which caches the last known message for all known topics currently. This definitely needs some refinements, to avoid things like unlimited memory usage.

My first tests with orbit showed that this does solve the issue of message loading on join, without any changes to the codebase.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the experimental JavaScript implementation in libp2p/js-libp2p-floodsub PR #32 and the floodsub behavior described here. Determine how publishers learn about new subscribers and how the last message is cached per topic. Done means new subscribers receive the latest topic message without unbounded memory usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.