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

Specify builder_comparison_factor #386

Merged
merged 7 commits into from
Dec 21, 2023

Conversation

michaelsproul
Copy link
Collaborator

Generalisation and replacement for #377 based on the rough consensus achieved in the discussion there.

One new parameter is added for block building which can be used to encode several types of validator preferences. There is a trade-off between simplicity and expressiveness, and IMO this single parameter achieves a good middle ground.

I haven't done any renames of blinded -> builder in this PR as that seems like a separate issue, and the current spec is actually already unambiguous on this matter when it states:

The beacon node must return an unblinded block if it obtains the execution payload from its paired execution node. It must only return a blinded block if it obtains the execution payload header from an MEV relay.

Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@potuz
Copy link

potuz commented Dec 11, 2023

Just a nit, but I prefer comparisons to be in addition to instead of relative. That is, instead of 120, I rather see the comparison be 20, as in 20% more than the local payload instead of 1.2 times the local payload

@mcdee
Copy link
Contributor

mcdee commented Dec 11, 2023

Just a nit, but I prefer comparisons to be in addition to instead of relative. That is, instead of 120, I rather see the comparison be 20, as in 20% more than the local payload instead of 1.2 times the local payload

I don't see how you could request a locally-built block with the additive style configuration, given that the parameter is unsigned. Relative seems more flexible.

@potuz
Copy link

potuz commented Dec 11, 2023

Locally built would be max uint. What's impossible is to request a builders block unconditionally which is part of the reason I like this better

Comment on lines 67 to 68
* `builder_comparison_factor=2**64 - 1`: prefer the builder payload unless an error or
beacon node health check makes it unviable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `builder_comparison_factor=2**64 - 1`: prefer the builder payload unless an error or
beacon node health check makes it unviable.
* `builder_comparison_factor=2**64 - 1`: prefer the builder payload unless an error
makes it unviable or beacon node health check makes it unviable.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really opposed to this, but how is this this an improvement?

Also, if nothing else, the grammar's wonky now: "beacon node health check" lacks an article or other similarly-functioning word. Before, it shared an with error, but this removes that linkage.

Copy link
Collaborator

@dapplion dapplion Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just

 * `builder_comparison_factor=2**64 - 1`: prefer the builder payload unless
    an error makes it unviable.

@michaelsproul why is a "beacon node health check" relevant here?

Copy link
Collaborator Author

@michaelsproul michaelsproul Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to flag that a health check would be the most likely reason a local block would be returned when the user greatly prefers a builder block.

@michaelsproul
Copy link
Collaborator Author

michaelsproul commented Dec 12, 2023

Locally built would be max uint. What's impossible is to request a builders block unconditionally which is part of the reason I like this better

@potuz The point of the multiplicative factor is to make a large variety of preferences expressible using a single param. Removing the ability to define the "prefer builder" case would be antithetical to that. A "builder" block also doesn't necessarily imply censorship. In a DVT setup you could e.g. sit a piece of software that uses the builder API in front of a local EL and share the blocks it produces with the entire cluster so that they achieve consensus on it.

I'm assuming your system is:

if exec_node_payload_value + c * (exec_node_payload_value // 100) >= builder_payload_value:
  # use local
else:
  # use builder

For non-negative comparison factor, c. If c were allowed to be negative then this would be equally expressive (albeit more complex).

@rolfyone
Copy link
Collaborator

Is everyone happy with this now?

rolfyone
rolfyone previously approved these changes Dec 19, 2023
Copy link
Collaborator

@rolfyone rolfyone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

rkapka
rkapka previously approved these changes Dec 19, 2023
dapplion
dapplion previously approved these changes Dec 20, 2023
roughly agreed on discord

Co-authored-by: g11tech <develop@g11tech.io>
@rolfyone rolfyone dismissed stale reviews from dapplion, rkapka, and themself via 6f68742 December 21, 2023 01:27
Copy link
Collaborator

@rolfyone rolfyone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

unviable.
* `builder_comparison_factor=100`: default profit maximization mode; choose whichever
payload pays more.
* `builder_comparison_factor=2**64 - 1`: prefer the builder payload unless an error or
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean? if the beacon health check makes it unviable, should we return the local payload or error out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(as discussed on Discord) local payload

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