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

Builder: update to new Constraints API #241

Merged
merged 36 commits into from
Oct 3, 2024

Conversation

thedevbirb
Copy link
Contributor

@thedevbirb thedevbirb commented Sep 25, 2024

This PR does the steps outlined in #209 to support the new constraints API

To do: ping Kubi when this is merged

@thedevbirb thedevbirb force-pushed the naman/feat/flashbot-builder branch from 1db9a3b to b511df6 Compare September 25, 2024 15:49
@thedevbirb thedevbirb force-pushed the naman/feat/flashbot-builder branch from b511df6 to a1d3397 Compare September 25, 2024 15:50
@merklefruit merklefruit marked this pull request as draft October 2, 2024 08:48
@mempirate mempirate marked this pull request as ready for review October 2, 2024 09:46
@mempirate
Copy link
Contributor

Will not support the top field in this PR as we won't support it any time soon any way

builder/builder/builder.go Show resolved Hide resolved
builder/builder/builder.go Show resolved Hide resolved
builder/builder/relay.go Outdated Show resolved Hide resolved
builder/common/types.go Outdated Show resolved Hide resolved
builder/common/types.go Outdated Show resolved Hide resolved
builder/miner/worker.go Show resolved Hide resolved
Copy link
Contributor Author

@thedevbirb thedevbirb left a comment

Choose a reason for hiding this comment

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

Great work @mempirate, the changes you made are clear to me. Just two minor questions

// GetConstraintsDomain returns the constraints domain used to sign constraints-API related messages.
//
// The builder signing domain is built as follows:
// - We build a ForkData ssz container with the fork version and the genesis validators root. In the builder domain, this is an empty root.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean with "In the builder domain, this is an empty root"?

Copy link
Contributor

Choose a reason for hiding this comment

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

Across all implementations, the builder signing domain is built with an empty genesis validators root. I don't know why. In contrast, the beacon signing domain always contains a valid gvr.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If it can be helpful, here is more context on the decision:

ethereum/builder-specs#14 (comment)

With that said, it makes the most sense to me to compute the domain for an application using compute_domain(APP_DOMAIN_TYPE, fork_version=None, genesis_validators_root=None), because I don't think application should need any external data to compute / verify a signature.

Copy link
Contributor

Choose a reason for hiding this comment

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

The builder domain does use the fork_version field though. I think for us that also makes sense to ensure signatures are only valid for the fork they're running on. Wdyt?

builder/builder/relay_aggregator.go Show resolved Hide resolved
builder/miner/worker.go Show resolved Hide resolved
@mempirate mempirate self-requested a review October 3, 2024 08:34
Copy link
Collaborator

@merklefruit merklefruit left a comment

Choose a reason for hiding this comment

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

LGTM

@mempirate mempirate merged commit ec41a81 into unstable Oct 3, 2024
2 checks passed
@mempirate mempirate deleted the naman/feat/flashbot-builder branch October 3, 2024 08:51
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.

4 participants