• Stars
    star
    1,172
  • Rank 39,881 (Top 0.8 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 3 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

MEV-Boost allows Ethereum validators to source high-MEV blocks from a competitive builder marketplace

mev-boost

Goreport status Test status Docker hub

What is MEV-Boost?

mev-boost is open source middleware run by validators to access a competitive block-building market. MEV-Boost is an initial implementation of proposer-builder separation (PBS) for proof-of-stake (PoS) Ethereum.

With MEV-Boost, validators can access blocks from a marketplace of builders. Builders produce blocks containing transaction orderflow and a fee for the block proposing validator. Separating the role of proposers from block builders promotes greater competition, decentralization, and censorship-resistance for Ethereum.

How does MEV-Boost work?

PoS node operators must run three pieces of software: a validator client, a consensus client, and an execution client. MEV-boost is a sidecar for the beacon node - a separate piece of open source software, which queries and outsources block-building to a network of builders. Block builders prepare full blocks, optimizing for MEV extraction and fair distribution of rewards. They then submit their blocks to relays.

Relays aggregate blocks from multiple builders in order to select the block with the highest fees. One instance of MEV-boost can be configured by a validator to connect to multiple relays. The consensus layer client of a validator proposes the most profitable block received from MEV-boost to the Ethereum network for attestation and block inclusion.

A MEV-Boost security assessment was conducted on 2022-06-20 by lotusbumi. Additional information can be found in the Security section of this repository.

MEV-Boost service integration overview

Who can run MEV-Boost?

MEV-Boost is a piece of software that any PoS Ethereum node operator (including solo validators) can run as part of their Beacon Client software. It isย compatible with any Ethereum consensus client. Support and installation instructions for each client can be found here.


See also:


Table of Contents


Background

MEV is a centralizing force on Ethereum. Unattended, the competition for MEV opportunities leads to consensus security instability and permissioned communication infrastructure between traders and block producers. This erodes neutrality, transparency, decentralization, and permissionlessness.

Proposer/block-builder separation (PBS) was initially proposed by Ethereum researchers as a response to the risk that MEV poses to decentralization of consensus networks. They have suggested that uncontrolled MEV extraction promotes economies of scale which are centralizing in nature, and complicate decentralized pooling.

In the future, proposer/builder separation will be enshrined in the Ethereum protocol itself to further harden its trust model.

Read more in Why run MEV-Boost? and in the Frequently Asked Questions.

Installing

The most common setup is to install MEV-Boost on the same machine as the beacon client. Multiple beacon-clients can use a single MEV-Boost instance. The default port is 18550.

See also Rรฉmy Roy's guide for comprehensive instructions on installing, configuring and running MEV-Boost.

Binaries

Each release includes binaries from Linux, Windows and macOS. You can find the latest release at https://github.com/flashbots/mev-boost/releases

From source

Requires Go 1.18+.

go install

Install the latest MEV-Boost release with go install:

go install github.com/flashbots/mev-boost@latest
mev-boost -help

Clone and Build

Ensure you are downloading the most updated MEV-Boost release. Releases are available at https://github.com/flashbots/mev-boost/releases

clone the repository and build it:

# By default, the develop branch includes ongoing merged PRs a future release.
git clone https://github.com/flashbots/mev-boost.git
cd mev-boost

# You can use the stable branch, which is always updated with the latest released version
git checkout stable

# If you want to build a specific release, check out the tag. See also https://github.com/flashbots/mev-boost/releases
git checkout tags/YOUR_VERSION

# Build most recent version of MEV-Boost
make build

# Show help. This confirms MEV-Boost is able to start
./mev-boost -help

From Docker image

We maintain a MEV-Boost Docker images at https://hub.docker.com/r/flashbots/mev-boost

# Get the MEV-Boost image
docker pull flashbots/mev-boost:latest

# Run it
docker run flashbots/mev-boost -help

Systemd configuration

You can run MEV-Boost with a systemd config like this:

/etc/systemd/system/mev-boost.service
[Unit]
Description=mev-boost
Wants=network-online.target
After=network-online.target

[Service]
User=mev-boost
Group=mev-boost
WorkingDirectory=/home/mev-boost
Type=simple
Restart=always
RestartSec=5
ExecStart=/home/mev-boost/bin/mev-boost \
        -relay-check \
        -relay YOUR_RELAY_CHOICE_A \
        -relay YOUR_RELAY_CHOICE_B \
        -relay YOUR_RELAY_CHOICE_C

[Install]
WantedBy=multi-user.target

Usage

A single MEV-Boost instance can be used by multiple beacon nodes and validators.

Aside from running MEV-Boost on your local network, you must configure:

  • individual beacon nodes to connect to MEV-Boost. Beacon Node configuration varies by Consensus client. Guides for each client can be found on the MEV-boost website.
  • individual validators to configure a preferred relay selection. Note: validators should take precautions to only connect to trusted relays. Read more about the role of relays here.

Lists of available relays are maintained by

Note on usage documentation

The documentation in this README reflects the latest state of the main branch, which may have cli flags or functionality not present in the latest release.

Please take a look at the specific release documentation about the available command line flags: https://github.com/flashbots/mev-boost/releases

Mainnet

Run MEV-Boost pointed at a mainnet relay:

./mev-boost -relay-check -relay URL-OF-TRUSTED-RELAY

Goerli testnet

Run MEV-Boost pointed at a Goerli relay:

./mev-boost -goerli -relay-check -relay URL-OF-TRUSTED-RELAY

Sepolia testnet

Run MEV-Boost pointed at a Sepolia relay:

./mev-boost -sepolia -relay-check -relay URL-OF-TRUSTED-RELAY

test-cli

test-cli is a utility to execute all proposer requests against MEV-Boost + relay. See also the test-cli readme.

mev-boost cli arguments

These are the CLI arguments for the develop branch. For arguments available in a specific release, check the release page.

$ ./mev-boost -help
Usage of mev-boost:
  -addr string
        listen-address for mev-boost server (default "localhost:18550")
  -debug
        shorthand for '-loglevel debug'
  -genesis-fork-version string
        use a custom genesis fork version
  -goerli
        use Goerli
  -json
        log in JSON format instead of text
  -log-no-version
        disables adding the version to every log entry
  -log-service string
        add a 'service=...' tag to all log messages
  -loglevel string
        minimum loglevel: trace, debug, info, warn/warning, error, fatal, panic (default "info")
  -mainnet
        use Mainnet (default true)
  -min-bid float
        minimum bid to accept from a relay [eth]
  -relay value
        a single relay, can be specified multiple times
  -relay-check
        check relay status on startup and on the status API call
  -relay-monitor value
        a single relay monitor, can be specified multiple times
  -relay-monitors string
        relay monitor urls - single entry or comma-separated list (scheme://host)
  -relays string
        relay urls - single entry or comma-separated list (scheme://pubkey@host)
  -request-timeout-getheader int
        timeout for getHeader requests to the relay [ms] (default 950)
  -request-timeout-getpayload int
        timeout for getPayload requests to the relay [ms] (default 4000)
  -request-timeout-regval int
        timeout for registerValidator requests [ms] (default 3000)
  -sepolia
        use Sepolia
  -version
        only print version

-relays vs -relay

There are two different flags for specifying relays: -relays and -relay. The -relays flag is a comma separated string of relays. On the other hand, the -relay flag is used to specify a single relay, but can be used multiple times for multiple relays. Use whichever method suits your preferences.

These two MEV-Boost commands are equivalent:

./mev-boost -relay-check \
    -relays $YOUR_RELAY_CHOICE_A,$YOUR_RELAY_CHOICE_B,$YOUR_RELAY_CHOICE_C
./mev-boost -relay-check \
    -relay $YOUR_RELAY_CHOICE_A \
    -relay $YOUR_RELAY_CHOICE_B \
    -relay $YOUR_RELAY_CHOICE_C

Setting a minimum bid value with -min-bid

The -min-bid flag allows setting a minimum bid value. If no bid from the builder network delivers at least this value, MEV-Boost will not return a bid to the beacon node, making it fall back to local block production.

Example for setting a minimum bid value of 0.06 ETH:

./mev-boost \
    -min-bid 0.06 \
    -relay $YOUR_RELAY_CHOICE_A \
    -relay $YOUR_RELAY_CHOICE_B \
    -relay $YOUR_RELAY_CHOICE_C

API

mev-boost implements the latest Builder Specification.

sequenceDiagram
    participant consensus
    participant mev_boost
    participant relays
    Title: Block Proposal
    Note over consensus: validator starts up
    consensus->>mev_boost: registerValidator
    mev_boost->>relays: registerValidator
    Note over consensus: wait for allocated slot
    consensus->>mev_boost: getHeader
    mev_boost->>relays: getHeader
    relays-->>mev_boost: getHeader response
    Note over mev_boost: verify response matches expected
    Note over mev_boost: select best payload
    mev_boost-->>consensus: getHeader response
    Note over consensus: sign the header
    consensus->>mev_boost: submitBlindedBlock
    Note over mev_boost: identify payload source
    mev_boost->>relays: submitBlindedBlock
    Note over relays: validate signature
    relays-->>mev_boost: submitBlindedBlock response
    Note over mev_boost: verify response matches expected
    mev_boost-->>consensus: submitBlindedBlock response

Maintainers

Contributing

You are welcome here <3.

  • If you have a question, feedback or a bug report for this project, please open a new Issue.
  • If you would like to contribute with code, check the CONTRIBUTING file for further info about the development environment.
  • We just ask you to be nice. Read our code of conduct.

Security

If you find a security vulnerability in this project or any other initiative related to proposer/builder separation in ethereum, please let us know sending an email to [email protected]. Refer to the SECURITY file for details.

Bug Bounty

We have a bug bounty program! Get up to $25k USD for a critical vulnerability.

We would like to welcome node operators, builders, searchers, and other participants in the ecosystem to contribute to this bounty pool to help make the ecosystem more secure.

Audits

License

The code in this project is free software under the MIT License.

Logo by @lekevicius on CC0 license.

More Repositories

1

pm

Everything there is to know about Flashbots
2,482
star
2

simple-arbitrage

Example arbitrage bot using Flashbots
TypeScript
1,963
star
3

mev-research

Project management for MEV Research
884
star
4

mev-inspect-py

๐Ÿ”Ž an MEV inspector for Ethereum ๐Ÿ”Ž
Python
819
star
5

mev-job-board

Need a bot?
727
star
6

ethers-provider-flashbots-bundle

Flashbots provider for ethers.js
TypeScript
548
star
7

mev-inspect-rs

Discover historic Miner Extractable Value (MEV) opportunities
Rust
548
star
8

mev-boost-relay

MEV-Boost Relay for Ethereum proposer/builder separation (PBS)
Go
417
star
9

builder

Flashbots MEV-Boost Block Builder
Go
409
star
10

web3-flashbots

Web3.py plugin for using Flashbots' bundle APIs
Python
405
star
11

searcher-sponsored-tx

TypeScript
360
star
12

simple-blind-arbitrage

Solidity
343
star
13

searcher-minter

Solidity
229
star
14

mempool-dumpster

Dump all the mempool transactions ๐Ÿ—‘๏ธ โ™ป๏ธ (in Parquet + CSV)
Go
206
star
15

flashbots-docs

TypeScript
190
star
16

suave-geth

Go
188
star
17

rpc-endpoint

Flashbots RPC endpoint, to be used with wallets (eg. MetaMask)
Go
180
star
18

mev-share

Protocol for orderflow auctions
129
star
19

mev-share-client-ts

Client library for Flashbots MEV-share Matchmaker.
TypeScript
116
star
20

hindsight

Retroactively estimate Uniswap-ish MEV on Flashbots MEV-Share by simulating backrun-arbitrages.
Rust
116
star
21

mev-flood

simulates MEV activity from an array of unique searchers; used for testing infra
TypeScript
112
star
22

mev-relay-js

JavaScript
105
star
23

mev-geth-demo

JavaScript
98
star
24

boost-geth-builder

Example builder
Go
93
star
25

mev-share-node

Go
88
star
26

geth-sgx-gramine

Geth-in-SGX provides an example of running go-ethereum in SGX
C
68
star
27

relayscan

Ethereum MEV-Boost Relay Monitoring
Go
67
star
28

eth2-research

Assessing the nature and impact of MEV in eth2.
Jupyter Notebook
66
star
29

mpc-backrun

Proof-of-concept code for backrunning private transactions using MPC.
Python
63
star
30

mev-explore-public

Public repo of MEV-Explore for the community to jam on the dashboard
59
star
31

suapp-examples

SUAVE Application Examples
Go
54
star
32

simple-limit-order-bot

TypeScript
53
star
33

raytracing

Eth2-MEV project with liquid staking (Flashbots-Lido-Nethermind)
Go
52
star
34

builder-playground

Local end-to-end environment for Ethereum L1 block building
Go
51
star
35

reorg-monitor

Ethereum Reorg Monitoring
Go
44
star
36

block-validation-geth

To be deprecated in favor of https://github.com/flashbots/builder
Go
44
star
37

suave-std

Collection of helpful smart contracts to build Suapps
Solidity
43
star
38

rollup-boost

Sidecar to Enable Rollup Extensions
Rust
42
star
39

go-boost-utils

Eth2 builder API types and signing for Golang
Go
41
star
40

suave-specs

โ˜€๏ธ SUAVE Alpha Protocol Specifications
35
star
41

prysm

Our custom Prysm fork for boost relay and builder CL. Sends payload attributes for block building on every slot to trigger building.
Go
34
star
42

sync-proxy

Proxy from consensus client to block builders
Go
33
star
43

go-template

Template for Go projects
Go
33
star
44

suave-viem

Typescript client library to interact with SUAVE.
TypeScript
32
star
45

dowg

Decentralized Orderflow Working Group
31
star
46

suave-andromeda-revm

Andromeda revm execution service
Rust
29
star
47

relay-specs

MEV-Boost Relay API Specs
HTML
28
star
48

prio-load-balancer

Priority JSON-RPC load balancer (with retries, good logging, and other goodies like SGX/SEV attestation support)
Go
27
star
49

mev-proxy

JavaScript
18
star
50

contender

Generate high-volume state contention on EVM-like networks.
Rust
18
star
51

andromeda-sirrah-contracts

forge development env for SUAVE key management
Solidity
18
star
52

flashbots-repository-template

Template to bootstrap and configure new projects maintained by the Flashbots collective
17
star
53

mev-blocks

JavaScript
17
star
54

flashbots-dashboard

TypeScript
17
star
55

flashbots-writings-website

MDX
15
star
56

EIP-712-swap-PoC

Solidity
11
star
57

go-utils

Various reusable Go utilities and modules
Go
11
star
58

eth-sparse-mpt

Caching sparse Merkle Patricia Trie for reth.
Rust
7
star
59

flashbots-airflow-workflows

Python
6
star
60

curve-based-bundle-pricing

Jupyter Notebook
6
star
61

dealer-smart-contract

Integral DEX smart contract
TypeScript
6
star
62

flashbots-data-transparency

Collection, analysis and presentation of Flashbots data.
JavaScript
6
star
63

suave-docs

TypeScript
6
star
64

gramine-andromeda-revm

Python
5
star
65

mev-inspect-logs

Log-based MEV inspections
JavaScript
5
star
66

aleth

C++
5
star
67

research-mev-eip1559

Jupyter Notebook
4
star
68

web3-data-tools

Data tools for Web3
Jupyter Notebook
3
star
69

node-healthchecker

Composite health (sync status) checker for blockchain nodes
Go
3
star
70

yocto-manifests

Repo Manifests for the Yocto Project Build System for reproducible TEE builds
Makefile
3
star
71

builder-olympics-website

HTML
2
star
72

suave-toolchain

JavaScript
2
star
73

protect-explorer

A dashboard designed to illuminate the savings Protect users are enjoying.
TypeScript
2
star
74

prometheus-sns-lambda-slack

Receive prometheus alerts via AWS SNS and publish then to slack channel
Go
2
star
75

flashbots-toolchain

GitHub action to install Flashbots tools
JavaScript
2
star
76

nginx-static-response

nginx image that returns a fixed status code
Dockerfile
1
star
77

yocto-scripts

Shell
1
star
78

rbuilder-relay-measurement

A script to pull data for a specific block number and builder public key from the relay and compare them against those from the builder logs
Python
1
star
79

revm

Revm suited for suave needs
Rust
1
star
80

kube-sidecar-injector

Sidecar injector for k8s
Go
1
star
81

eth-faucet

Faucet for ethereum based chains
Go
1
star