How can1357/hl works
hl-recon is a recovered-source map of the Hyperliquid node, not a buildable application. Its principal workflow is processing exchange actions during block execution and exposing resulting chain and market state through public info and EVM RPC interfaces. The graph also preserves consensus/gossip, trading, EVM state, and persistence as distinct capabilities. Many subsystem links are necessarily omitted: the tree and README establish their roles, but sampled excerpts do not show their runtime wiring.
Main entry points: exchange.rs Exchange engine · handle_request.rs Info HTTP dispatch · engine.rs ABCI execution · server.rs Consensus server
Components 25
Block execution
- ABCI execution
l1/abci/engine.rs - Action handlers
l1/exchange/handlers
Exchange and trading
- Exchange engine
l1/exchange/exchange.rs - Order books
l1/book/book/impl_insert_order.rs - Perp clearinghouse
l1/clearinghouse/clearinghouse.rs - Spot clearinghouse
l1/spot_clearinghouse/spot_clearinghouse.rs - DEX registry
l1/dex_registry/dex_registry.rs - Quantity arithmetic
l1/qtys/mod.rs
Node and consensus
- Consensus server
node/consensus/server.rs - Gossip RPC
node/gossip_rpc.rs - Gossip client
node/gossip_rpc_client.rs - Node startup
node/startup.rs
Public interfaces
- Info request types
info_server/request.rs - Info HTTP dispatch
info_server/handle_request.rs - Info state routes
info_server/abci_state_info_handler.rs - EVM method router
evm_rpc/method_router.rs - EVM RPC methods
evm_rpc/evm_rpc.rs - EVM write forwarder
evm_rpc/evm_write_forwarder.rs - HTTP client
base/http_client.rs
State and infrastructure
- EVM state
l1/evm/evm_state.rs - RocksDB wrappers
db/rocks_db.rs - Block reader
db/block_reader.rs - Database home
db/db_home.rs
Other components
- API clients
- Validators and peers
Connections 24
- API clients → Info HTTP dispatch: sends queries
- Info HTTP dispatch → Info request types: dispatches requests
info_server/handle_request.rs - Info HTTP dispatch → Info state routes: routes queries
info_server/handle_request.rs - Info state routes → Info HTTP dispatch: returns responses
info_server/abci_state_info_handler.rs - API clients → EVM method router: sends JSON-RPC
- EVM method router → EVM RPC methods: dispatches methods
evm_rpc/method_router.rs - EVM RPC methods → EVM write forwarder: forwards raw transactions
evm_rpc/evm_rpc.rs - EVM write forwarder → HTTP client: uses HTTP client
- HTTP client → EVM write forwarder: posts raw transactions
- Validators and peers → Consensus server: participates in consensus
- Consensus server → Gossip RPC: handles gossip requests
- Gossip client → Gossip RPC: sends RPC requests
node/gossip_rpc_client.rs - Node startup → Consensus server: starts node services
- ABCI execution → Action handlers: executes actions
l1/abci/engine.rs - Action handlers → Exchange engine: applies exchange actions
- Exchange engine → Order books: updates orders
- Exchange engine → Perp clearinghouse: updates positions
- Exchange engine → Spot clearinghouse: applies spot actions
- Exchange engine → DEX registry: uses DEX registry
- Exchange engine → Quantity arithmetic: uses quantity types
- ABCI execution → EVM state: coordinates EVM state
- ABCI execution → RocksDB wrappers: persists chain state
- Database home → RocksDB wrappers: manages database
- Block reader → RocksDB wrappers: reads blocks