Most of the pos chains use a simple model where the txns(short for
transactions) are chosen based on whether the block proposer wants to
include the txn and earn the fee from the executed computation which
seems to be a good enough model for most days until something big event
comes along like a
hyped
nft mint or some hft bots see an arbitrage opportunity filling up
blocks of spam executions because when a lot of people are willing to
give huge wads of money to interact with the same state it drives up gas
prices for everyone. There is one very cool way Solana has worked on it.
Solana has a different fee model than Ethereum, while in Ethereum
transaction fee is calculated by the blockspace covered which treats all
interactions the same but Solana has an accounts model.In accounts there
are two types of instructions read and
write. Whenever there is an interaction the user has to
pre-define the states its program/contract is gonna touch and only
interacts with that piece of that state, not the whole chain which makes
it easier to read the same state for as many users as possible.
But when many parties try to write to the same state the fees spike only
impacts that specific program and not the whole fee market on the Solana
network which keeps the normal users who wanna interact with other
states safe from higher fees. It isolates the impact on that specific
state. Solana is able to execute this because it is one of the first
chains to introduce parallel execution & multithreading with global
state management
Simple description of gas fee model on solana
.With this change having different gas fees for every contract forms a
local fee market kinda like paying different amounts of money for
groceries at different places. If you live in a posh neighborhood
(big-name mint) then you are probably willing to pay more for groceries
but that should not impact how other people pay for their groceries.
Defi contract interactions take a lot of blockspace and when the
contract which mints/swaps tokens is not optimized for gas consumption
there are problems leading to the network being totally unusable for a
normal user. I have myself paid upwards of 5feeforjustasimpleswap(inbearmarket)whileIcouldliterallybuy4mealsformyselfwiththatkindamoney.Mostdays15((additional fee+base fee)/Compute-units)
$$
But What if many agents are willing to pay high fees to access
the same state? wouldn’t that fill the blockspace?
Nope because all the txns are sequential and at once only one agent can
access the state and the
amount
of time that a block can spend on a single state/thread is capped so
that whenever there is a spike for a specific program, all the
transaction will be serialized, executed one by one its amount won’t
affect regular transactions. A Solana block is capped at 48 million
compute units where the max amount a single program can use is 12
million or 1/4 of the total blockspace.
one of the biggest improvements in the fee markets could be when
Firedancer goes mainnet, with the FD's block pre-packing algo
it will be able to map the amount of compute units a transaction is
going to take making it easier for validators to calculate it beforehand
and package the block more efficiently.
I am not sure even Ethereum’s rollup-centric roadmap could pull this off
cause the fee model + structure will still be the same, rn rollups cost
nearly 50 cents for a transaction while Upi in India costs nothing and
works a lot faster than eth so we really need to think whether we are
actually solving problems or working on pseudo-problems, especially with
the recent blowup in the talks of zkevm and
app
chains.
Ps: This will be a series of blog posts lining up some of the technical
advancements made by solana which for some reason no one is talking
about right now.Big shout out to
Jacob
and
Joe
for keeping up with all my dumb questions!
đź’¸Solana Fee Markets
2023 Mar 22 See all postsOriginally published on Paragraph.
Most of the pos chains use a simple model where the txns(short for transactions) are chosen based on whether the block proposer wants to include the txn and earn the fee from the executed computation which seems to be a good enough model for most days until something big event comes along like a hyped nft mint or some hft bots see an arbitrage opportunity filling up blocks of spam executions because when a lot of people are willing to give huge wads of money to interact with the same state it drives up gas prices for everyone. There is one very cool way Solana has worked on it.
Solana has a different fee model than Ethereum, while in Ethereum transaction fee is calculated by the blockspace covered which treats all interactions the same but Solana has an accounts model.In accounts there are two types of instructions read and write. Whenever there is an interaction the user has to pre-define the states its program/contract is gonna touch and only interacts with that piece of that state, not the whole chain which makes it easier to read the same state for as many users as possible.
But when many parties try to write to the same state the fees spike only impacts that specific program and not the whole fee market on the Solana network which keeps the normal users who wanna interact with other states safe from higher fees. It isolates the impact on that specific state. Solana is able to execute this because it is one of the first chains to introduce parallel execution & multithreading with global state management
Simple description of gas fee model on solana
.With this change having different gas fees for every contract forms a local fee market kinda like paying different amounts of money for groceries at different places. If you live in a posh neighborhood (big-name mint) then you are probably willing to pay more for groceries but that should not impact how other people pay for their groceries. Defi contract interactions take a lot of blockspace and when the contract which mints/swaps tokens is not optimized for gas consumption there are problems leading to the network being totally unusable for a normal user. I have myself paid upwards of 5feeforjustasimpleswap(inbearmarket)whileIcouldliterallybuy4mealsformyselfwiththatkindamoney.Mostdays15((additional fee+base fee)/Compute-units) $$
But What if many agents are willing to pay high fees to access the same state? wouldn’t that fill the blockspace?
Nope because all the txns are sequential and at once only one agent can access the state and the amount of time that a block can spend on a single state/thread is capped so that whenever there is a spike for a specific program, all the transaction will be serialized, executed one by one its amount won’t affect regular transactions. A Solana block is capped at 48 million compute units where the max amount a single program can use is 12 million or 1/4 of the total blockspace.
one of the biggest improvements in the fee markets could be when Firedancer goes mainnet, with the FD's block pre-packing algo
it will be able to map the amount of compute units a transaction is going to take making it easier for validators to calculate it beforehand and package the block more efficiently.
I am not sure even Ethereum’s rollup-centric roadmap could pull this off cause the fee model + structure will still be the same, rn rollups cost nearly 50 cents for a transaction while Upi in India costs nothing and works a lot faster than eth so we really need to think whether we are actually solving problems or working on pseudo-problems, especially with the recent blowup in the talks of zkevm and app chains.
Ps: This will be a series of blog posts lining up some of the technical advancements made by solana which for some reason no one is talking about right now.Big shout out to Jacob and Joe for keeping up with all my dumb questions!
Resources used →One of the best 🧵Eli5 thread by anantoly on the feemartkets and the new improvementshttps://github.com/solana-labs/solana/issues/21883https://github.com/solana-labs/solana/issues/23211https://github.com/solanalabs/solana/blob/master/docs/src/proposals/fee_transaction_priority.mdhttps://github.com/solana-foundation/solana-improvement-documents/pullsA[n amazing piece by Jito Labs](https://jito-labs.medium.com/solana-validator-101-transaction-processing-90bcdc271143)