From 41fd367bff0567fb3f6c09a435acae19416d5904 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Mon, 16 Dec 2019 22:57:11 -0800 Subject: [PATCH] ames: make routing simpler --- pkg/arvo/app/ping.hoon | 6 +++++- pkg/arvo/sys/vane/ames.hoon | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/app/ping.hoon b/pkg/arvo/app/ping.hoon index 8a5da84ba..6be1dddde 100644 --- a/pkg/arvo/app/ping.hoon +++ b/pkg/arvo/app/ping.hoon @@ -41,7 +41,11 @@ ?. ?=(%poking -.ship-state.u.s) %- (slog leaf+"ping: strange state {}" ~) `state - =/ until (add ~m5 now) + :: NAT timeouts are often pretty short for UDP entries. 5 + :: minutes is a common value. We use 30 seconds, which is fairly + :: aggressive, but should be safe. + :: + =/ until (add ~s30 now) =. ships.state (~(put by ships.state) ship u.s(ship-state [%waiting until])) :_ state diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index ee85ca10a..e5766754f 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -1886,6 +1886,20 @@ :: =/ =peer-state +.u.ship-state :: + :: XX routing hack to mimic old ames. + :: + :: Before removing this, consider: moons when their planet is + :: behind a NAT; a planet receiving initial acknowledgment + :: from a star; a planet talking to another planet under + :: another galaxy. + :: + ?: ?| =(our ship) + ?& !=(final-ship ship) + !=(%czar (clan:title ship)) + == + == + (try-next-sponsor sponsor.peer-state) + :: ?: =(our ship) :: if forwarding, don't send to sponsor to avoid loops ::