Why an LSM tree
LSM trees give write throughput sufficient for the per-block fanout of transaction types (currency, DEX, NFT, names, mail, mandates, compute, labor, vigils, nova) without sacrificing read latency for indexed lookups. The compaction model produces stable on-disk artifacts well-suited to snapshot publication.State partitions
State is split into typed partitions. Each partition has its own key prefix, value codec, and indexes:| Partition | Prefix | Purpose |
|---|---|---|
| Accounts | acct/ | Native balances, nonces, bond ledgers. |
| Staking | stake/ | Delegation shares, undelegation queue. |
| Validators | val/ | Active set, candidate set, slashing records. |
| DEX | dex/ | AMM pools, LP positions, non-native balances. |
| NFT | nft/ | Collections, token records, royalty configs. |
| Names | sns/ | SNS records, resolver records, delegations. |
mail/ | Mailboxes, key directory, delivery commitments. | |
| Mandates | mand/ | Issued mandates and delegation trees. |
| Compute | cmp/ | Provider registry, jobs, receipts, challenges. |
| Storage market | storage/ | Provider records, pin contracts, receipts. |
| Labor | lab/ | Jobs, bids, contracts, escrow, disputes. |
| Governance | gov/ | Proposals, votes, timelocks. |
| Treasury | trsy/ | Reserve accounts and disbursement ledger. |
| Crucible | cruc/ | Training run state, weight commitments. |
| Nova | nova/ | Parcels, world records, presence commitments. |
| Vigils | vig/ | Subscriptions, ingestor registry, deliveries. |
node/sigil-core/src/state_partitions.rs.
MVCC
AkashaKV gives every commit a monotonically increasing version. Reads at versionv see the consistent snapshot at that height. Block executors read at the parent height and write to the new height. Concurrent readers (RPC, explorer, light client) never block writers.
Write-ahead log
Every state mutation appends to the WAL before reaching the LSM memtable. On crash recovery the node replays the WAL up to the last finalised block. The WAL is fsync-tight; a transaction is durable when fsync returns.State root
Each block header contains a BLAKE3 state root computed over the typed partitions in a canonical order. Validators reject a block whose computed state root does not match the proposer’s. Light clients verify state proofs against the root without trusting the RPC. Implementation:node/sigil-core/src/state_root.rs.
Snapshots
Snapshots are published every 1,000 blocks at:Storage migration
Migrating an existing chain to new on-disk layout (AkashaKV pin upgrade, partition rebalance, sharding) is an upgrade-safe operation. The migration must not change:- Chain IDs.
- Address derivation.
- Account balances, staking amounts, or validator identities.
- Transaction semantics.
- Canonical serialisation.
- State roots.
AkashaKV and Weave storage migration. The pinned AkashaKV revision is in AkashaKV pin.