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

Preconf / Constraint API #27

Closed
wants to merge 66 commits into from
Closed

Preconf / Constraint API #27

wants to merge 66 commits into from

Conversation

gd-0
Copy link
Collaborator

@gd-0 gd-0 commented Jun 9, 2024

Implements a very basic Constraints API

Key Changes:

Constraints API

  • new api that handles all different stages for precons

Functions are:

  • elect_gateway: can be done up to 2 epochs in advance. Must be signed by the proposer pubkey. Delegates set_constraint control to a gateway pubkey. This will be called by the proposer
  • get_gateway: fetches the preconfer/ gateway for a given slot. This would be called by the users to determine who to send the preconf requests to.
  • set constraints: sets constraints for the current slot. must be called by the elected gateway for the curr slot. will be called by the elected gateway.
  • get constraints: gets the contraints for the current slot. would be called by the builder

Builder API

  • Adds a new function to verify builder submission that checks if there are any constraints for the current slot and then verifies them.
  • Failed verification here will be a demotable event.

ConstraintsAuctioneer + Redis impl
Additional layer onto the normal Auctioneer trait that has all functions required for constraints.
Redis impl:

  • 2 keys: elected gateways + constraints
  • key is a hash map of slot -> type
  • all expire after 2 epochs. Note: constraints could definitely be less.

Types
We implement a new Constraint enum that allows us to represent generic traits. e.g., raw transactions and bolt constraints. The verify constraint functions are part of the enum so we can use generic validation.

TODOs

  • This will only currently work in a single cluster as we only synchronise through redis. We will need to gossip constraints across clusters through the gRPC layer if we want this to work in prod.
  • We should probably load constraints into memory after the first redis read. The current impl adds an additional redis read for each builder submission.
  • Implement the bolt constraint type + validation to the Constraint enum.
  • Database persistance. We should persist each election/ constraints.
  • Synchronising elections across clusters. This can probably be done through the database.
  • Need to pass constraint to simulate block rpc call so we can verify that the builder paid the preconfer as well as the proposer.

@gd-0 gd-0 changed the base branch from main to develop June 10, 2024 09:59
@gd-0 gd-0 deleted the branch develop June 10, 2024 10:02
@gd-0 gd-0 closed this Jun 10, 2024
@gd-0 gd-0 reopened this Jun 10, 2024
@gd-0 gd-0 changed the base branch from develop to main June 10, 2024 10:15
@gd-0 gd-0 changed the base branch from main to develop June 10, 2024 10:16
gd-0 and others added 27 commits June 11, 2024 22:01
… the duties if no preconfer was set for a slot
Upgrade preconf dependencies and fix all warnings
zsluedem pushed a commit to lu-bann/helix that referenced this pull request Nov 21, 2024
fix(ssz): backwards compatibility on `SignedBidSubmission`
@0w3n-d 0w3n-d closed this Nov 29, 2024
@ltitanb ltitanb deleted the preconf branch December 11, 2024 10:59
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