Concepts
Asentum Native Transport
The persistent-TCP consensus transport we built after libp2p kept timing out. Estimated read time: 4 minutes
TL;DR
ANT is the transport layer Asentum validators use for consensus traffic. Persistent TCP connection per peer, length-prefixed framing, per-peer finite state machine, content-fingerprint dedup at the receive path. Runs in a Node.js worker thread so consensus storms can't starve the keep-alive loop.
Block sync, RPC, and client-facing endpoints continue to ride plain HTTP over the existing JSON-RPC port. The split is on purpose, see below.
Why we built it
We tried libp2p first. Cross-DC mesh between baked validators dropped within seconds under sustained consensus load. The gossipsub keep-alive loop shared an event loop with the BFT engine, and during high-vote-rate periods the keep-alive starved, peers thought each other dead, the mesh pruned itself, votes stopped propagating, the chain wedged.
Three weeks of trying to coax libp2p into staying up across cross-DC links taught us that a generalized peer-to-peer mesh was the wrong abstraction for our problem. Asentum validators are a small known set with stable addresses and high trust. We don't need peer discovery. We don't need DHT routing. We need fast, reliable, never-disconnect TCP between N peers we already know about.
ANT is the result. Shipped late June 2026, replaced libp2p in production within a day, has run with zero disconnects ever since.
How it works
- One persistent TCP connection per peer. Both sides dial, lowest-address wins, the other drops. No reconnect storms.
- Length-prefixed framing. Each frame is a uint32 length followed by SSZ-encoded payload. Simple, deterministic, easy to debug with tcpdump.
- Per-peer FSM. CONNECTING, HANDSHAKING, READY, DRAINING, CLOSED. State transitions logged for ops visibility.
- Content-fingerprint dedup. Full-mesh topology means the same vote arrives multiple times. Without dedup the engine spent its CPU re-verifying signatures and never got to consensus. With dedup, load averages dropped from 4.0 to 0.07.
- Worker thread isolation. ANT runs in its own Node worker. The BFT engine's event loop never blocks ANT's keep-alive timers and vice versa. This is non-negotiable, learned the hard way.
The handshake currently uses TLS for transport security. A post-quantum handshake adding ML-DSA-signed peer identity is queued for pre-mainnet.
When HTTP is still used
ANT is for consensus traffic only. Three things still go over plain HTTP:
- Block sync. Catchup nodes poll
/block-raw/:non a peer in 32-block batches. Pull-based, NAT-friendly. - JSON-RPC. Wallets, dapps, indexers, everything client-facing.
- Pull-mode vote relay. Validators behind NAT poll a baked node's
/consensus/round-snapshotendpoint instead of joining the ANT mesh. Trades a tiny bit of latency for working through aggressive corporate firewalls.
ANT solves the tight-mesh problem. HTTP solves the work-everywhere problem. Different tools for different network shapes.
Source + design notes
ANT lives in the AsentumChain repo under packages/node/src/net/ant/. About 700 lines of TypeScript, 15 tests. The architectural choice to split it from libp2p is documented in the dev log; the worker-thread isolation requirement is captured in the memory at feedback_libp2p_worker_thread_required for posterity.
For the broader networking story see Architecture.