Firandencer v0 (a.k.a. Frankendancer) re-implements the path that a validator runs when it's the leader.
Users -> Transaction -> Produce Block -> Broadcast Transaction to the network.
Agave
- Gossip
- Replay
- Repair
- RPC
- Account Database
- ... more
Frankerdancer
- Leader TPU
Leader TPU Pipeline
1. Quic
Network protocol used to talks between RPCs and Leaders to receive transactions to get in the leader machine. The performance of Quic it's very important.
- Can handle over a 1 million TPS with 1 CPU core
2. Verify
Signature verification checks that transactions are signed by the owner and that's ready to be processed by the network
- 2200 microseconds per signature
- Firedancer can handle 50k sig verify per second in a modern Intel CPU Core.
- Many cores are assigned to verify.
3. Dedup
Filters out duplicate transactions
- Very fast, only needs one core
- Over a million per 10% of a CPU core
4. Pack
Similar to the Scheduler in Agave. Pack orders the transactions based on CU / Priority Fees.
- By design runs in just one cores
- 1 million transactions per second.
- Because it can't scale up to more cores, it's a hot spot.
5. Bank
Execute transactions in order by running instructions.
- Runs in parallel, need more cores
- 40/50 thousand tx per bank (core)
6. PoH
At a higher level, it proves the validator is making forward progress.
7. Shred
Takes output of the bank and distributes the result to the rest of the network.
This implements Turbine.
8. Store
Once the data is sent to the network it's stored in the node too permanently.
- 300,000 per second
Firedancer Networking Stack
Uses Linux XDP (Express Data Path), which allows skipping a lot of the kernel processing.
How is Firedancer is different than Agave
- Not letting the OS manage threads. One core = One thread
- Not allocating in memory
- No system calls
How do Frankendancer and Agave communicate?
Firendancer intercepts and redirect the network traffic before it reaches Agave and redirects it to the Firedancer networking component.
After the leader TPU Pipeline processes a block, it inserts the data into the Agave Store component.
There's an small firedancer commit stack that makes some minimal changes to the Agave codebase.