New block building algorithms for Flashbots' Builder

We’ve added new block building algorithms to Flashbots’ Builder! We encourage the community to try them out and share any thoughts, questions, comments or concerns here. Full details below.


Context

We’ll consider three forms of block building:

  1. Greedy - An algorithm that takes input transactions and bundles, sorts them by effective gas price (EGP) and nonce, and inserts them into a block sequentially
    – Erroring transactions and bundles are dropped
    – Bundles are also dropped if there is a difference in EGP from when the bundle was simulated to when it’s inserted into a block
  2. [NEW] Greedy Buckets - An algorithm that leverages both effective gas price and profit to build blocks.
    i. First, transactions and bundles are ordered by max effective gas price
    ii. Then, batches are created using percent cutoff of EGP based on highest price in the batch. For example, if the highest EGP in the batch is 1000 wei, and our EGP percent cutoff is 10%, then the batch would include all transactions between 1000 and 100 wei.
    iii. The batch is then sorted by profit and inserted into a block. Profit is calculated based on factors like EGP, gas used, and ETH sent to coinbase.
  3. [NEW] Total profit - An algorithm that sorts all transactions and bundles by their profit and inserts them into a block. Profit is calculated based on factors like EGP, gas used, and ETH sent to coinbase.

Users running Flashbots builder can try out the algorithms with flags described below or checkout the README


Builder Flags

  1. Greedy: Build blocks using max effective gas price
  • --miner.algotype "greedy" : Sets the block building algorithm to greedy
  1. Greedy Buckets: Build blocks using max effective gas price and profit
  • --miner.algotype "greedy-buckets" : Sets the block building algorithm to greedy-buckets
  • --miner.price_cutoff_percent (default: 50) : The minimum effective gas price threshold used for bucketing transactions by price. For example if the top transaction in a list has an effective gas price of 1000 wei and price_cutoff_percent is 10 (i.e. 10%), then the minimum effective gas price included in the same bucket as the top transaction is (1000 * 10%) = 100 wei.
  1. Total profit: Build blocks using max profit
  • --miner.algotype "greedy-buckets" : When used in conjunction with --miner.price_cutoff_percent=0, sets the block building algorithm to use total profit
  • --miner.price_cutoff_percent=0
    • Note: It is required to set miner.price_cutoff_percent to 0 AND --miner.algotype "greedy-buckets" in order to leverage the total profit algorithm
2 Likes