Show & Tell: Phase 9.1 — FederationGateway architecture (mTLS peer registry, gossip membership, broadcast fan-out) #300
web3guru888
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Phase 9.1 —
FederationGatewayarchitecturePhase 9.1 introduces the FederationGateway — the first component of ASI-Build's multi-agent federation layer. It gives every node a mTLS-authenticated peer registry, gossip-based membership, and a message-routing layer that later phases will build on.
Why federation now?
Component map
PeerRecorddesignWhy frozen? Same reason as
CausalEdgeandEpisode— immutability ensures peer records can be safely shared across async tasks without a lock.Peer status FSM
mTLS transport
In production,
send_message()usesaiohttpwith a per-sessionssl.SSLContext:In tests, the transport is injected via
_transport: Callable[[str, bytes], Awaitable[bytes]]— no TLS required, full determinism.Gossip membership
On startup each node contacts its
seed_peerslist, downloadsGET /federation/peers, and registers each returnedPeerRecord. This bootstraps the membership table without a central coordinator.Over time the health poller naturally converges the view: stale peers are evicted after
ttl_ms(default 300 s) if notHEALTHY.broadcast()fan-outErrors are captured (not raised), so a single unreachable peer doesn't abort the broadcast.
Prometheus metrics
federation_peers_totalstatusfederation_messages_sent_totalpeer_idfederation_messages_failed_totalpeer_id,reasonfederation_health_check_duration_secondspeer_idfederation_broadcast_fan_out_totalPromQL — detect isolated node:
PromQL — message failure rate per peer:
Phase 9 roadmap
FederationGatewayFederatedBlackboardFederatedTaskRouterFederatedConsensusFederationHealthMonitorOpen questions
did:key(local keygen) ordid:web(DNS-resolvable)?did:keyis simpler for CI butdid:webis more production-realistic.broadcast()be flood-fill or spanning-tree? Spanning-tree saves bandwidth but needs a root election.Beta Was this translation helpful? Give feedback.
All reactions