-
Notifications
You must be signed in to change notification settings - Fork 269
Add timing games feature for bid optimization #839
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
base: develop
Are you sure you want to change the base?
Conversation
# relay with timing games disabled (standard behavior) | ||
- url: "https://0x9000009807ed12c1f08bf4e81c6da3ba8e3fc3d953898ce0102433094e5f22f21102ec057841fcb81978ed1ea0fa8246@relay.relayer2.com" | ||
enable_timing_games: false | ||
target_first_request_ms: 0 | ||
frequency_getheader_ms: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also work without the bottom three lines right? For example:
relays:
- url: https://...
- url: https://...
- url: https://...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it would, missing fields will get default values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a timing games feature for bid optimization that allows sending multiple getHeader requests within a slot to maximize the chance of receiving higher bids. The feature is configurable via YAML configuration files and remains backwards compatible with existing relay configuration methods.
Key changes:
- Introduces
RelayConfig
struct to wrapRelayEntry
with timing games parameters - Implements timing games logic with configurable delays and request frequencies
- Adds YAML configuration support for relay timing settings
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
server/types/relay_entry.go | Adds RelayConfig struct with timing games parameters |
server/service.go | Updates BoostService to use RelayConfig instead of RelayEntry |
server/get_header.go | Implements timing games logic with multiple timed requests |
cli/main.go | Adds relay config file loading and merging functionality |
cli/flags.go | Adds --relay-config flag for YAML configuration |
cli/config.go | Implements YAML config parsing and relay merging logic |
examples/relay_config.yml | Provides example configuration file |
go.mod | Promotes yaml.v3 from indirect to direct dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Doesn't this feature require CL client implementation changes to not timeout on the request on the CL side? |
I think the CL clients sends an optional |
CLs have a hardcoded timeout for the return of the header from the call to MeV-Boost, I do not see how this works without modifying the CL |
That is okay too since we also have |
What I mean is that the CL has a hardcoded timeout that is not configurable. |
Yeah i understand what you are saying "the CL clients have hardcoded timeouts (e.g: 1000ms) that isnt configurable". |
📝 Summary
Allows sending multiple getHeader requests within a slot and returns the freshest successful header. This helps improving bid while respecting deadlines. It maximizes chance of a higher bid since later requests can return improved headers. It achieves this via YAML config file which can be passed via
--relay-config
, allowing delayed first requests viaTargetFirstRequestMs
and multiple subsequent requests at intervals viaFrequencyGetHeaderMs
. This feature is only activated ifEnableTimingGames
is set to true in the config file for a particular relay.This PR also allows setting relays via YAML file where timing games parameters can be set. This is also backwards compatible if someone doesnt want to set relays via YAML file and want to use the default method of setting relays via
--relay
flagexample config
Closes #830
⛱ Motivation and Context
📚 References
✅ I have run these commands
make lint
make test-race
go mod tidy