Solana Scheduler Research

February 11, 2024

What is the banking stage

The part of the validator where we process transactions and possible include them in the block

Logic Flow

Networking → SigVerify → Banking Stage

Threads

  • Six thread
  • 2 vote transaction (TPU or Gossip)
  • 4 non-vote transactions (real-usage transaction)

High level overview

If a validator is not the leader for the block, it will simply forward the transactions to the leader after receiving them in the banking stage. 20 slots out, the validator will continue forwarding, but it will stop dropping them. Two slots before becoming a leader, the validator will stop forwarding to prepare to be a leader.

💡 Approximately four slots are what it takes, more or less, for the next leader to appear.

Stages

  1. QoS
  2. Lock: Make sure there is no other thread writing to the same account.
  3. Checks: Transaction is too old or has been process already?
  4. Load: Load the accounts that are necessary for executing the transaction and some initial setup (check fees, valid program?)
  5. Executing: Setting VM for each transaction (e.g. change balances)
  6. Record: Hash and an introduce it in proof o history
  7. Commit: Propagate the changes back in to the accounts
  8. Unlock: Unlock accounts

💡 After 150 slots a not commited transaction will be invalidated

Priority fees

Transactions are organized in each banking thread based on the priority fees. Priority fees are very unreliable before the new scheduler is released in v1.18.

New scheduler changes

A step will be introduced before the threads to organize the transactions based on priority fees. With this new method, each thread will contain non-conflicting work. This will exponentially improve the Lock stage in addition to making the priority fees more reliable. The new scheduler will be released in v1.18.

Other improvements coming soon (hopefully)

More resources

  • https://twitter.com/zebedee/status/1767938146686189850
  • https://twitter.com/ansel_sol/status/1767880432400396292
  • https://twitter.com/0xMert_/status/1767592379949674968
  • https://www.youtube.com/watch?v=R7hq8ampBio
  • https://twitter.com/ryanchern/status/1768014460461986107
  • https://medium.com/@harshpatel_36138/whats-new-with-solana-s-transaction-scheduler-bcf79a7d33f7
  • https://apfitzge.github.io/posts/solana-scheduler/
  • https://www.youtube.com/watch?v=jCcDg-nxZUQ
  • https://www.helius.dev/blog/priority-fees-understanding-solanas-transaction-fee-mechanics
  • https://www.umbraresearch.xyz/writings/solana-fees-part-1
  • https://docs.phantom.app/developer-powertools/solana-priority-fees
  • https://docs.solana.com/transaction_fees
  • https://docs.google.com/document/d/1ZX7Cg_XOeMfKtPwnoFVhQVg5uHhiGp2GrAbVLexGr3o/edit
  • https://mango-markets.notion.site/Base-fees-in-Solana-83af1d7eafc848fdb726a64748281f87
  • https://docs.google.com/document/d/1ZX7Cg_XOeMfKtPwnoFVhQVg5uHhiGp2GrAbVLexGr3o/edit#heading=h.eiwg31g2it83
  • https://www.youtube.com/watch?v=Bhh4chj-J0I&t=457s
  • https://mirror.xyz/eclipsemainnet.eth/GTrrYpmxSY1ubQ0SEV5akF7EZXgA2XFr7FEjM3CUuaE