Skip to content

Commit 4c33cd2

Browse files
jclapisltitanb
authored andcommitted
Add automatic registry mux refreshing (Commit-Boost#384)
Co-authored-by: ltitanb <[email protected]>
1 parent 4aef622 commit 4c33cd2

File tree

25 files changed

+839
-312
lines changed

25 files changed

+839
-312
lines changed

Cargo.lock

Lines changed: 25 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config.example.toml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ extra_validation_enabled = false
5555
# Execution Layer RPC url to use for extra validation
5656
# OPTIONAL
5757
# rpc_url = "https://ethereum-holesky-rpc.publicnode.com"
58+
# URL of the SSV API server to use, if you have a mux that targets an SSV node operator
59+
# OPTIONAL, DEFAULT: "https://api.ssv.network/api/v4"
60+
# ssv_api_url = "https://api.ssv.network/api/v4"
5861
# Timeout for any HTTP requests sent from the PBS module to other services, in seconds
5962
# OPTIONAL, DEFAULT: 10
6063
http_timeout_seconds = 10
@@ -64,6 +67,13 @@ register_validator_retry_limit = 3
6467
# Maximum number of validators to register in a single request.
6568
# OPTIONAL, DEFAULT: "" (unlimited)
6669
validator_registration_batch_size = ""
70+
# For any Registry-based Mux configurations that have dynamic pubkey
71+
# refreshing enabled, this is how often to refresh the list of pubkeys
72+
# from the registry, in seconds. Enabling registry refreshing is done per-mux
73+
# with the mux's `enable_refreshing` property. If none of the muxes have it
74+
# enabled, this value will not be used.
75+
# OPTIONAL, DEFAULT: 384
76+
mux_registry_refresh_interval_seconds = 384
6777

6878
# The PBS module needs one or more [[relays]] as defined below.
6979
[[relays]]
@@ -126,6 +136,11 @@ validator_pubkeys = [
126136
# - Registry: details of a registry to load keys from. Supported registries:
127137
# - Lido: NodeOperatorsRegistry
128138
# - SSV: SSV API
139+
# You can toggle the 'enable_refreshing' flag to let this registry periodically query Lido or SSV and refresh the list of validator pubkeys belonging to the corresponding operator.
140+
# Each of these registry entries must be unique:
141+
# - There can only be one Lido entry with a given Lido node operator ID.
142+
# - There can only be one SSV entry with a given SSV node operator ID.
143+
# - A Lido entry can have the same node operator ID as an SSV entry if they happen to coincide; they're treated as separate entities.
129144
#
130145
# Example JSON list:
131146
# [
@@ -135,8 +150,8 @@ validator_pubkeys = [
135150
# OPTIONAL
136151
loader = "./tests/data/mux_keys.example.json"
137152
# loader = { url = "http://localhost:8000/keys" }
138-
# loader = { registry = "lido", node_operator_id = 8 }
139-
# loader = { registry = "ssv", node_operator_id = 8 }
153+
# loader = { registry = "lido", node_operator_id = 8, enable_refreshing = false }
154+
# loader = { registry = "ssv", node_operator_id = 8, enable_refreshing = false }
140155
late_in_slot_time_ms = 1500
141156
timeout_get_header_ms = 900
142157
# For each mux, one or more [[mux.relays]] can be defined, which will be used for the matching validator pubkeys

crates/common/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ publish = false
55
rust-version.workspace = true
66
version.workspace = true
77

8+
[features]
9+
testing-flags = []
10+
811
[dependencies]
912
aes.workspace = true
1013
alloy.workspace = true

0 commit comments

Comments
 (0)