Lesson 2
Lesson 2
Lesson Plan
Cryptography
Consensus
Solana Network and History
Key Cryptography - Elliptic curves
Solscan
Solana Beach
The mempool (pending transactions) and Gulfstream
Mempool size in Bitcoin
Since every validator knows the order of upcoming leaders, clients and validators forward
transactions to the expected leader ahead of time. This allows validators to execute transactions
ahead of time, reduce confirmation times, switch leaders faster, and reduce the memory
pressure on validators from the unconfirmed transaction pool. This solution is not possible in
networks that have a non-deterministic leader
Transactions reference recent blockhash and the transaction is valid only in the children of the
referenced block, and is only valid for about 32 blocks.
Assuming block times of 800 ms, that equates to 24 seconds.
Once a transaction is forwarded to any validator, the validator forwards it to one of the upcoming
leaders. Clients can subscribe to transaction confirmations from validators. Clients know that a
block-hash expires in a finite period of time, or the transaction is confirmed by the network.
This allows clients to sign transactions that are guaranteed to execute or fail. Once the network
moves past the rollback point such that the blockhash the transaction reference has expired,
clients have a guarantee that the transaction is now invalid and will never be executed on chain.
Concurrency and Throughput
If we were given the hash values and counts out of sequence we would be able to put them into
the correct order.
Upper bound on time
Lower Bound on time
Running this process cannot be done in parallel , we need to complete each step in turn.
However, once we have the steps we can verify in parallel.
A useful analogy is with a water clock, as in this article
Leader selection
[Leader Schedule Generation Algorithm ] (https://docs.solana.com/cluster/leader-
rotation#leader-schedule-generation-algorithm )
Leader schedule is generated using a predefined seed. The process is as follows:
1. Periodically use the PoH tick height (a monotonically increasing counter) to seed a stable
pseudo-random algorithm.
2. At that height, sample the bank for all the staked accounts with leader identities that have
voted within a cluster-configured number of ticks. The sample is called the active set.
3. Sort the active set by stake weight.
4. Use the random seed to select nodes weighted by stake to create a stake-weighted
ordering.
5. This ordering becomes valid after a cluster-configured number of ticks.
The advantages of deterministic leader selection
Since every validator knows the order of upcoming leaders, clients and validators forward
transactions to the expected leader ahead of time. This allows validators to execute transactions
ahead of time, reduce confirmation times, switch leaders faster, and reduce the memory
pressure on validators from the unconfirmed transaction pool. This solution is not possible in
networks that have a non-deterministic leader
This system lowers latency and increases throughput because slot leaders can stream
transactions to the rest of the validators in real-time rather than waiting to fill an entire block and
send it at once.
As validators keep the count of time, they can stamp each incoming transaction with a time, or
proof-of-history value, so the other nodes can order transactions within a block correctly even if
they aren’t streamed in chronological order. The other nodes can then verify these transactions
as they come in rather than having to review an entire block of transactions at once.
Useful articles
Sol overview
Proof-of-history - Medium (by the founder)
Tower BFT (Proof of Stake)
Solana implements a derivation of pBFT, but with one fundamental difference. Proof of History
(PoH) provides a global source of time before consensus. Solana's implementation of pBFT uses
the PoH as the network clock of time, and the exponentially-increasing time-outs that replicas
use in pBFT can be computed and enforced in the PoH itself.
The leader will be able to publish a signature of the state at a predefined period.
Each bonded validator must confirm that signature by publishing their own signed signature of
the state. The vote is a simple yes vote, without a no.
If super majority of the bonded identities have voted within a timeout, then this branch would be
accepted as valid.
Every 400ms, the network has a potential rollback point, but every subsequent vote doubles the
amount of real time that the network would have to stall before it can unroll that vote.
Once ⅔ of validators have voted on some PoH hash, that PoH hash is canonicalized, and cannot
be rolled back. This is distinct from proof of work, in which there is no notion of canonicalization.
Solana History
See Docs
Anatoly Yakovenko published a whitepaper in November 2017 specifying proof of history.
The codebase was moved to Rust and became project Loom.
In Feb 2018 a throughput of > 10K transactions per second was verified.
In March 2018 the project was renamed to Solana to avoid confusion with existing projects.
In July 2018 a testnet of 50 nodes was built which managed up to 250K transactions per second.
In December 2018 the testnet was increased to 150 nodes, and the throughput averaged 200K
transactions per second , peaking at 500K.
October 2020 - Wormhole bridge launched (Solana to Ethereum)
November 2022 - Solana affected by collapse of FTX, some stablecoin trading halted.
April 2023 - Solana Saga phone available
Running a validator
Node requirements
1. Validator node:
CPU
12 cores / 24 threads, or more
2.8GHz, or faster
AVX2 instruction support (to use official release binaries, self-compile otherwise)
Support for AVX512f and/or SHA-NI instructions is helpful
The AMD Zen3 series is popular with the validator community
RAM
128GB, or more
Motherboard with 256GB capacity suggested
Disk
PCIe Gen3 x4 NVME SSD, or better
Accounts: 500GB, or larger. High TBW (Total Bytes Written)
Ledger: 1TB or larger. High TBW suggested
OS: (Optional) 500GB, or larger. SATA OK
The OS may be installed on the ledger disk, though testing has shown better
performance with the ledger on its own disk
Accounts and ledger can be stored on the same disk, however due to high IOPS, this is
not recommended
The Samsung 970 and 980 Pro series SSDs are popular with the validator community
GPUs
Not strictly necessary at this time
Motherboard and power supply speced to add one or more high-end GPUs in the future
suggested
2. RPC node:
CPU
16 cores / 32 threads, or more
RAM
256 GB, or more
Disk
Consider a larger ledger disk if longer transaction history is required
Accounts and ledger should not be stored on the same disk
Internet service should be at least 300Mbit/s symmetric, commercial. 1GBit/s preferred.
Price of operation
Solana validators must pay to be eligible to vote. This means a fixed cost of roughly 3 SOL every
epoch (2-3 days), which at the time of writing equals costs of ~$100 every single day. This is for
transactions which happen on chain and are part of the consensus mechanism.
The validator profits by charging commission on the accounts that delegate to it.
Right now it is required to have combined delegated and staked 50,000 SOL in order to run a
node at a profit.
Rewards
Validators earn SOL in two ways:
staking reward
commission on 3rd party stake
50% of the transaction fee
Rewards are fixed per epoch and are divided amongst the nodes the support the network.
Rewards are divided according to:
stake weight
participation
As time goes on inflation rate will decrease and with it associated epoch rewards.