Conversation
…us, bridge mux
Relax the ANCHOR binding's address check under explicit publisher
regimes per SWIP-60 (the SOC id does no protocol work there; legitimacy
is list membership), add the FEED_TOPIC binding with FeedID derivation
(keccak256(topic || 8-byte BE index), dedup on chunk address), expose
per-topic Status() introspection, and add the Bridge: a per-topic mux
sharing one p2p session among N local sinks with role upgrade, slow-sink
drop and full teardown ownership. Also fixes a slice-sizing data race in
Status() and documents the revised subscriber trust caveat.
feat(api): pubsub websocket bridge
Add GET /pubsub/{topic} (WebSocket session on a topic: cohort
parameters in the query make the session the opener, owner makes it a
publisher; swarm-keep-alive, swarm-soc-fields and
swarm-cache-wrapped-chunk headers) and GET /pubsub (active topic
listing). Inbound frames are sig||span||payload (anchor, id = topic) or
index||sig||span||payload (feed, id = keccak256(topic || index)),
assembled and signature-authenticated node-side against the cohort spec
- the node holds no publisher keys. Includes SWIP-60 conformance
end-to-end tests: jam cohort, live feed stream with dedup, and
FULL-refusal with a wire-level Hello/Ack-only assertion.
feat(node): wire bps service and bridge
Construct the bps service and bridge in the node bootstrap, register
the broker protocol on full nodes only, expose the bridge to the API,
register metrics, close on shutdown, and add the pubsub-capacity flag
(default 32) for the per-topic broker stream limit.
docs(openapi): document pubsub endpoints
Add /pubsub and /pubsub/{topic} to the Swarm API spec (8.1.0 -> 8.2.0)
with the cohort query parameters, the swarm-keep-alive, swarm-soc-fields
and swarm-cache-wrapped-chunk headers, publish frame formats, and the
subscriber trust caveat.
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.
Initial pubsub implementation draft
Checklist
Description
Open API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
Screenshots (if appropriate):
AI Disclosure