Revision · Project 7 — Solana Mini-Chain
Project 7 built solmini, a Solana-style mini-runtime aimed at raw throughput: a verifiable clock and a scheduler that runs non-conflicting transactions in parallel across threads. It closes the playbook by mapping all three chains onto real Anchor. Here’s what to carry forward.
What this part covered
Section titled “What this part covered”- The throughput problem — Ethereum serializes transactions because a contract’s storage footprint is unknown until you run it; Solana’s narrow bet is to optimize almost everything for transactions per second per dollar, accepting the trilemma trade-off (hardware, centralization pressure) to get there.
- Proof of History — a sequential SHA-256 hash chain is a clock you can’t fake without doing the work; producing it is serial, but anyone can verify it in parallel by recomputing, and flipping one byte makes verification fail. A clock replaces a conversation between validators about when things happened.
- The account model — state lives outside code in typed accounts, and programs are stateless pure functions over the accounts handed to them; because code holds no hidden storage, a transaction’s footprint is declarable up front.
- Declared footprints — each transaction lists the accounts it reads and writes, so the scheduler can see which transactions can’t interfere without running anything — “shared XOR mutable” lifted from variables to accounts.
- The Sealevel scheduler — dependency layering groups transactions into conflict-free batches, and each batch runs across threads with rayon’s
par_iter_mut, which hands each worker a disjoint&mut, so the runtime can’t race by construction. - Honest trade-offs — the scheduler’s
O(n^2)conflict scan and SHA-256 keys are deliberate simplifications, and the demo’s speedup varies with core count and isn’t a benchmark. - The Anchor bridge — the capstone maps
solminionto real Solana/Anchor (discriminators, Borsh, rent, CPI, program-derived addresses), so the toy runtime becomes your mental model for production programs.
The takeaway
Section titled “The takeaway”The recurring question sharpens to fearless parallelism at scale: rayon’s par_iter_mut and your scheduler enforce the same “shared XOR mutable” guarantee at two levels, so the data race that “just run these on threads” invites in C is again unrepresentable. Day 30 sets all three mini-chains side by side and answers, in code you wrote, why Bitcoin, Ethereum, and Solana each exist — then points you at real Anchor development.