flashbots / mev-boost-relay

MEV-Boost Relay for Ethereum proposer/builder separation (PBS)
https://boost-relay.flashbots.net
GNU Affero General Public License v3.0
413 stars 116 forks source link

[spec proposal] improved API to get validators #237

Open metachris opened 1 year ago

metachris commented 1 year ago

Context: https://collective.flashbots.net/t/privacy-concerns-with-data-api/568

We'll update the API for getting validators (https://boost-relay.flashbots.net/relay/v1/data/validator_registration?pubkey=) to make it more private, and to allow bulk queries.

Changes:

  1. Instead of only providing pubkey for the request, it will also require fee_recipient (and optionally gas_limit). This is to maintain privacy for proposers (you can only query them if you know the fee_recipient).
  2. Allow single queries (like currently), as well as bulk queries with POST requests.
  3. Return a response only for active proposers (currently the API returns the result if a proposer registered at any time in the past)

Single query:

https://boost-relay.flashbots.net/relay/v1/data/validator_registration
    ?pubkey=<pubkey>
    ?fee_recipient=<feeRecipient>
    [?gas_limit=<gasLimit>]

Bulk query:

[
  {
    "pubkey": "<a_pubkey>",
    "fee_recipient": "<a_fee_recipient>"
  },
  {
    "pubkey": "<b_pubkey>",
    "fee_recipient": "<b_fee_recipient>",
    "gas_limit": "<b_gas_limit>"
  }
]

Response includes a list of found entries:

[
  "<a_pubkey>",
  "<b_pubkey>"
]

Possible extensions (please comment if you have a need for that, could be added now or in the future):

  1. return not only the pubkey but also fee_recipient and gas_limit (enable this response format with another query arg?)
  2. return not the found entries, but those that are not found (could also be enabled with another query arg).

Please comment with any remaining thoughts. Will start implementation soon 🙏

jtraglia commented 1 year ago

Regarding possible extensions, I like the idea of having another query argument for missing entries; an empty list if everything is found. It seems like the most efficient way for operators to check a large group of validators at once.

Could be as simple as:

jtraglia commented 1 year ago

Semi-related, I think we should remove the timestamp field from /relay/v1/builder/validators response entries:

If the registrations are guaranteed to be active, that information isn't required.

metachris commented 1 year ago

Can you please open a new issue re builder/getValidators? (fwiw I disagree because it also includes a signature, which can't be verified without the timestamp. should we also remove the signature?)

jtraglia commented 1 year ago

Ah that's a good point. I'll think about it some more, but yeah I'll open a new issue. Thanks.