Skip to content

Instantly share code, notes, and snippets.

@tinnus-napbus
Created May 29, 2026 06:01
Show Gist options
  • Select an option

  • Save tinnus-napbus/ec380f0a1a0276dd8c4e0eb011cd08e0 to your computer and use it in GitHub Desktop.

Select an option

Save tinnus-napbus/ec380f0a1a0276dd8c4e0eb011cd08e0 to your computer and use it in GitHub Desktop.
Groundwire sponsor resolution quirks

When Ames wants to add a new peer, it determines its sponsor like so:

=.  sponsor.peer
  ?^  sponsor.point
    u.sponsor.point
(^^sein:title rof /ames our now ship)

When it does +make-lane, if no explicit lane is known and an immediate sponsor is set, it does the fullowing to get the top-level sponsor:

    ++  get-sponsor
      |=  =ship
      ^-  (unit @ux)
      =/  sax
        (rof [~ ~] /sax %j `beam`[[our %saxo %da now] /(scot %p ship)])
      ?.  ?=([~ ~ *] sax)
        ~  :: XX log
      =/  gal  (rear ;;((list ^ship) q.q.u.u.sax))  :: XX only galaxy
      ?:  =(our gal)
        ~  :: XX log
      [~ `@ux`gal]

Basically just %saxo scry and look at the end of the list. A %saxo scry to Jael goes like so:

  ::                                                    ::  ++saxo:of
  ++  saxo                                              ::  sponsorship chain
    |=  who=ship
    ^-  (list ship)
    =/  dad  (sein who)
    [who ?:(=(who dad) ~ $(who dad))]

Notice it just recursively calls +sein:of, which looks like so:

  ++  sein                                              ::  sponsor
    |=  who=ship
    ^-  ship
    ::  XX save %dawn sponsor in .own.sub, check there
    ::
    =/  pot  (~(get by pos.zim.pki) who)
    ?:  ?&  ?=(^ pot)
            ?=(^ sponsor.u.pot)
        ==
      u.sponsor.u.pot
    (^sein:title who)

So Ames basically always hits Jael's +sein:of when figuring out a sponsor. If you look at +sein:of, you'll notice its logic is basically "get the sponsor from the +point:jael in state. If we don't have a +point or we do but the sponsor's not set, call (^sein:title who) instead. The (^sein:title who) call is default sponsorship inference, it purely looks at the +end of the @p:

      ++  sein                                          ::  autoboss
        |=  who=ship
        ^-  ship
        =/  mir  (clan who)
        ?-  mir
          %czar  who
          %king  (end 3 who)
          %duke  (end 4 who)
          %earl  (end 5 who)
          %pawn  (end 4 who)
        ==

This logic is reasonable for Azimuth ships but for Groundwire ships, it means an unset sponsor in the +point:jael in Jael will always resolve to a galaxy, and so you'll try to route via ~tyr to ~watwyd-bannyt-parmep-sivpes--motweb-dovfet-nilrec-daplyd if its sponsor is ~.

This is why it's essential that a Groundwire comet's sponsor be set to itself if it's an unsponsored lamp-level ship with a fief, or else to its Groundwire lamp-level sponsor comet. It should never, under any circumstances, end up with a null sponsor in Jael.

We must either make sure the ordinal TXs always explicitly set a sponsor (even if it's self), or else we must ensure %urb-watcher sets sponsor to self if there's not one explicitly set on-chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment