-
Notifications
You must be signed in to change notification settings - Fork 165
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
feat(iroh-net)!: remove fs based peers storage #2510
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle I like this.
The important part is getting back the saving functionality that used to be in iroh-net.
Ideally we bring back the same "save on tick" functionality where the peer map is saved.
Perhaps we can even save it in redb instead? That could be nicer for something that may be a little more corruption resistant.
iroh-net/src/endpoint.rs
Outdated
@@ -771,6 +767,11 @@ impl Endpoint { | |||
self.msock.conn_type_stream(node_id) | |||
} | |||
|
|||
/// Get the known node addresses which should be persisted. | |||
pub fn node_addresses_for_storage(&self) -> Vec<NodeAddr> { | |||
self.msock.node_addresses_for_storage() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This information can already be constructed from the Endpoint::connection_infos
response. Maybe it makes more sense to add a From<ConnectionInfo> for NodeAddr
impl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is the same. The previous code saved only the verified paths of used nodes and all paths of unverified nodes. Now, as far as i can tell, we will store again paths not active/used for nodes with known verified paths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@divagant-martian should be fixed, the filtering is happening now at the node layer
This sounds like |
I implemented a timer based version of storage again, which I think works well enough for now |
396623f
to
7a4293c
Compare
lgtm i think |
38200be
to
43fdcac
Compare
2d4d789
to
19be4ef
Compare
Instead introduces - `endpoint::Builder::known_nodes` to provide existing `NodeAddr`s - `endpoint::Endpoint::node_addresses_for_storage` to retrieve the current list of known nodes that can be persisted
0655523
to
65ef47a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 lgtm
@@ -1478,6 +1465,8 @@ pub struct DirectAddrInfo { | |||
pub last_control: Option<(Duration, ControlMsg)>, | |||
/// How long ago was the last payload message for this node. | |||
pub last_payload: Option<Duration>, | |||
/// When was this connection last alive, if ever. | |||
pub last_alive: Option<Duration>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be redundant, tldr this is the max between the two above. But it's harmless anyway
Description
Instead introduces
endpoint::Builder::known_nodes
to provide existingNodeAddr
sendpoint::Endpoint::connection_infos
to retrieve the current list of known nodes that can be persistedNotes
prune_inactive
is not called anymore when storing, only on the heartbeat, and so there is a chance of storing uninteresting addressesBreaking Changes
endpoint::Builder::peers_path
is removediroh-net
TODO
iroh