Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miner: adding MEV to validator #1648

Conversation

Uri-Margalit-bloXroute
Copy link

Description

This PR allows a validator node to utilize bloXroute MEV services. The validator node

  • registers itself to MEV relay upon restart or an epoch change
  • processes eth_proposedBlock from MEV relays

Rationale

The introduction of mev-boost in Ethereum enabled a win-win situation for Searchers, Block builders and Proposers which allows all three to profit off of potential arbitrage opportunities, and do so not at the expense of other traders and dApps executing transactions on chain.

This PR implements the validator to MEV relay integration

Example

eth_proposedBlock endpoint receives

{
   "id": "1",
   "method": "eth_proposedBlock",
   "params": [{
      "blockNumber": "0xba10d0",
      "prevBlockHash": "0xabc123...555",
      "blockReward": 1230000000000000,
      "gasLimit": 140000000,
      "gasUsed": 70000000,
      "payload": ["ab..ab", "cd..cd"],
   }]
}

Changes

Notable changes:

  • Added couple of startup argument
    • miner.mevrelays - list of uris of MEV relays the validator works with
    • miner.mevproposedblockuri - the callback uri which the MEV relay should send the proposed blocks
  • Added web3 endpoint eth_proposedBlock - the MEV relays use this endpoint to send their proposed blocks
  • Added a logic in the miner to validate the proposed blocks from the MEV relays and consider them when the validator choose which block it should propose

@Uri-Margalit-bloXroute Uri-Margalit-bloXroute changed the base branch from master to develop May 25, 2023 08:10
@Uri-Margalit-bloXroute Uri-Margalit-bloXroute marked this pull request as ready for review May 25, 2023 08:10
@Uri-Margalit-bloXroute
Copy link
Author

@brilliant-lx , is there an option to rerun the Unit test?

@Uri-Margalit-bloXroute Uri-Margalit-bloXroute changed the base branch from develop to master May 30, 2023 14:15
@kaber2
Copy link

kaber2 commented Jun 12, 2023

According to https://bloxroute.com/pricing/, this requires a subscription costing at least $1250/month. My personal opinion is, its a bad idea to integrate proprietary services into the reference code base for BSC. There's a maintenance cost and a risk of bugs while having zero benefit unless you're willing to shell out quite a lot of money to Bloxroute.

Validators can easily add this patch themselves.

brilliant-lx and others added 5 commits June 12, 2023 13:56
this PR: bnb-chain#936 upgraded the goleveldb
indirectly, since it has dependency of prysm, which also depends on goleveldb indrectly.

But the new version has some performance issue on Databse Close, see:
syndtr/goleveldb#434

So we need to rollback to the previous verison
@github1youlc
Copy link

This will provide convenience for sandwich attack, front-running attack, is it a good thing?
Can your solution consider the suffering of the normal traders on BSC.

@kaber2
Copy link

kaber2 commented Jun 12, 2023

The introduction of mev-boost in Ethereum enabled a win-win situation for Searchers, Block builders and Proposers which allows all three to profit off of potential arbitrage opportunities, and do so not at the expense of other traders and dApps executing transactions on chain.

Just to be very clear about this. There is no win-win and this is a false narrative. For searchers, sure, it enables the ones too lazy to do a proper implementation to cheat their way to a successful trade, for now. The long term economic incentives are purely in favor of miners/validators. Any kind of easily accessible block manipulation for a bribe results in a race to the bottom (top), who offers the most to the block producer. The end result can only be searchers offering anything they can without going bankrupt. This in effect has a great effect on many protocols, which rely on external transactors to keep prices in balance, clear out bad debt, ... The end result will be that most searchers will go out of business and these vital transactions will be highly centralized.

There is no win-win here, just win, and in my opinion, you trying to externalize your costs while pocketing the gains should just shove off.

@brilliant-lx brilliant-lx changed the base branch from master to develop June 14, 2023 07:06
@brilliant-lx
Copy link
Collaborator

@brilliant-lx , is there an option to rerun the Unit test?

@Uri-Margalit-bloXroute sorry, missed the message, UT can be rerun just click into the failed page, there will be a rerun icon. And could you rebase to the latest develop branch?

@unclezoro unclezoro changed the base branch from develop to master June 14, 2023 14:45
@Jolly23
Copy link
Contributor

Jolly23 commented Jun 17, 2023

Good, let’s make BSC even worse

@Jolly23
Copy link
Contributor

Jolly23 commented Jun 17, 2023

It is fucking ridiculous to put this shit inside BSC official repo. To force searchers to buy your $1250 stupid monthly subscription shit.
Couldn’t you find a restroom?

@lst15
Copy link

lst15 commented Jun 19, 2023

I don't think it's a good idea because it will benefit the subscription sellers and those who purchase the $1250 subscription

@48ClubIan
Copy link

Why on earth do you think it is proper to embed a specific mev service provider's code into official repo ?

Maintain your own repo.

@giovannicarlos77
Copy link

I think it’s a bad ideia, benefiting just people that bought 1250$/monthly plan.

@Jolly23
Copy link
Contributor

Jolly23 commented Jul 13, 2023

commit shits non-stop

@Uri-Margalit-bloXroute
Copy link
Author

moving the PR to a different place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants