Skip to content

Implement a suitable mechanism to refresh distance vector timestamps #9522

Open
@saketh-are

Description

@saketh-are

Signed edges include a timestamp indicating when they were signed. Edges expire after some time (default 30 min) and need to be periodically refreshed.

We currently have a request/response mechanism to refresh edge nonces:

// Refresh connection nonces but only if we're outbound. For inbound connection, the other party should
// take care of nonce refresh.
if act.peer_type == PeerType::Outbound {
ctx.spawn(wrap_future({
let conn = conn.clone();
let network_state = act.network_state.clone();
let clock = act.clock.clone();
// How often should we refresh a nonce from a peer.
// It should be smaller than PRUNE_EDGES_AFTER.
let mut interval = time::Interval::new(start_time + PRUNE_EDGES_AFTER / 3, PRUNE_EDGES_AFTER / 3);
async move {
loop {
interval.tick(&clock).await;
conn.send_message(Arc::new(
PeerMessage::RequestUpdateNonce(PartialEdgeInfo::new(
&network_state.config.node_id(),
&conn.peer_info.id,
Edge::create_fresh_nonce(&clock),
&network_state.config.node_key,
)
)));
}
}
}));
}

This mechanism is sufficient for our old (V1) routing protocol, in which the basic unit of information shared is a single edge.

In the V2 routing protocol, the basic unit of information is a spanning tree of edges. Trees are expired when the oldest timestamp among their constituent edges reaches expiry, but updated trees are currently shared only in response to network events. No time-based mechanism exists to request/respond updated distance vectors.

As we deprecate the V1 protocol, we should think carefully about how the V2 protocol interacts with edge timestamps and rework things accordingly.

Metadata

Metadata

Assignees

Labels

A-networkArea: NetworkT-coreTeam: issues relevant to the core team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions