Solana Tech Roundup
This week there has been a flurry of activity regarding performance on the Solana network. The discussion and commits have been fun to follow. Be sure to check out the recent Twitter space with Anatoly, @buffalu__, @leolukde, and @dadadadaffy found here.
Proposal Highlight:
Comprehensive Compute Fees
Currently transaction fees are only based on the number of signatures in a transaction, but this does not account for the validator's work involved to validate this transaction.
The new fee will be calculated based on:
- Number of signatures
- Number of account write locks
- Transaction byte size
- Account size
- Total Compute budget
- Number of precompiled programs
The max transaction fee can be computed beforehand, and a rebate for any unused compute or write locks will be sent back as a rebate. This may change fees to not be deterministic in the future.
Discussion Highlight:
Exponentially increase fees for unused write-locked accounts
When a transaction is made on a program, a number of accounts become write-locked and can slow down other transactions from being made on that account. A great example is liquidators. Liquidators will write lock a number of accounts to attempt to liquidate any pending eligible orders. If there's no current eligible orders for liquidation, the transaction locked accounts but didn't use them.
Not paying for unused write locked accounts can incentivize spamming the network. The discussion proposes the following:
- Write-locked accounts will be tracked during transaction execution
- Feepayers must pay for all possible write locked accounts. Fee rebates will be given after a transaction is executed
- If compute budget for an account is exceeded over N slots, fees for using that account will double for the next 2N slots
Let's take this example:
Let's say Raydium's new IDO pool account has a compute cap of 1m units. When launched, people submitting orders over 10 slots reach a total compute amount of 2m on the IDO pool account. For the next 20 slots, the fees for submitting orders on the IDO pool will double. Exponentially increasing fees forces spam bots to better execute their orders or pay an increasing fine.
If you want to read more or contribute to the discussion, join the issue here.
Commit Highlight:
- 🧍🧍 Lots of deduplication packet work 🧍🧍
List of changes:
January 21
- Perf: Only check executors cache for executable bpf program ids
- Previously ever transaction key was checked against the executor cache. This update changes the logic to only check executable bpf program ids against the executor cache.
- Removing unused fields from Bank
- Filtering out deduped packets when discarding excess packets
- Added ActiveStats to track long running bg processes in accountsDB
- This is helpful for debugging if there is ever an error with accountsDB
- Web3.js release pipeline fixed
January 22
- Added get/set_return_data syscalls for program testing
- Removed stake program v3 and v4 features toggles
- Feature toggles were not needed anymore as they were activated on June 2021
- Community Contribution! Great documentation around transaction module in the Solana Rust SDK
- Remove bloom filter for dedups in favor of ahash + vector of atomic u64s
- Ahash is a high performance keyed hash function. This change brought deduping to ~62ns per packet
- Community Contribution! Add timestamp zone toggle for explorer
- Update solana ping to transfer to self with a rotating amount
- Solana ping is a handy tool that can give you an idea of current transaction skip rate
January 23
= Community Contribution! Add JSON5 config support to accountsDB
January 24
- Handle already discarded packets in gpu sigverify path
- GPU sigverify is very slow when batches are sparse. Use CPU when batches are less than 90% full and when number of valid packets is less than 64
- Community Contribution! Enable setting tick rate on solana-test-validator
- Add feature toggle for releasing new associated token account
January 25
January 26
- Reduce write locks on blockhash queue
- Change from taking write lock for the block hash queue every tick to only when approaching block boundary
- Set correct root in block commitment cache initialization
January 27
- Improve poh recorder metrics
- Add vote account address to vote subscription
- You can now subscribe to a specific vote account using the vote account subscription
- Fix deprecated web3.js calls
- A variety of rpc calls got deprecated and web3.js was still using the old methods. Updated to use
getBlock
,getLatestBlockhash
, andgetTransaction
.
- A variety of rpc calls got deprecated and web3.js was still using the old methods. Updated to use
- Fix CPI privilege escalation bug
- Bug where you could have duplicate pubkeys privilege escalated if you used them in CPI. Only the first pubkey was checked previously.