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

[spec proposal] improved API to get validators #237

Open
metachris opened this issue Nov 8, 2022 · 4 comments
Open

[spec proposal] improved API to get validators #237

metachris opened this issue Nov 8, 2022 · 4 comments

Comments

@metachris
Copy link
Collaborator

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
Copy link
Collaborator

jtraglia commented Nov 8, 2022

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:

  • POST /relay/v1/data/validator_registration?missing

@jtraglia
Copy link
Collaborator

jtraglia commented Nov 8, 2022

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
Copy link
Collaborator Author

metachris commented Nov 9, 2022

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
Copy link
Collaborator

jtraglia commented Nov 9, 2022

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

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

No branches or pull requests

2 participants