DIST_OVER_MESH_GUIDE.md recommends direct QUIC for a LAN and requires the same realm; the code does neither #5

Open
opened 2026-12-01 09:27:34 +00:00 by uranus · 0 comments
Member

Purpose (docs defect): DIST_OVER_MESH_GUIDE.md says only what the macula_dist code does, so nobody plans a LAN setup or realm settings on behaviour that does not exist.

Found during the martha-ai/mcl-martha#1 research (Uranus, 2026-12-01), read at macula f8a467a0.

1. "Direct QUIC" for nodes on the same LAN, and for Mnesia (docs/guides/DIST_OVER_MESH_GUIDE.md:172, :176)

  • The guide recommends direct QUIC (-proto_dist macula) for "Nodes on same LAN" and for "Mnesia replication".
  • In code, direct mode cannot accept an inbound connection. src/macula_dist_system/macula_dist.erl:330-343 says "Direct-listener mode was never implemented end-to-end (the Quinn NIF binding for blocking accept doesn't exist)". The acceptor only logs a warning and blocks.
  • So two direct-mode nodes cannot connect to each other.
  • Direct mode also refuses to start unless MACULA_DIST_UNIDENTIFIED_PEER=accept is set (macula_dist.erl:108-135).

2. "Same realm" as a requirement (docs/guides/DIST_OVER_MESH_GUIDE.md:162)

  • The guide lists "Same realm" under "What Nodes Need to Share".
  • In code, dist tunnel frames always carry the all-zeros realm tag: -define(DIST_REALM, <<0:256>>) (src/macula_dist_system/macula_dist_pool.erl:56-60). Tunnel traffic is not bound to any user realm.

Done when:

  • Lines 162, 172 and 176 match the code: direct mode is outbound-only and gated today, and the tunnel uses the zero realm.
  • Or the code is changed to match the guide, and the guide's lines are then true.
Purpose (docs defect): DIST_OVER_MESH_GUIDE.md says only what the macula_dist code does, so nobody plans a LAN setup or realm settings on behaviour that does not exist. Found during the martha-ai/mcl-martha#1 research (Uranus, 2026-12-01), read at macula f8a467a0. **1. "Direct QUIC" for nodes on the same LAN, and for Mnesia** (`docs/guides/DIST_OVER_MESH_GUIDE.md:172`, `:176`) - The guide recommends direct QUIC (`-proto_dist macula`) for "Nodes on same LAN" and for "Mnesia replication". - In code, direct mode cannot accept an inbound connection. `src/macula_dist_system/macula_dist.erl:330-343` says "Direct-listener mode was never implemented end-to-end (the Quinn NIF binding for blocking accept doesn't exist)". The acceptor only logs a warning and blocks. - So two direct-mode nodes cannot connect to each other. - Direct mode also refuses to start unless `MACULA_DIST_UNIDENTIFIED_PEER=accept` is set (`macula_dist.erl:108-135`). **2. "Same realm" as a requirement** (`docs/guides/DIST_OVER_MESH_GUIDE.md:162`) - The guide lists "Same **realm**" under "What Nodes Need to Share". - In code, dist tunnel frames always carry the all-zeros realm tag: `-define(DIST_REALM, <<0:256>>)` (`src/macula_dist_system/macula_dist_pool.erl:56-60`). Tunnel traffic is not bound to any user realm. Done when: - Lines 162, 172 and 176 match the code: direct mode is outbound-only and gated today, and the tunnel uses the zero realm. - Or the code is changed to match the guide, and the guide's lines are then true.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
macula-io/macula#5
No description provided.