Skip to content

Specify builder_comparison_factor#386

Merged
rolfyone merged 7 commits into
ethereum:masterfrom
michaelsproul:comparison-factor
Dec 21, 2023
Merged

Specify builder_comparison_factor#386
rolfyone merged 7 commits into
ethereum:masterfrom
michaelsproul:comparison-factor

Conversation

@michaelsproul

Copy link
Copy Markdown
Contributor

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.

Comment thread apis/validator/block.v3.yaml Outdated

@g11tech g11tech left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@potuz

potuz commented Dec 11, 2023

Copy link
Copy Markdown

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

mcdee commented Dec 11, 2023

Copy link
Copy Markdown
Contributor

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

potuz commented Dec 11, 2023

Copy link
Copy Markdown

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 thread apis/validator/block.v3.yaml Outdated
Comment thread apis/validator/block.v3.yaml Outdated
Comment thread apis/validator/block.v3.yaml Outdated
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
Copy Markdown
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
Copy Markdown
Contributor

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.

@dapplion dapplion Dec 11, 2023

Copy link
Copy Markdown
Member

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?

@michaelsproul michaelsproul Dec 11, 2023

Copy link
Copy Markdown
Contributor Author

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

michaelsproul commented Dec 12, 2023

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor

Is everyone happy with this now?

rolfyone
rolfyone previously approved these changes Dec 19, 2023

@rolfyone rolfyone left a comment

Copy link
Copy Markdown
Contributor

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
Comment thread apis/validator/block.v3.yaml Outdated
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

@rolfyone rolfyone left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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
Copy Markdown
Contributor 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