mirror of
https://github.com/luxfi/api.git
synced 2026-08-07 05:56:47 +00:00
main
Indexed looked superfluous from the C-Chain side — no settlement path calls it — so the first cut of this surface omitted it. That was wrong. The D-Chain's autonomous seam drive is built on it: inside BuildBlock it enumerates pending C->D intents by a fixed discovery trait, recovering each key from the LastKey cursor, because a shared-memory object does not carry its own key in its value. Without Indexed the drive finds nothing and no intent is ever imported, which would have left the seam as dark as it is today while looking fixed. Also fixes a shutdown race that a round-trip test surfaced. Close() nils the conns map under s.mu and Serve's accept loop then assigned into it, panicking — fatally, since Serve runs on a detached goroutine. Any server whose stop path is "cancel then Close" with a connection in flight could hit it, which already includes the node's per-chain rpcdb server. The regression test forces the interleaving rather than racing for it, and fails with the exact panic when the guard is removed. Co-authored-by: Hanzo Dev <dev@hanzo.ai>
Languages
Go
74.5%
Cap'n Proto
15.9%
ZAP
9.6%