githubEdit

πŸ’°Guide | MEV-boost for Ethereum Staking

Quickstart guide to setting up MEV-boost for your ETH validator.

triangle-exclamation

❓What is mev-boost?

  • Enables solo and home stakers access to MEV, Maximal Extractible Value.

  • Enables validators to earn higher block rewards.

  • Optional and not required for ETH staking.

  • Open source middleware run by validators to access a competitive block-building market.

  • Built by Flashbots as an implementation of proposer-builder separation (PBS)arrow-up-right for proof-of-stake (PoS) Ethereum.

  • home-staker (you) >> mevboost >> relay >> builder >> searcher +/- frontrun/sandwich += efficient markets :)

circle-info

tldr: As of August 2023, MEV is estimated be 24% of a validator rewards. Other estimates suggest it can boost staking rewards by over 60%.arrow-up-right

Estimated earnings per validator. Source: https://ultrasound.moneyarrow-up-right

βš’οΈ How to MEV?

circle-exclamation

Step 1: Create mevboost service account

The systemd service will run under this account, mevboost

Step 2: Install mevboost

  • Downloading binaries is often faster and more convenient.

  • Building from source code can offer better compatibility and is more aligned with the spirit of FOSS (free open source software).

chevron-rightOption 1 - Download binarieshashtag

Run the following to automatically download the latest linux release, un-tar and cleanup.

Install the binaries.

chevron-rightOption 2 - Build from source codehashtag

Install build dependencies.

Install Go and removing any previous Go installations.

Verify that you've installed Go 1.18+ by printing the version information.

Install mev-boost with go install

Install binaries to /usr/local/bin and update ownership permissions.

Create the mevboost systemd unit file.

The ExecStart line lists relays: Flashbots, UltraSound, Aestus, bloXroute Max Profit, WenMerge. Remove or add other relays according to your preferences. Add as many or as few relays as you wish.

Paste the following into your mevboost.service file. To exit and save from the nano editor, press Ctrl + X, then Y, thenEnter.

circle-info

Notes about configration:

Installation location: Mevboost communiates with the consensus client and should be installed on the same machine as your consensus client.

-addr: set this to 0.0.0.0:18550 if your mevboost is installed on a different machine than your consensus client. Update firewall rules if needed.

-min-bid: you can set a minimum bid value in ETH.

  • If all relays cannot bid higher than your minimum value, then your local execution client will produce the block.

  • By setting this value, you can capture MEV opportunities for higher value blocks and maintain a degree of control for local block production which helps strengthen censorship resistance and a neutral Ethereum network.

Reload systemctl to pickup the new service file.

circle-info

Good to know: If you add or remove relay endpoints, you'll need to re-run this systemctldaemon-reload command and restart the mevboost services.

Enable mevboost to automatically startup at system reboots and start the service.

Check that the service started successfully.

Sample of systemd logs showing mevboost running nominally.

View Logs with the following command:

Sample of logs showing mevboost running nominally.

Step 3: Update consensus client and validator

circle-info

Both the consensus layer client and validator will require additional Builder API flags.

Consensus Client Layer Changes (beacon chain)

Add the appropriate flag to the ExecStart line of your consensus client service file.

Select the tab appropriate to your staking setup.

To exit and save from the nano editor, press Ctrl + X, then Y, thenEnter.

For example, here is the expected result of an updated ExecStart line of a V2 Staking Setup Prysm consensus client service file.

Flag is added on the last line.

When adding a new line, notice that previous lines require a backslash \

Validator Client Changes

If required, add the appropriate flag to the ExecStart line of your validator client service file. To exit and save from the nano editor, press Ctrl + X, then Y, thenEnter.

For example, here is the expected result of an updated ExecStart line of a V2 Staking Setup Prysm validator client service file.

Flag is added on the last line.

When adding a new line, notice that previous lines require a backslash \

After configuring your consensus client and validator to enable mevboost, reload and restart your services. Finally, verify your logs look error-free and show use of the new MEV configurations.

Lighthouse, Lodestar, Prysm

Teku or Nimbus

circle-check

🎯 How to Update MEV-boost

Update to the latest release with the following commands.

Review the latest MEV-boost release notesarrow-up-right for new requirements or breaking changes.

chevron-rightOption 1 - Download binarieshashtag

Run the following to automatically download the latest linux release, un-tar and cleanup.

Stop the service, install the binaries and start the service.

Verify the new version number.

chevron-rightOption 2 - Build from source codehashtag

Compile new binaries and stop the service.

Install new binaries and start the service.

Verify the new version number.

πŸ—‘οΈ Uninstalling MEV-boost

Finally, remove the Builder API changes made in step 3 to your consensus client and validator.

❓ FAQ

chevron-rightHow do I verify I'm registered with my relays?hashtag

Verify that your validator is registered with a particular relay by making a request to the relay's API.

You can either manually query the relay's API or use dabauxi's Check MEV-Boost Relay Registration scriptarrow-up-right.

Check MEV-Boost Relay Registration by dabauxi

Review notes and source code herearrow-up-right. Requires python.

Sample output showing your validator's registration to relays.

Check Manually

For example, to verify that your validator is registered with the flashbots relay, enter the following URL into your browser. Replace <myPubKey> with the public key of your validator and you will see registration data such as your fee recipient address.

Sample command:

Sample output:

chevron-rightWhere will I get MEV-boost payments?hashtag

When a block is produced using MEV-boost, you may receive your payment in 1 of 3 ways.

Specifically, your MEV payment may arrive as:

1) by setting you as the block's Fee Recipient

2) an internal transaction

3) or a normal transaction

chevron-rightWhy run MEV-boost?hashtag

Refer to this article by Stephane Gosslinarrow-up-right, which explains the benefits of MEV-boost to the network and you, as a validator.

chevron-rightHow does MEV-boost work?hashtag
  • Ethereum stakers must run three pieces of software: a validator client, consensus client, and an execution client.

  • MEV-boost is 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.

chevron-rightWhat are the risks of running MEV-boost?hashtag
  • Adding more relays increases risk of adding a "bad" relay (hacked, withholds bid, performance issues) and causes your validator to miss a proposal.

  • More relays = more chance of getting a high-bid block however this also increases chance of getting rugged by "bad" relays and missing a proposal.Requires trust that relays and block builders will act honestly. MEV is not yet a trust-less process until there is protocol-level proposer-builder-separation (PBS).

Detailed explanation: https://writings.flashbots.net/writings/understanding-mev-boost-liveness-risksarrow-up-right

Summary of risks: Only add relays you trust.

chevron-rightWhat's the real-time status of MEV?hashtag

Track network participation, recent MEV blocks, top relays and block builders at https://www.mevboost.orgarrow-up-right

chevron-rightI'm using multiple relays. Which one is chosen?hashtag

If multiple relays are available, the relay bidding highest MEV reward will be chosen. If all relays are not available, the local execution client builds the block without MEV.

chevron-rightWhat's makes a MEV relay ethical or not?hashtag

Based on varying degrees of profit or censorship, MEV relays can decide on what transactions to bundle in a block.

  • Ethical relays: will not censor transactions or profit from front running / sandwich attacks, which is harmful to everyday users on Ethereum.

  • OFAC relays: will censor transactions according to the OFAC list.

  • Maximal profit relays: profit is all that matters, ethics have no meaning.

chevron-rightDo I need to open any incoming ports on the firewall?hashtag

No changes needed. mevboost only makes outgoing tcp calls.

⏭️ Next Steps

πŸ“š References

πŸ‘ Credits

Inspired by Remyroy's Guide on how to Prepare for The Mergearrow-up-right

Last updated