attestantio / vouch

Apache License 2.0
112 stars 28 forks source link

[Feature Request] Allow setting a minimum bid to accept a block from a relay #102

Closed ThomasDalla closed 1 year ago

ThomasDalla commented 1 year ago

Summary

Add a minimum bid parameter to the MEV strategy to allow setting a minimum bid to accept a block from a relay.\ Ideally a top-level minimum bid as well as overrides per relay.

Motivation and Context

https://github.com/flashbots/mev-boost/issues/273

Implemented in https://github.com/flashbots/mev-boost/pull/274

mcdee commented 1 year ago

This feature should now be available in the https://github.com/attestantio/vouch/tree/execution-config-v2 branch. If possible, please compile this branch and run it in your test environment to confirm that it meets your requirement. If not, please read https://github.com/attestantio/vouch/blob/execution-config-v2/docs/executionconfig.md for the same.

ThomasDalla commented 1 year ago

That sounds perfect.

I'm currently running from docker, so would be easier if there was a docker tag I could use. I have less than 10 validators running Vouch on Prater so might take some time until I propose blocks above/below the min_value to confirm.

mcdee commented 1 year ago

Please try attestant/vouch:execution-config-v2

mcdee commented 1 year ago

Any feedback on this PR? I'm looking to merge it in the coming week so any information you may have on it would be appreciated.

ThomasDalla commented 1 year ago

I successfully proposed a block with the attestant/vouch:execution-config-v2 version on Xmas' eve, which included MEV as it was above the min bid (0.02): https://goerli.beaconcha.in/slot/1b84d33040e60e46b2f83b23382288d6beec94941a03fc026b4c05a44609d7ae

$ grep -i auction vouch/vouch.log  
{"level":"info","service":"blockrelay","impl":"standard","slot":4613298,"provider":"https://goerli.aestus.live/","value":"23221651614781128","delta":"6620629274202978","selected":false,"time":"2022-12-24T08:39:36+01:00","message":"Auction participant"}
{"level":"info","service":"blockrelay","impl":"standard","slot":4613298,"provider":"https://goerli-relay.securerpc.com/","value":"23227280889392106","delta":"6614999999592000","selected":false,"time":"2022-12-24T08:39:36+01:00","message":"Auction participant"}
{"level":"info","service":"blockrelay","impl":"standard","slot":4613298,"provider":"https://builder-relay-goerli.flashbots.net/","value":"22870606090155901","delta":"6971674798828205","selected":false,"time":"2022-12-24T08:39:36+01:00","message":"Auction participant"}
{"level":"info","service":"blockrelay","impl":"standard","slot":4613298,"provider":"https://builder-relay-goerli.blocknative.com/","value":"23227280889168106","delta":"6614999999816000","selected":false,"time":"2022-12-24T08:39:36+01:00","message":"Auction participant"}
{"level":"info","service":"blockrelay","impl":"standard","slot":4613298,"provider":"https://bloxroute.max-profit.builder.goerli.blxrbdn.com/","value":"29842280888984106","delta":"0","selected":true,"time":"2022-12-24T08:39:36+01:00","message":"Auction participant"}

I didn't notice any additional log mentioning the min bid was met (running level info), but it did propose correctly so no concerns.

mcdee commented 1 year ago

Thanks for the feedback.

ThomasDalla commented 1 year ago

Just an update that I was still running attestant/vouch:execution-config-v2 and noticed it produced a block with a relay below its configured minimum bid a few days ago.

The logs don't tell much, the Flashbots one, which had the highest value (but below its min bid) was selected:

{"level":"info","service":"blockrelay","impl":"standard","slot":4901914,"provider":"https://goerli-relay.securerpc.com/","value":"36160094772565778","delta":"998382980806000","selected":false,"time":"2023-02-02T10:42:48+01:00","message":"Auction participant"}
{"level":"info","service":"blockrelay","impl":"standard","slot":4901914,"provider":"https://bloxroute.max-profit.builder.goerli.blxrbdn.com/","value":"36939718225951778","delta":"218759527420000","selected":false,"time":"2023-02-02T10:42:48+01:00","message":"Auction participant"}
{"level":"info","service":"blockrelay","impl":"standard","slot":4901914,"provider":"https://builder-relay-goerli.blocknative.com/","value":"36311489246973778","delta":"846988506398000","selected":false,"time":"2023-02-02T10:42:48+01:00","message":"Auction participant"}
{"level":"info","service":"blockrelay","impl":"standard","slot":4901914,"provider":"https://builder-relay-goerli.flashbots.net/","value":"37158477753371778","delta":"0","selected":true,"time":"2023-02-02T10:42:48+01:00","message":"Auction participant"}
{"level":"info","service":"blockrelay","impl":"standard","slot":4901914,"provider":"https://goerli.aestus.live/","value":"36158477753371778","delta":"1000000000000000","selected":false,"time":"2023-02-02T10:42:48+01:00","message":"Auction participant"}

That's the highest value (0.037158), but below min value of 0.04 set for that relay:

{
  "version": 2,
  "fee_recipient": "0xMe",
  "min_value": "0.02",
  "relays": {
    "https://bloxroute.max-profit.builder.goerli.blxrbdn.com": {
      "public_key": "0x821f2a65afb70e7f2e820a925a9b4c80a159620582c1766b1b09729fec178b11ea22abb3a51f07b288be815a1a2ff516"
    },
    "https://goerli-relay.securerpc.com": {
      "public_key": "0x8a72a5ec3e2909fff931c8b42c9e0e6c6e660ac48a98016777fc63a73316b3ffb5c622495106277f8dbcc17a06e92ca3"
    },
    "https://builder-relay-goerli.blocknative.com": {
      "public_key": "0x8f7b17a74569b7a57e9bdafd2e159380759f5dc3ccbd4bf600414147e8c4e1dc6ebada83c0139ac15850eb6c975e82d0"
    },
    "https://goerli.aestus.live": {
      "public_key": "0xab78bf8c781c58078c3beb5710c57940874dd96aef2835e7742c866b4c7c0406754376c2c8285a36c630346aa5c5f833"
    },
    "https://builder-relay-goerli.flashbots.net": {
      "public_key": "0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110",
      "min_value": "0.04"
    }    
  }
}

Is my config wrong or is that a bug?

mcdee commented 1 year ago

Thank you for reporting this. It is a bug in the selection mechanism for bids, with a fix in #121 that will be included in release 1.7.0.