0

What exactly decides the execution order of transactions within a block? I have read here that baking fees matter, but I am not sure how in particular.

Transactions within past blocks don't seem to be ordered by baker fees. As I understand it, fees matter because a baker wants to maximize the fees it can get for the block it bakes. Does this mean that fees only matter if there are too many pending transactions to fit in a block? When this is the case, bakers would try to fit transactions with a high (baker fee) / (gas used) ratio first, to maximize fees per unit of gas, since there is a gas limit per block.

Currently, blocks only use about 5% of the maximum amount of gas available per block according to tzstats.com. Does this mean that all pending transactions can be included in a block, and therefore fees don't affect ordering?

Does the timing of publishing a transaction within a block matter? In other words, as long as a transaction is executed in the window of a block being built, does the exact timings within that window affect the order of transactions in the block?

I am also aware that bakers are incentivized to order their own transactions favorably.

1 Answer 1

0

Fees matter to bakers constructing blocks because this maximizes their profit. Transactions utilize a simple counter to manage their sequence of execution.

If I submit 10 transactions in a block, a baker will pick them up based on their included fee (highest fees picked first), but they will be processed in counter order for each unique sender.

2
  • I am asking about the order between two different senders. If sender A and sender B both submit a transaction, how is execution order determined?
    – PEC
    Apr 18 at 16:16
  • In my experience gas_limit matters for full blocks. Transactions are ordered FIFO for all transactions that can be independently included in a block even if a higher fee transaction is invalidated by a lower fee transaction that was included first.
    – ping_
    Apr 28 at 10:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.