Could someone describe how the full node chooses transactions from the mempool that make it into a block.

I suppose there must be some logic that makes a compromise between fees and gas cost but it would be great if someone could detail the logic here, thanks!

1 Answer 1


A baker is free to include whatever operations it wants, as long as they are valid. By default a baker want to create the block that generate the highest amount of fees (most bakers will also have a minimum fee threshold to pass prevalidation). In combinatorial optimization this is described as a knapsack problem. So how the baker choose transactions is essentially based on incentives. Except from maximizing the income from fees, a baker could choose to prioritize some transactions over others (e.g. give priority to its own delegation payouts).

  • Thanks! And in practice how does a baker actually implements his preferences ?
    – Ezy
    Feb 1, 2019 at 19:34
  • No. Since the bakers don't bake any full blocks yet, these preferences is not of any big importance yet. Currently it's only the minimal fee threshold set in the baker and the node that have any meaningful impact.
    – Klassare
    Feb 1, 2019 at 19:46
  • I understand that the choice is not consequential at the present time however it will become once the network gets more activity. I am curious if bakers would need to implement themselves some logic to choose in the mempool or if the plan is to have some sort of api to be able to define it without hacking into the node code ?
    – Ezy
    Feb 1, 2019 at 19:47
  • You can customize the minimal fee by passing different flags to the baker. More basic logic will probably be customized in a similar way in the future.
    – Klassare
    Feb 1, 2019 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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