refactors %ames packet acceptance, drops fewer packets
++ chew :: chew:la:ho:um:am
|= [sin=skin msg=@] :: receive
^+ +>
- =< apse
+ =< abed
|%
- ++ apse
+ :: +abed: check that we have the keys to communicate with :her
+ ::
+ ++ abed
^+ +>.$
- :: bos: our sponsor
+ :: if we don't have a deed, subscribe for public key updates
::
- =/ bos (sein our)
- :: seg: her sponsor
+ :: XX update state so we only ask once?
::
- =/ seg (sein her)
- :: rac: her rank
+ =? +>.$ ?=(~ lew.wod.dur.diz)
+ (emit %beer her)
+ :: if we don't have a deed, scry for it
+ :: (to avoid dropping the packet, if possible).
::
- =/ rac (clan:title her)
- :: request keys and continue processing packet if
- :: :her is our initial sponsor (TOFU)
+ =? lew.wod.dur.diz ?=(~ lew.wod.dur.diz)
+ :: we could get the life from the packet if %open
+ :: for now, we guess 1 for the life
+ :: XX revise
::
- :: XX update state so we only ask once?
+ (deed her 1)
+ :: if we have a deed, proceed
::
- =? +>.$ &(=(~ lew.wod.dur.diz) =(her bos))
- (emit %beer her)
- :: request keys and drop packet if :her is (or is a moon of)
- :: an unfamilar on-chain ship (and not our sponsor)
- ::
- ?: ?& =(~ lew.wod.dur.diz)
- !=(her bos)
- ?| !?=(?(%earl %pawn) rac)
- ?& ?=(%earl rac)
- =/ fod (~(get by hoc.ton.fox) seg)
- ?| ?=(~ fod)
- ?=(~ lew.wod.u.fod)
- == == == ==
- (emit %beer ?:(?=(%earl rac) seg her))
+ ?^ lew.wod.dur.diz
+ apse
+ :: if :her is our initial sponsor, proceed (TOFU)
+ ::
+ :: XX TOFU is unnecessary if we include keys
+ :: for the full sponsorship chain in the boot event
+ ::
+ ?: =(her (sein our))
+ apse
+ :: if :her is a comet, or a moon of a known ship, proceed
+ ::
+ =/ =rank:title (clan:title her)
+ ?: ?| ?=(%pawn rank)
+ ?& ?=(%earl rank)
+ !=(~ lew.wod.dur:(myx:gus (sein her)))
+ == ==
+ apse
+ :: otherwise, drop the packet
+ ::
+ +>.$
+ :: +apse: process the packet, notify if :her status changed
+ ::
+ ++ apse
+ ^+ +>.$
=/ oub bust:puz
=/ neg =(~ yed.caq.dur.diz)
=. +>.$ east
