From 3c6364644a32c97170c2389aafd9e6d27c192923 Mon Sep 17 00:00:00 2001 From: lunar-mining Date: Mon, 18 Dec 2023 12:41:27 +0100 Subject: [PATCH] doc: p2p-network.md hostlisets upgrade status update --- doc/src/arch/p2p-network.md | 46 +++++++++++++++---------------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/doc/src/arch/p2p-network.md b/doc/src/arch/p2p-network.md index 4882a4875446..2fdb8a55c350 100644 --- a/doc/src/arch/p2p-network.md +++ b/doc/src/arch/p2p-network.md @@ -135,8 +135,8 @@ Possibly a post-mainnet feature depending on the scale of architectural changes ### Monero p2p recap -In Monero, each node maintains a peer list consisting of two parts, -a whitelist and a greylist. White/ greylists contain a `last_seen` +In Monero, each node maintains a host list consisting of two parts, +a whitelist and a greylist. Host lists contain a `last_seen` data field, a timestamp of the last time the peer was interacted with. The lists are ordered chronologically according to `last_seen`, with the @@ -177,38 +177,28 @@ least two anchor nodes. * Refactor `src/hosts.rs` to store two `Vec<(Url, u64)>` instead of single `Hashset`, replacing the host list and its associated methods with -a whitelist and a greylist. [STATUS: COMPLETE/ TESTING] - -* Create a `GreylistRefinery` protocol in `OutboundSession` (renamed from -Monero's "greylist housekeeping" for succinctness) that periodically -selects random peers from its greylist and pings them. If a peer is -responsive, update the `last_seen` field and add it to the whitelist, -otherwise remove it from the greylist. [STATUS: COMPLETE/ TESTING] - -* `lilith` currently checks connections on the host list using a method -called `periodic_purge` that gets hosts from the host list, copies them to -a local ring buffer, and periodically handshakes the connections. If the -handshake fails, `lilith` removes the host from the hostlist. This protocol -has been replaced by a method called `whitelist_cleansing`. Like the -prior method, `whitelist_cleansing` pulls connections from the whitelist, -copies them to a ring buffer and handshakes them periodically. If they -respond, the `last_seen` is updated, otherwise nothing happens. This is -loosely based on Monero's `IDLE_HANDSHAKE` protocol. [STATUS: COMPLETE/ -REEVALUATE/ TESTING] - -* `ProtocolAddress`: On receiving an address, append it to the greylist. On -receiving `get_addr`, fetch an address from the whitelist. [STATUS: COMPLETE/ -TESTING]. +a whitelist and a greylist. [STATUS: COMPLETE] + +* Create a `GreylistRefinery` protocol (renamed from Monero's "greylist +housekeeping" for succinctness) that periodically selects random peers +from its greylist and pings them. If a peer is responsive, update the +`last_seen` field and add it to the whitelist, otherwise remove it from +the greylist. [STATUS: COMPLETE] + +* `ProtocolAddress`: On receiving an address, append it to the +greylist. On receiving `get_addr`, fetch an address from the +whitelist. [STATUS: COMPLETE]. * `SeedSyncSession`: on receiving whitelisted peers, append them to -greylist. [STATUS: INCOMPLETE/ FIXME] +greylist. [STATUS: COMPLETE] * `ProtocolSeed`: Send our address to the seed node, and on receiving -addresses, append them to the whitelist. [STATUS: INCOMPLETE/ FIXME] +addresses, append them to the whitelist. [STATUS: COMPLETE] * Create a new list in `hosts.rs` called `anchorlist`. `OutboundSession` first tries to connect to address in the `anchorlist` on `start()`. [STATUS: TODO] -* Potentially create a new Protocol to send the top 250 nodes from the -whitelist (Monero `SYN` exchange). [STATUS: TODO/ EVALUATE] +* Call ping_node() on idle connections. If they do not respond, drop the +associated connection and select a new peer from the whitelist. [STATUS: +TODO]