Skip to content

Commit ce89df2

Browse files
committed
feat(daemon): auto-handshake toward trusted agents on outbound dial
When DialConnectionContext targets a node in the trusted-agents list and no local trust entry exists, a handshake request is fired in a background goroutine. The SYN-retry loop succeeds once the peer approves, removing the need to run pilotctl handshake before ping or send-message.
1 parent 19879dc commit ce89df2

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ Detailed per-release notes for tagged versions are published on the
3333
binaries triggered Gatekeeper "killed: 9" / "cannot be opened
3434
because Apple cannot check it for malicious software" on first run.
3535

36+
## [1.9.2] - 2026-05-06
37+
38+
### Added
39+
- **Auto-handshake toward trusted agents.** Dialing a known trusted agent
40+
(pilotprotocol.network service fleet) now automatically initiates a
41+
handshake in the background if no local trust entry exists. The SYN-retry
42+
loop succeeds once the peer approves — no manual `pilotctl handshake`
43+
required before `pilotctl ping` or `pilotctl send-message`.
44+
3645
## [1.9.1] - 2026-05-05
3746

3847
Stable release rolling up rc1–rc5. Headline themes: cold-start latency

pkg/daemon/daemon.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,6 +2439,16 @@ func (d *Daemon) dialConnectionLocked(ctx context.Context, dstAddr protocol.Addr
24392439
return nil, err
24402440
}
24412441

2442+
// Auto-initiate handshake toward known trusted agents when we have no
2443+
// local trust entry yet. Scoped to the trusted-agents list so we don't
2444+
// spray handshakes at arbitrary peers. Fires non-blocking so the
2445+
// SYN-retry loop succeeds once the peer approves.
2446+
if !d.handshakes.IsTrusted(dstAddr.Node) {
2447+
if _, ok := trustedagents.IsTrusted(dstAddr.Node); ok {
2448+
go d.handshakes.SendRequest(dstAddr.Node, "")
2449+
}
2450+
}
2451+
24422452
localPort := d.ports.AllocEphemeralPort()
24432453
if localPort == 0 {
24442454
return nil, ErrEphemeralExhausted

0 commit comments

Comments
 (0)