Neuron rollup
Rollup & sol_infer
The Neuron rollup is a single-sequencer SVM chain built on Anza's solana-svm, the same execution engine as Solana mainnet. Solana programs run on it unchanged, and it adds sol_infer syscalls for deterministic inference. It settles to Solana through neuron_settlement.
sol_infer
sol_infer_matmul_i8(a, b, out, dims, flags) -> 0
dims = [m, k, n] three little-endian u32
a = m×k int8, row-major
b = k×n int8, row-major
out = m×n int32 (little-endian), out[i][j] = Σ a[i][t]·b[t][j]
flags must be 0
Integer math on a CPU is bit-exact, so every node that re-executes a block gets identical bytes. The inner dimension is capped so no accumulator overflows, and results are exact. The call costs 100 + ⌈multiply-adds / 64⌉ compute units, charged before any work; the per-call cap is 226 multiply-adds and 10 MiB of output. The rate of 64 multiply-adds per CU is a placeholder until it's calibrated on real hardware. Programs that call it only deploy on the rollup; Solana mainnet rejects them at load time.
Measured
| Workload | Plain SBF bytecode (Solana today) | sol_infer |
|---|---|---|
| 16×32×16 int8 matmul (8,192 multiply-adds) | 187,399 CU (~23 CU each) | 1,988 CU (94× cheaper) |
| 64×256×64 (1,048,576 multiply-adds) | Over the 1.4M CU transaction limit | 18,255 CU |
Both figures include transaction overhead. At about 23 CU per multiply-add, an 8M-parameter model needs roughly 140 mainnet transactions per token; on the rollup it's one.
Run a node
neuron-node --config rollup/node/dev.toml # run (the default command)
neuron-node replay --data-dir <dir> # re-execute from genesis, check every block
neuron-node info --config <file> # genesis blockhash and state root
neuron-node init-settlement --config <file> --admin <upgrade-authority keypair>
Run flags: --data-dir, --rpc-addr, --block-time-ms, --empty-block-ms, --no-settlement, --no-airdrop.
Configuration
TOML or JSON. Relative paths resolve against the config file, and ${ENV_VAR} is expanded in URLs, tokens, headers and keypair paths.
| Key | Default | Meaning |
|---|---|---|
data_dir | required | Genesis, program copies and the block log |
rpc_addr | 127.0.0.1:8999 | JSON-RPC; the WebSocket is on port + 1 (where web3.js looks) |
block_time_ms | 400 | Block interval when transactions are waiting |
empty_block_ms | 2000 | Empty-block heartbeat (keep it under ~10 s for web3.js) |
rpc_auth_token | none | Require Authorization: Bearer … (or ?token= for WebSockets) |
rpc_cors_origins | none | Browser origins allowed to call the RPC (no CORS by default) |
airdrop_max_lamports | 10 SOL | Per-request faucet cap; 0 disables requestAirdrop |
tx_history_slots | unbounded | Keep landed transactions for this many slots |
[genesis] | genesis_time, faucet_keypair, accounts (pubkey or keypair, lamports), programs (program_id, path) | |
[settlement] | off | solana_rpc_url, chain_id, sequencer_keypair, every_blocks, headers |
RPC
A Solana-compatible JSON-RPC subset that unmodified @solana/web3.js, @solana/spl-token, Anchor clients and the Solana CLI work with (tested end to end):
- Chain: getHealth, getVersion, getGenesisHash, getSlot, getBlockHeight, getEpochInfo, getLatestBlockhash, isBlockhashValid, getMinimumBalanceForRentExemption, getFeeForMessage, getRecentPrioritizationFees, getTransactionCount, getBlockTime, getFirstAvailableBlock, minimumLedgerSlot, getIdentity
- Accounts: getBalance, getAccountInfo, getMultipleAccounts, getProgramAccounts, getTokenAccountBalance, getTokenSupply, getTokenAccountsByOwner
- Transactions: sendTransaction, simulateTransaction, getSignatureStatuses, getTransaction, requestAirdrop
- Blocks and history: getBlock, getBlocks, getBlocksWithLimit, getSignaturesForAddress
- WebSocket: signatureSubscribe, slotSubscribe, logsSubscribe (and unsubscribes)
All commitments resolve to the sequencer's view, and an included transaction reports finalized. Block height equals slot, and lastValidBlockHeight is slot + 150. The chain never skips a slot: an empty heartbeat block is a real block with no transactions, and a slot past the tip returns -32004. Not implemented yet: accountSubscribe, programSubscribe, versioned (v0) transactions, memo parsing and token balances in transaction meta.
Checking a block yourself
getBlock adds a neuron field with the block's state root (a Merkle root over every account after the block) and transactions root (all zeros for an empty block), both as hex. With them, anyone can recompute the blockhash without trusting the node:
blockhash = sha256("neuron-block-v2" ‖ previousBlockhash ‖ slot (u64 LE)
‖ blockTime (i64 LE) ‖ stateRoot ‖ txRoot)
Standard Solana clients ignore the extra field, so web3.js getBlock and getParsedBlock work unchanged. A full block larger than 16 MiB returns -32012; ask for signatures and fetch the transactions one by one.
Neuron Explorer
The website includes Neuron Explorer, a block explorer that reads straight from any Solana-compatible RPC: recent blocks, blocks, transactions (legacy, v0 with lookup tables, and v1) and account history, with Neuron allowances, receipt logs, settlement state, instructions and events decoded from the program IDLs. Point it at a local node (127.0.0.1:8999 by default) or a private RPC; a URL that carries an API key is kept for the browser tab only. A browser can only reach a node that lists the explorer's origin in rpc_cors_origins; dev.toml already allows the local site (http://localhost:4173 and http://127.0.0.1:4173).
Limits
| Limit | Value |
|---|---|
| Transaction size | 64 KiB (base58 only up to 1,683 characters; use base64) |
| Static account keys | 38, all unique; sysvars and builtins are read-only |
| Signatures | Must equal the header's required count |
| Compute per block | 48M requested CU; the rest waits for the next block |
| Program deploys | Genesis only; top-level loader-v3 instructions are refused |
| Mempool | 50,000 transactions / 64 MiB |
| RPC | Batches of 100; 16 MiB scan responses; WebSocket 1,024 connections × 100 subscriptions |
Every transaction is checked on submission (size, shape, signatures, blockhash, duplicates) even with skipPreflight. Health turns unhealthy if no block is produced for 3 × empty_block_ms, and a crash in block production stops the process rather than leaving it running broken.
Persistence and replay
- Genesis (with program binaries pinned by sha256) and every block are written to
data_dirand fsynced before anyone can see the block. - On restart the node re-executes the whole log and refuses to start on any mismatch;
neuron-node replaydoes the same as a check. A half-written last line from a crash is dropped. - Each blockhash commits to its parent, slot, timestamp, the state root (a Merkle root over every account) and a root over the block's transactions.
- Block timestamps come from the sequencer's clock and never go backwards. Run NTP on the sequencer.
Settlement
With a [settlement] section, the node posts a checkpoint every every_blocks blocks to neuron_settlement on Solana. It runs off the block path, so a slow or unreachable Solana never stalls the rollup. It resyncs from the on-chain state after restarts or rejections, backs off between retries, and scrubs RPC credentials from its logs. Set it up once with neuron-node init-settlement, signed by the program's upgrade authority. Use separate keys for the faucet, genesis funds and the sequencer.
Not yet
- The bridge (deposits and withdrawals between Solana and the rollup)
- Fraud proofs against posted checkpoints
- More
sol_inferoperations (activations, attention), weights in accounts, a real small model - An owner index for account scans; snapshots so restarts don't replay from genesis