ames: don't retrieve ship-state in +send-blob

This commit is contained in:
yosoyubik 2023-05-22 11:41:32 +02:00
parent b427f1c321
commit 66b92800e3

View File

@ -1903,7 +1903,7 @@
`p.lane
::
=/ =blob (etch-shot shot)
(send-blob & rcvr.shot blob)
(send-blob for=& rcvr.shot blob (~(get by peers.ames-state) rcvr.shot))
:: +on-hear-keys: handle receipt of attestion request
::
++ on-hear-keys
@ -1913,7 +1913,8 @@
|.("requested attestation")
?. =(%pawn (clan:title our))
event-core
(send-blob | sndr.shot (attestation-packet sndr.shot 1))
=/ =blob (attestation-packet sndr.shot 1)
(send-blob for=| sndr.shot blob (~(get by peers.ames-state) sndr.shot))
:: +on-hear-open: handle receipt of plaintext comet self-attestation
::
++ on-hear-open
@ -2436,7 +2437,8 @@
:: if we're a comet, send self-attestation packet first
::
=? event-core =(%pawn (clan:title our))
(send-blob | ship (attestation-packet ship life.point))
=/ =blob (attestation-packet ship life.point)
(send-blob for=| ship blob (~(get by peers.ames-state) ship))
:: save current duct
::
=/ original-duct duct
@ -2459,7 +2461,7 @@
=. event-core
%+ roll ~(tap in packets.todos)
|= [=blob core=_event-core]
(send-blob:core | ship blob)
(send-blob:core for=| ship blob (~(get by peers.ames-state) ship))
:: apply remote scry requests
::
=. event-core (meet-alien-fine keens.todos)
@ -2633,7 +2635,9 @@
|= =ship
^+ event-core
=+ (ev-trace msg.veb ship |.("requesting attestion"))
=. event-core (send-blob | ship (sendkeys-packet ship))
=. event-core
=/ =blob (sendkeys-packet ship)
(send-blob for=| ship blob (~(get by peers.ames-state) ship))
=/ =wire /alien/(scot %p ship)
(emit duct %pass wire %b %wait (add now ~s30))
:: +send-blob: fire packet at .ship and maybe sponsors
@ -2646,15 +2650,12 @@
::
++ send-blob
~/ %send-blob
|= [for=? =ship =blob]
|= [for=? =ship =blob ship-state=(unit ship-state)]
::
=/ final-ship ship
%- (ev-trace rot.veb final-ship |.("send-blob: to {<ship>}"))
|-
|^ ^+ event-core
::
=/ ship-state (~(get by peers.ames-state) ship)
::
?. ?=([~ %known *] ship-state)
?: ?=(%pawn (clan:title ship))
(try-next-sponsor (^sein:title ship))
@ -2901,10 +2902,6 @@
:: expire direct route if the peer is not responding
::
=. peer-state (update-peer-route her peer-state)
:: required so that the following +send-blob's (including
:: inside +call:mu), access up-to-date peer state
::
=. event-core abet
:: resend comet attestation packet if first message times out
::
:: The attestation packet doesn't get acked, so if we tried to
@ -2918,7 +2915,8 @@
?& ?=(%pawn (clan:title our))
=(1 current:(~(got by snd.peer-state) bone))
==
(send-blob | her (attestation-packet [her her-life]:channel))
=/ =blob (attestation-packet [her her-life]:channel)
(send-blob for=| her blob `known/peer-state)
?: (is-corked bone)
:: no-op if the bone (or, if a naxplanation, the reference bone)
:: was corked, because the flow doesn't exist anymore
@ -3046,13 +3044,16 @@
:: here.
::
=. event-core
%^ send-blob | her
%- etch-shot
%: etch-shut-packet
shut-packet(bone (mix 1 bone.shut-packet))
symmetric-key.channel
our her
our-life.channel her-life.channel
%: send-blob for=| her
%- etch-shot
%: etch-shut-packet
shut-packet(bone (mix 1 bone.shut-packet))
symmetric-key.channel
our her
our-life.channel her-life.channel
==
::
ship-state=`known/peer-state
==
peer-core
:: +recork-one: re-send the next %cork to the peer
@ -4161,7 +4162,8 @@
|=(frag=@ud `hoot``@`(etch-shot (make-shot %0 fi-full-path frag)))
::
++ fi-send
|=(=blob fine(event-core (send-blob for=| her blob)))
|= =blob
fine(event-core (send-blob for=| her blob `known/peer-state))
::
++ fi-give-tune
|= dat=(unit roar)
@ -4373,10 +4375,6 @@
last-sent.u.want now
==
=. wan.keen (put:fi-mop wan.keen [fra .]:u.want)
:: required so that the following +send-blob in
:: +fi-send access up-to-date peer state
::
=. event-core abet
(fi-send `@ux`hoot.u.want)
--
:: +ga: constructor for |pump-gauge congestion control core