You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phase 2 gives every substrate node a cluster of attached transient nodes. Attachment selection lets transient nodes find better substrate nodes over time — closer, same enclave, less loaded.
This only applies to transient nodes. Substrate nodes don't have attachments to optimize — they're the mesh. They gossip with each other over HTTP and accept WebSocket attachments. Attachment selection is a transient-node optimization: "which substrate node am I attached to, and is there a better one?"
With the substrate/transient model, this is simpler than tree-based parent selection would be. There's no tree depth to optimize, no subtree reorganization, no cascading rebalancing. A transient node just evaluates available substrate nodes and swaps if one is meaningfully better.
Task
Scoring algorithm:
A transient node scores potential substrate attachments on three weighted factors (priority order):
Enclave match (highest weight): same enclave substrate node means data flows directly without cross-enclave hops. Also means the substrate node's own store counts as a quorum vote — first ACK is instant.
Latency: measured via topology response time and periodic probes
Capacity: prefer substrate nodes with fewer attached transient nodes (attachment count included in topology)
Exact weights TBD empirically, but the priority order is fixed.
Periodic reassessment:
Every REPRAM_REATTACH_INTERVAL (default 300s), evaluate known topology for better substrate attachment
Compare best candidate score against current attachment score
Phase 3 — Discovery Protocol v2
Context
Phase 2 gives every substrate node a cluster of attached transient nodes. Attachment selection lets transient nodes find better substrate nodes over time — closer, same enclave, less loaded.
This only applies to transient nodes. Substrate nodes don't have attachments to optimize — they're the mesh. They gossip with each other over HTTP and accept WebSocket attachments. Attachment selection is a transient-node optimization: "which substrate node am I attached to, and is there a better one?"
With the substrate/transient model, this is simpler than tree-based parent selection would be. There's no tree depth to optimize, no subtree reorganization, no cascading rebalancing. A transient node just evaluates available substrate nodes and swaps if one is meaningfully better.
Task
Scoring algorithm:
A transient node scores potential substrate attachments on three weighted factors (priority order):
Exact weights TBD empirically, but the priority order is fixed.
Periodic reassessment:
REPRAM_REATTACH_INTERVAL(default 300s), evaluate known topology for better substrate attachmentConfiguration:
REPRAM_REATTACH_INTERVAL300Acceptance Criteria
Depends on Phase 2 (#61-#66).
Part of Discovery Protocol v2 — see
docs/internal/REPRAM-Discovery-Protocol-v2.md