NOMT is a state database, a critical component of a blockchain node.
NOMT is designed to be a drag-and-drop replacement for RocksDB, MDBX, LMDB, etc
And to encapsulate all the Merkle Trie logic within it.
Inspired by this blog post.
and funded with a grant from Sovereign Labs (targeted first user)
Built with care by
three Rust systems programmers from the Polkadot sphere
Every node needs to store state: token balances, contract code, prices, etc.
Nodes keep this state in an embedded database on their disk.
Authenticated State Trees
Incredibly important for interoperability, light clients, bridging, coprocessors, etc.
NOMT uses a Binary Merkle Trie
Let's talk about SSDs
Typical high-end SSD specs (Q4 2024):
Latency: time to serve a single request.
increases as more requests are queued
Throughput: number of requests per second.
note that average latency at 1M IOPS is 1 microsecond!
A 4 KB (single page) read or write operation on the disk.
SSDs only work in data of exactly one page.
Crucial T705 | Samsung 980 | |
---|---|---|
Release Date | Feb. 2024 | Sep. 2020 |
IOPS | 1.5M | 1M |
Price at Launch | $689 | $430 |
Price (Nov. 2024) | $564 | $199 |
Capacity | 4TB | 2TB |
source: Tom's Hardware
Just like this, except each page is 4KB and stores 6 layers
This is known as a "proto-VEB layout"
Pages stored in an on-disk Hash-Table with a WAL
Top 4 levels of the page tree are kept in memory
Branches use bitwise prefix compression and separators
Optimized for high-entropy, short keys
Typical Branching factor of 375
~200MB memory per billion items
Reads: 3 (1 beatree, 2 merkle)
Writes: 5 (2 beatree, 3 merkle)
Total I/O per TX: 16
At 1M IOPS: 62kTPS
At 500k IOPS: 31.5kTPS
Our performance goal for NOMT V1 (EOY 2024) is 25kTPS with 1 billion accounts.
Current benchmarks on 128M accounts at ~40kTPS
side note: we assume random worst-case access
Scenario: Prove 300k state reads against a database of 1B items.
this is 25kTPS * 6 seconds
Proof size is 120MB, requiring 160Mbps of bandwidth.
Note that Polkadot PoVs are only 5MB!
Possible solution: use succinct proving techniques to "compress" state proofs. Likely needs GPU acceleration.
Solution: have dedicated CPU cores or GPU acceleration for signature verification