Skip to content

Instantly share code, notes, and snippets.

@sambacha
Created November 10, 2022 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sambacha/43d2a09de63ec21deaa12259fcc82d3b to your computer and use it in GitHub Desktop.
Save sambacha/43d2a09de63ec21deaa12259fcc82d3b to your computer and use it in GitHub Desktop.
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 2 column 129
---
title: Effective DoS of mev-boost-relay
description: it is possible to 'block' bids from other block builders on the relay by offering a block with only one transaction: transferring high reward (e.g. 1 ETH) to the reward address.
author: Dragan Milic
source: Manifold Finance
---

Effective DoS of mev-boost-relay

11/03/2022

Context

mev-boost-relay acts as a market place matching block builders with blocks proposers (validators). Block proposers register with the mev-boost-relay by submitting their preferred gas limit and reward address.

Block builders fetch this information from the relay at the start of the slot and submit one or more blocks containing reward for the requested reward address of the block proposer. Relay checks each block submission for

  • validity of the block by replaying all transaction and comparing states before and after
  • transactions involving OFAC blacklisted addresses
  • transaction containing reward to the reward address being present and matching the declared reward

Block proposer keeps polling the relay to get the latest best bid. At every request only the current best bid out of all the submitted blocks is returned. The bid itself is a 'blinded' block - containing just enough data to sign the block, but not enough to get the block's payload. The best bid is determined solely by the amount of the reward to the block proposer's reward address.

When deadline for submitting the block has been reached, block proposer chooses the best bid seen and unblinds it by submit a block signature for it. In return block proposer gets the complete signed block including the block payload to the block proposer.

Attack

Submitting a block containing only one transaction with a high bid to the reward address of the block proposer practically 'blocks' all other bids from being returned to the block proposer.

For some reason, (this needs further investigation; probably block gas used being extremely low) block proposers seem not to sign the proposed block and hence ignoring that relay as long as such a block is being offered.

Impact

We have tested this attack on Flashbot's Goerli relay and were successful at blocking any blocks being included in the Goerli testnet from Flashbot's relay for more than 30 minutes.

In theory, attacker would be risking loosing the reward, but can mitigate this by periodically submitting small transactions to increase the nonce of the sender of the reward.

Proposed mitigation

Validate the assumption that there is a lower limit of gas used on the block in validator clients, determine the lower gas limit and enforce this on the relay when accepting the blocks from the block builders.

@metachris
Copy link

metachris commented Nov 10, 2022

Your point seems to be that proposers wouldn't sign a bid that only contains a single transaction. But proposers do not see the number of transactions as part of the bid.

  • There's previously been instances on mainnet with blocks coming through relays containing only a single transaction, for instance https://twitter.com/MevRefund/status/1573416023998578703
  • On Sepolia there's been over 8000 slots with only a single transaction successfully filled through the Flashbots relay

Could you follow this up with supporting data, for instance the transaction hash or slot numbers you've been trying this?

@sambacha
Copy link
Author

Your point seems to be that proposers wouldn't sign a bid that only contains a single transaction. But proposers do not see the number of transactions as part of the bid. And there's also been instances on mainnet with blocks with only a single transaction: twitter.com/MevRefund/status/1573416023998578703

On Sepolia there's been over 8000 slots with only a single transaction successfully filled through our relay too.

Could you follow this up with supporting data, for instance the transaction hash or slot numbers you've been trying this?

https://goerli.beaconcha.in/slot/4241418

@metachris
Copy link

https://goerli.beaconcha.in/slot/4241418

In what way is this link helpful?

@metachris
Copy link

After investigating this report, we identified incorrect timestamps in the ExecutionPayloadHeader as a possible cause for proposers falling back to local block production. This has been fixed in the Flashbots relay in flashbots/mev-boost-relay#241 and flashbots/mev-boost-relay#242.

Thanks for the report, and the engineers assisting in the discoveries and resolutions 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment