mirror of
https://github.com/luxfi/api.git
synced 2026-09-24 00:24:53 +00:00
31058e5e41122a7ccb934d4a50766c81cf59de93
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 <[email protected]>
Languages
Go
79.5%
Cap'n Proto
12.8%
ZAP
7.7%