Skip to content

Conversation

faheelsattar
Copy link
Collaborator

@faheelsattar faheelsattar commented Sep 18, 2025

📝 Summary

Introduces a muxing feature to mev-boost that enables different sets of validators to connect to different sets of relays. This addresses a significant operational need for large-scale validator operations.

See also: https://collective.flashbots.net/t/muxing-in-mev-boost-to-handle-diverse-relay-sets/5231/2

Each policy contains:

  • name: a unique identifier for the policy
  • relayers: a list of relay configurations including:
    • name: relay identifier
    • url: the relay endpoint URL
    • http-header: optional custom http headers

Each mapping contains:

  • name: name for the mapping
  • policy: references a policy defined in the policies section
  • filters: criteria for selecting which validators use this policy:
    • public_keys: list of validator public keys

Example config:

policies:
  - name: "lido-policy"
    relayers:
      - name: "relayer-1"
        url: "0x9000009807ed12c1f08bf4e81c6da3ba8e3fc3d953898ce0102433094e5f22f21102ec057841fcb81978ed1ea0fa8246@relay.relayer1.net"
      - name: "relayer-2"
        url: "0x9000009807ed12c1f08bf4e81c6da3ba8e3fc3d953898ce0102433094e5f22f21102ec057841fcb81978ed1ea0fa8246@relay.relayer2.com"
        http-header:
          X-Custom-Header: "custom-value"
  - name: "rocket-pool-policy"
    relayers:
      - name: "relayer-1"
        url: "0x9000009807ed12c1f08bf4e81c6da3ba8e3fc3d953898ce0102433094e5f22f21102ec057841fcb81978ed1ea0fa8246@relay.relayer1.io"
      - name: "relayer-2"
        url: "0x9000009807ed12c1f08bf4e81c6da3ba8e3fc3d953898ce0102433094e5f22f21102ec057841fcb81978ed1ea0fa8246@relay.relayer2.com"

mappings:
  - name: "lido-validators"
    policy: "lido-policy"
    filters:
      public_keys:
        - "0x8a1d7b8dd64e0aafe7ea7b6c95065c9364cf99d38470c12ee807d55f7de1529ad29ce2c422e0b65e3d5a05c02caca249"
        - "0x8b1d7b8dd64e0aafe7ea7b6c95065c9364cf99d38470c12ee807d55f7de1529ad29ce2c422e0b65e3d5a05c02caca250"
        - "0x8c1d7b8dd64e0aafe7ea7b6c95065c9364cf99d38470c12ee807d55f7de1529ad29ce2c422e0b65e3d5a05c02caca251"
  - name: "rocket-pool-validators"
    policy: "rocket-pool-policy"
    filters:
      public_keys:
        - "0x8d1d7b8dd64e0aafe7ea7b6c95065c9364cf99d38470c12ee807d55f7de1529ad29ce2c422e0b65e3d5a05c02caca252"
        - "0x8e1d7b8dd64e0aafe7ea7b6c95065c9364cf99d38470c12ee807d55f7de1529ad29ce2c422e0b65e3d5a05c02caca253"
        - "0x8f1d7b8dd64e0aafe7ea7b6c95065c9364cf99d38470c12ee807d55f7de1529ad29ce2c422e0b65e3d5a05c02caca254"

✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy

@metachris metachris requested a review from Copilot October 1, 2025 07:39
Copy link

@Copilot Copilot AI left a 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 introduces validator-to-relay muxing functionality in mev-boost, allowing different sets of validators to be associated with specific sets of relays rather than sending all validator requests to all relays.

  • Adds a new MuxConfig structure to define policies and validator mappings
  • Modifies validator registration and header/payload requests to use validator-specific relays
  • Adds configuration loading and validation for YAML-based mux configuration files

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
server/service.go Adds mux configuration support to BoostService with relay selection logic
server/register_validator.go Implements validator-specific relay routing for registration requests
server/mux_test.go Comprehensive test coverage for the muxing functionality
server/get_payload.go Updates payload requests to use policy-based relay selection
server/get_header.go Modifies header requests to use validator-specific relays
config/mux_config.go Core mux configuration structure with YAML loading and validation
cli/main.go Integrates mux config setup into CLI initialization
cli/flags.go Adds command-line flag for mux configuration file path
go.mod Updates yaml.v3 dependency to direct import
Comments suppressed due to low confidence (1)

server/register_validator.go:1

  • Silent error handling here swallows potentially important configuration errors. Consider logging the error to help with debugging mux configuration issues.
package server

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@faheelsattar faheelsattar changed the title Faheel/muxing add muxing support in mev-boost Oct 1, 2025
@metachris metachris changed the title add muxing support in mev-boost Relay multiplexing Oct 2, 2025
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.

1 participant