Intersubjective / rapprochement

Sync engine for peer-to-peer networks
0 stars 0 forks source link

Roadmap / design #1

Open ichorid opened 2 months ago

ichorid commented 2 months ago

The Rapprochement protocol is the networked version of MeritRank. The first application is an experimental network of peers that measures round-trip times to other peers and connects to those with the best uptimes and lowest RTT.

RTT service architecture

The architecture of this service will become the blueprint for other services (NAT puncturing, P2P data storage, etc.) that we will build later. The service should be embeddable at mobile platforms, so it should be written in Rust, sans-io style.

Networking layer

Rapprochement-RTT ("RT2") will use the Iroh networking library for peer-to-peer connections.

Persistent storage

RocksDB or some other high-performance embeddable key-value storage

MeritRank

We will use our MeritRank Rust library. This will require extracting some functions from MeritRank-service-rust to support asynchronous execution, etc.

Signatures and peer identification

Hosts are identified by public keys. Every key-value-version tuple is signed by the host that created it. This enables 3rd-party-based replication and state dissemination

Key-value reconciliation

RIBLT protocol. Note that reconciling versioned key-value pairs will sometimes require exchanging duplicates. Peers will exchange versioned and signed edges of the "opinions" graph.

Every peer exchanges all the key-value-version tuples with its peers.

Connectivity logic

(Eventually, we should implement a more sophisticated algorithm for decentralized peer shuffle for the stochastic part, e.g. PeerSwap)

Peer exchange

Periodically, a node asks its current peers to "introduce" it to other random peers from the pool (public key + IP + port).

Simulation

The initial version should be developed sans io and provide Python bindings so we can run simulations in Jupyter Notebook

p2panda_task1-Copy of Page-1 drawio

grimadas commented 2 months ago

Main idea of `rapprochement':

We start with the simplest primitives and see if we need more. Ideally we would like to see a very simple and clean API.

Stage 1: Key-value Synchronisation

Use-case: Distribute the MeritRank scores in the network. Each score is a tuple: (key, value, version).

The goal is to eventually synchronise the Key-Value Database between peers, and benchmark what approach is best with bandwidth/throughput, latency (convergence), latency (average specific edge update).

Design Hypothesis 1.

Use modified RIBLT to support key-value-version.

Baseline solution: