Skip to content

Instantly share code, notes, and snippets.

@metachris
Last active July 18, 2024 02:59
Show Gist options
  • Save metachris/66df812f2920e6b0047afb9fdaf7df91 to your computer and use it in GitHub Desktop.
Save metachris/66df812f2920e6b0047afb9fdaf7df91 to your computer and use it in GitHub Desktop.
Docs for running mev-boost relay + builder in devnets

Notes on running mev-boost relay + builder in devnets

Running mev-boost-relay


Builder + mev-flood

To make the builder land transactions, send bundles to the builder using https://github.com/flashbots/mev-flood

  • We'll put mev-flood into a Docker image
  • there's no docker image yet so there are several steps:
Building and installing dependencies:
git clone https://github.com/flashbots/mev-flood.git

yarn install

yarn build

Setup an env file with private key of funded wallet, chain_id and EL endpoint:
cp .env .env.mainnet # name of testnet
export NODE_ENV=mainnet

Funding wallets
yarn script.fundWallets

Sending Bundles:
yarn dumb-dev 0 5

Using unnamed devnets

mev-boost

mev-boost only requires the genesis fork version of a particular network, which can be configured with the GENESIS_FORK_VERSION environment variable, or -genesis-fork-version cli argument.

You can disable verification of relay signatures on the bids with SKIP_RELAY_SIGNATURE_CHECK=1 (in order to avoid configuring the specific relay public key). See also flashbots/mev-boost#499

Also set the genesis timestamp with GENESIS_TIMESTAMP, which is used for logging how late into the slot the requests were started.

mev-boost-relay

The relay requires a number of testnet parameters, which you can set the following way:

  • run the services with --network=custom
  • set the following environment variables
    • GENESIS_FORK_VERSION
    • GENESIS_VALIDATORS_ROOT
    • BELLATRIX_FORK_VERSION
    • CAPELLA_FORK_VERSION

See also:

[Unit]
Description=Geth Builder
After=network.target
Wants=network.target
[Service]
User=ubuntu
Group=ubuntu
Type=simple
Restart=always
RestartSec=5
TimeoutStopSec=600
Environment="BUILDER_TX_SIGNING_KEY=_COINBASE_ECDSA_PRIVKEY_"
ExecStart=/home/ubuntu/builder/build/bin/geth \
--sepolia \
--datadir /var/lib/goethereum \
--http \
--http.api="engine,eth,web3,net,debug,flashbots" \
--ws \
--ws.api="engine,eth,web3,net,debug" \
--http.corsdomain "*" \
--http.addr "0.0.0.0" \
--authrpc.jwtsecret=/var/lib/goethereum/jwtsecret \
--override.shanghai 1677557088 \
--builder \
--builder.beacon_endpoint="http://127.0.0.1:3500" \
--builder.genesis_fork_version=0x90000069 \
--builder.bellatrix_fork_version=0x90000071 \
--builder.genesis_validators_root=0xd8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078 \
--builder.secret_key=_BLS_SECRET_KEY_BUILDER_ \
--builder.remote_relay_endpoint=http://127.0.0.1:9062 \
--miner.extradata "Illuminate Dmocratize Dstribute" \
--miner.algotype="greedy" \
--bootnodes "enode://9246d00bc8fd1742e5ad2428b80fc4dc45d786283e05ef6edbd9002cbc335d40998444732fbe921cb88e1d2c73d1b1de53bae6a2237996e9bfe14f871baf7066@18.168.182.86:30303,enode://ec66ddcf1a974950bd4c782789a7e04f8aa7110a72569b6e65fcd51e937e74eed303b1ea734e4d19cfaec9fbff9b6ee65bf31dcb50ba79acce9dd63a6aca61c7@52.14.151.177:30303"
[Install]
WantedBy=default.target
[Unit]
Description=Relay - API
After=network.target
Wants=network.target
[Service]
User=ubuntu
Group=ubuntu
Type=simple
Restart=always
RestartSec=5
TimeoutStopSec=180
ExecStart=/home/ubuntu/boost-relay/mev-boost-relay api \
--network=sepolia \
--pprof \
--debug \
--secret-key=_BLS_SECRET_KEY_RELAY_ \
--db=postgres://postgres:_POSTGRES_PWD_@boostrelay.rds.internal:5432/boostrelay
Environment="DB_TABLE_PREFIX=sepolia"
Environment="DISABLE_PAYLOAD_DATABASE_STORAGE=1"
Environment="MEMCACHED_URIS=localhost:11211"
Environment="LOG_LEVEL=debug"
[Install]
WantedBy=default.target
[Unit]
Description=Relay - Housekeeper
After=network.target
Wants=network.target
[Service]
User=ubuntu
Group=ubuntu
Type=simple
Restart=always
RestartSec=5
TimeoutStopSec=180
ExecStart=/home/ubuntu/boost-relay/mev-boost-relay housekeeper \
--network=sepolia \
--db=postgres://postgres:_POSTGRES_PWD_@boostrelay.rds.internal:5432/boostrelay
Environment="DB_TABLE_PREFIX=sepolia"
Environment="LOG_LEVEL=debug"
[Install]
WantedBy=default.target
[Unit]
Description=Relay - Website
After=network.target
Wants=network.target
[Service]
User=ubuntu
Group=ubuntu
Type=simple
Restart=always
RestartSec=5
TimeoutStopSec=180
ExecStart=/home/ubuntu/boost-relay/mev-boost-relay website \
--network=sepolia \
--db=postgres://postgres:_POSTGRES_PWD_@boostrelay.rds.internal:5432/boostrelay
Environment="DB_TABLE_PREFIX=sepolia"
Environment="RELAY_URL=https://0x845bd072b7cd566f02faeb0a4033ce9399e42839ced64e8b2adcfc859ed1e8e1a5a293336a49feac6d9a5edb779be53a@boost-relay-sepolia.flashbots.net"
Environment="LINK_BEACONCHAIN="
Environment="LINK_ETHERSCAN=https://sepolia.etherscan.io"
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment