refactor: split routing authority - #665
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ARCH-13 intentionally replaces the broad guest-visible
Routingcapability during the alpha stage. The old interface androutinggraft are deleted outright. No compatibility adapter remains.The new authority surface has two independently grantable Cap'n Proto capabilities:
routing::Findergrants bounded provider discovery throughfindProviders.routing::Announcergrants authority to announce the Wetware host PeerID throughprovide.Pure canonical routing-key derivation is separate from object-capability authority. Guests can opt into
wetware:routing/key@0.1.0, whose host implementation derives CIDv1/raw/BLAKE3 routing keys.Authority and lifecycle
Finder applies the following host contract:
count == 0returns no peers and launches no query.min(count, 16)unique providers.SwarmCommandchannel.Announcer binds every provider assertion to the Wetware host PeerID and the granting Cell epoch. Duplicate claims from one owner are idempotent. Multiple epochs can own one CID. Final-owner teardown calls
stop_providingon both libp2p Kademlia behaviours, which removes the local source for future republication. Previously propagated remote records expire naturally.Breaking removals
This PR removes the broad
Routinginterface, theroutinggraft,Routing.hash, guest IPNS resolution and publication, persistent MFS authoring, caller-selected Kubo publication keys, and guest reprovide loops.Host Phase 3-IPNS resolution and publication remain unchanged. This PR does not add a guest publisher, resolver, content workspace, or compatibility layer.
Finder and Announcer use fresh interface IDs. Regression tests pin both IDs and prove that raw calls using the removed
RoutingID0xa7c3e8f1d4b29065are rejected by each new capability.First-party migration
routing-finderandrouting-announcergrafts.No convenience object recombines Finder and Announcer.
Validation
The following checks passed:
cargo fmt --all -- --checkcargo check --workspace --all-targetscargo clippy --workspace --all-targets -- -D warningscargo test --workspace --no-fail-fastgit diff --checkcargo test -p rpc routing::tests::legacy_routing_interface_id_is_rejected_by_new_capabilities --no-default-features -- --exactcargo test -p wetware-authority wire_type_id_tests::split_schema_type_ids_are_pinned_for_wire_compat -- --exactmake stdww initscaffold WASIP2 buildcargo package -p routing-key --allow-dirtyThe full workspace suite included RPC, provider lifecycle, authority confinement, Cell, Membrane, 13 PID0 end-to-end, and Kademlia/IPFS/IPNS interoperability tests. Kademlia integration used an isolated disposable Kubo instance, which was removed after validation.