Skip to content

Latest commit

 

History

History
107 lines (83 loc) · 4.13 KB

UIP-0111.md

File metadata and controls

107 lines (83 loc) · 4.13 KB
uip title description author status type category created
0111
Desk Publisher Switcher
Allow desk publishers to tell subscribers to switch to a new source for updates.
~tinnus-napbus
Last Call
Standards Track
Kernel
2023-07-28

Abstract

Allows app publishers to send a poke to all those subscribed for desk updates requesting they change the source of updates to a new ship/desk. Such requests are recorded in kiln's state, and the recipients can then approve or reject them. Upon approval, all existing syncs from the the old ship/desk will be changed to sync from the new ship/desk. This allows app publishers to more easily migrate the distribution ship.

Motivation

If you're currently distributing an app from ship A and want to change to ship B, you have to try and tell everyone to manually switch. Alternatively, you can push an update to your app that pokes kiln to perform this action in ++on-load. Both are inconvenient for the app publisher.

For example, the Foundation wants to consolidate app distribution to a star from the multiple ships that Foundation-developed apps are currently distributed from. Or, an app developer started off distributing apps from their personal ship or moon but want to switch to a star.

Specification

Three pokes are added to kiln:

  • %kiln-jump-propose: A publisher can propose a switch of update source for
  • subscribers of a desk. Kiln will scry Clay for %w %sing subs to let+1
  • for that desk, then send all those ships a %kiln-jump-ask poke, asking them
  • to switch.
  • %kiln-jump-ask: This is a request to switch update source from ship/desk A to ship/desk B. It can either come from the existing update source ship or from our. The request will be added to the new hop (map dock dock) in kiln's state, and can then be approved or rejected.
  • %kiln-jump-opt: Approve or reject a jump request. Upon approval, all syncs from the old ship/desk will be switched to the new ship/desk.

A /x/kiln/jumps scry endpoint is added to retrieve the map of pending source change requests. A %watch path of /jumps is also added to get updates of new requests & approvals/rejections. The data type returned by both is defined in /sur/hood.hoon:

::  $jump: changes to update source change requests
::      
+$  jump
  $%  [%all all=(map dock dock)]        :: pending requests
      [%add old=dock new=dock]          :: new request
      [%yea old=dock new=dock]          :: approved
      [%nay old=dock new=dock]          :: denied
  ==

A %kiln-jump mark is added for this with a json conversion method so front-ends can subscribe or scry for such requests and ask users to approve. The %kiln-jump-opt mark also has a conversion method from json so front-ends can approve/reject.

Four generators are also added:

  • |jump/propose: publisher can propose a source switch to subscribers
  • |jump/approve: subscribers can approve jump requests
  • |jump/reject: subscribers can deny jump requests
  • +jumps: list pending jump requests.

Rationale

Kiln indirectly handles subscriptions via Clay, so it's not possible to simply get a list of kiln subscribers. Scrying Clay for %w %sing subs to let+1 could theoretically capture subs that aren't from kiln, but that shouldn't be a problem because if those ships don't have kiln subs the poke just won't do anything.

Initial implemenation proposed automatically switching source upon request, but after discussion it was determined the user should have to approve the requests, hence the storage of requests in state & the approval/rejection process.

Backwards Compatibility

If ships are behind on OTAs and don't support the pokes, they just won't be switched, so it's no worse than the current situation. This would only be a problem after initial release, eventually all ships will catch up.

Reference Implementation

https://github.com/urbit/urbit/tree/desk-publisher-switcher

Security Considerations

The initial trust issue of automatically switching has been resolved by requiring approval.

Copyright

Copyright and related rights waived via CC0.