Merge branch 'refactor-node' into refactor-node-next

Forward-merge the state-carrier collapse (connection start/activity timestamps,
peer-identity telemetry, handshake resend buffers, index/transport bookkeeping,
and the session-index shadow all moved onto the peer machine's own connection
state) onto the XX handshake.

Next-specific resolutions folded into the merge: the responder learns its transport
id and peer index at msg1 and they are written directly onto the machine there (the
XX machine has no msg1 step, so the promote read would otherwise be unset); the
negotiated peer profile is mirrored onto the machine carrier at both the initiator
(msg2) and responder (msg3) negotiation sites; and the outbound carrier writes land
on both the identified and anonymous dial paths. The leg's transport/index/buffer
copies remain as dead duplicates until the leg dissolves; the machine copy is the
sole live source.
This commit is contained in:
Johnathan Corgan
2026-07-18 18:24:44 +00:00
10 changed files with 403 additions and 174 deletions
+3 -3
View File
@@ -1321,12 +1321,12 @@ pub fn show_connections(node: &Node) -> Value {
"link_id": conn.link_id().as_u64(),
"direction": format!("{}", conn.direction()),
"handshake_state": node.connection_handshake_state(conn.link_id()),
"started_at_ms": conn.started_at(),
"idle_ms": now.saturating_sub(conn.last_activity()),
"started_at_ms": node.connection_started_at(conn.link_id()),
"idle_ms": now.saturating_sub(node.connection_last_activity(conn.link_id())),
"resend_count": node.connection_resend_count(conn.link_id()),
});
if let Some(identity) = conn.expected_identity() {
if let Some(identity) = node.connection_expected_identity(conn.link_id()) {
conn_json["expected_peer"] = json!(identity.npub());
}