Skip to content

Commit 6cda3c4

Browse files
authored
[codex] improve execution mimicry peering (#811)
* improve execution mimicry peering * fix sentry smoke vector readiness * tighten execution mimicry bootstrap config * fix sentry smoke event assertions * stabilize clickhouse smoke startup * fix clickhouse smoke healthcheck
1 parent 1e346b0 commit 6cda3c4

17 files changed

Lines changed: 882 additions & 37 deletions

File tree

.github/sentry/seeding.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
# This config defines which event types to test in the sentry smoke test.
44
# The test connects to a live beacon node and subscribes to real-time events.
55
#
6-
# Only event types that fire frequently enough for CI assertions are included.
7-
# Events like finalized_checkpoint (~13 min interval) are subscribed to but
8-
# not gated on, since they're too slow for a smoke test.
6+
# Only event types that fire frequently and reliably enough for CI assertions
7+
# are included. Events like finalized_checkpoint and contribution_and_proof can
8+
# be observed by sentry, but are not gated on because their cadence/source is
9+
# too variable for a pull-request smoke test.
910
#
1011
# The assertions verify that data flows through the entire pipeline:
1112
# Beacon Node -> Sentry -> Xatu Server -> Kafka -> Vector -> ClickHouse
@@ -22,10 +23,6 @@ event_types:
2223
table: beacon_api_eth_v1_events_block
2324
description: "Block events - most slots"
2425

25-
- name: BEACON_API_ETH_V1_EVENTS_ATTESTATION
26+
- name: BEACON_API_ETH_V1_EVENTS_ATTESTATION_V2
2627
table: beacon_api_eth_v1_events_attestation
27-
description: "Attestation events - many per slot"
28-
29-
- name: BEACON_API_ETH_V1_EVENTS_CONTRIBUTION_AND_PROOF
30-
table: beacon_api_eth_v1_events_contribution_and_proof
31-
description: "Sync committee contributions - multiple per slot"
28+
description: "Single attestation events - many per slot"

.github/workflows/sentry-smoke-test.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919
cancel-in-progress: true
2020
jobs:
2121
sentry-smoke-test:
22-
timeout-minutes: 15
22+
timeout-minutes: 20
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout repository
@@ -90,7 +90,7 @@ jobs:
9090
chmod 666 deploy/local/docker-compose/sentry-logs/logs/geth.log
9191
- name: Run Xatu stack
9292
if: steps.canary.outputs.skip != 'true'
93-
timeout-minutes: 7
93+
timeout-minutes: 10
9494
run: |
9595
docker compose up --detach --quiet-pull
9696
- name: Wait for Xatu stack to be ready
@@ -117,15 +117,20 @@ jobs:
117117
# xatu-server forwards sentry-logs events to xatu-vector-http-kafka:9005.
118118
# Compose returns once the container is "Started", but Vector binds the
119119
# HTTP source ~1s later, racing with the inject step below.
120-
# Probe via the host-mapped port (vector image is busybox, no /dev/tcp).
120+
# Probe the actual HTTP source. The Docker port can accept TCP before
121+
# Vector has finished binding the source, which drops the one-shot
122+
# sentry-logs test batch.
121123
echo "Waiting for xatu-vector-http-kafka to accept HTTP on host :9055..."
122124
for i in $(seq 1 30); do
123-
if bash -c 'echo > /dev/tcp/localhost/9055' 2>/dev/null; then
125+
if printf '{"event":{"name":"XATU_SMOKE_READY_PROBE"}}\n' | curl --fail --silent --show-error --max-time 2 \
126+
-H 'Content-Type: application/x-ndjson' \
127+
--data-binary @- \
128+
http://127.0.0.1:9055 >/dev/null; then
124129
echo "xatu-vector-http-kafka is listening."
125130
break
126131
fi
127132
if [ "$i" -eq 30 ]; then
128-
echo "::error::xatu-vector-http-kafka failed to bind :9005"
133+
echo "::error::xatu-vector-http-kafka failed to accept HTTP on host :9055"
129134
docker logs xatu-vector-http-kafka 2>&1 | tail -50
130135
exit 1
131136
fi
@@ -178,8 +183,7 @@ jobs:
178183
beaconSubscriptions:
179184
- head
180185
- block
181-
- attestation
182-
- contribution_and_proof
186+
- single_attestation
183187
- finalized_checkpoint
184188
185189
beaconCommittees:

docker-compose.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ services:
2828
test:
2929
[
3030
"CMD-SHELL",
31-
"set -x; wget --spider --quiet http://xatu-clickhouse-01:9000 || exit 1; wget --spider --quiet --header 'Host: localhost' --post-data 'query=SELECT 1' http://localhost:8123 || exit 1",
31+
"set -x; clickhouse client --host xatu-clickhouse-01 --port 9000 --query 'SELECT 1' || exit 1; wget --quiet --output-document=/dev/null http://xatu-clickhouse-01:8123/ping || exit 1",
3232
]
3333
interval: 5s
3434
timeout: 10s
35-
retries: 15
36-
start_period: 15s
35+
retries: 30
36+
start_period: 120s
3737
environment:
3838
- CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1
3939
- CLICKHOUSE_USER=default
@@ -68,12 +68,12 @@ services:
6868
test:
6969
[
7070
"CMD-SHELL",
71-
"set -x; wget --spider --quiet http://xatu-clickhouse-02:9000 || exit 1; wget --spider --quiet --header 'Host: localhost' --post-data 'query=SELECT 1' http://localhost:8123 || exit 1",
71+
"set -x; clickhouse client --host xatu-clickhouse-02 --port 9000 --query 'SELECT 1' || exit 1; wget --quiet --output-document=/dev/null http://xatu-clickhouse-02:8123/ping || exit 1",
7272
]
7373
interval: 5s
7474
timeout: 10s
75-
retries: 15
76-
start_period: 15s
75+
retries: 30
76+
start_period: 120s
7777
environment:
7878
- CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1
7979
- CLICKHOUSE_USER=default

docs/mimicry.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ Mimicry requires a single `yaml` config file. An example file can be found [here
4646
| labels | object | | A key value map of labels to append to every mimicry event |
4747
| ntpServer | string | `pool.ntp.org` | NTP server to calculate clock drift for events |
4848
| captureDelay | string | `3m` | Delay before starting to capture transactions |
49+
| ethereum.bootstrapRpcUrl | string | | Optional mainnet, Sepolia, or Holesky execution JSON-RPC endpoint used to build local `eth` Status and answer block data requests |
50+
| ethereum.privateKey | string | | Optional hex devp2p node private key. If omitted, mimicry reuses one generated process-local identity for all execution peers |
51+
| ethereum.blobTransactionBatchSize | int | `1` | Number of blob transactions to request at a time via `GetPooledTransactions` |
52+
| ethereum.transactionBatchSize | int | `10` | Number of non-blob transactions to request at a time via `GetPooledTransactions` |
4953
| coordinator.type | string | | Type of output (`xatu`, `static`) |
5054
| coordinator.config | object | | Coordinator type configuration [`xatu`](#coordinator-xatu-configuration)/[`static`](#coordinator-static-configuration) |
5155
| outputs | array<object> | | List of outputs for the mimicry to send data to |
@@ -74,6 +78,7 @@ Coordinator configuration to statically specify peers to connect to.
7478
| Name| Type | Default | Description |
7579
| --- | --- | --- | --- |
7680
| coordinator.config.retryInterval | string | | Interval between trying to connect to a peer |
81+
| coordinator.config.maxConcurrentPeers | int | `0` | Maximum number of in-flight and active peer connections. `0` means unlimited |
7782
| coordinator.config.nodeRecords | array<string> | | List of ENR/ENode peers to connect to |
7883

7984
### Output `xatu` configuration
@@ -150,6 +155,7 @@ coordinator:
150155
type: static
151156
config:
152157
retryInterval: 60s
158+
maxConcurrentPeers: 100
153159
nodeRecords:
154160
- enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8
155161

example_mimicry.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ captureDelay: 3m
2222

2323
# ethereum:
2424
# overrideNetworkName: devnet
25+
# bootstrapRpcUrl: http://localhost:8545 # Optional mainnet/Sepolia/Holesky EL RPC used to build Status and answer block data requests.
26+
# privateKey: "" # Optional hex devp2p node key. If omitted, one process-local identity is reused.
2527
# blobTransactionBatchSize: 1 # Number of blob txns to request at a time (default: 1)
2628
# transactionBatchSize: 10 # Number of other txns to request at a time (default: 10)
2729

2830
coordinator:
2931
type: static
3032
config:
3133
retryInterval: 60s
34+
maxConcurrentPeers: 0 # Optional. 0 means unlimited.
3235
# can be ENR or ENODE format
3336
nodeRecords:
3437
- enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ require (
1717
github.com/cenkalti/backoff/v5 v5.0.3
1818
github.com/chuckpreslar/emission v0.0.0-20170206194824-a7ddd980baf9
1919
github.com/creasty/defaults v1.8.0
20-
github.com/ethereum/go-ethereum v1.17.0
20+
github.com/ethereum/go-ethereum v1.17.1
2121
github.com/ethpandaops/beacon v0.65.0
22-
github.com/ethpandaops/ethcore v0.0.0-20260225041126-afac0c250cdf
22+
github.com/ethpandaops/ethcore v0.0.0-20260506100832-68848ea0ddaa
2323
github.com/ethpandaops/ethwallclock v0.4.0
2424
github.com/failsafe-go/failsafe-go v0.9.6
2525
github.com/ferranbt/fastssz v1.0.0
@@ -114,7 +114,7 @@ require (
114114
github.com/eapache/queue v1.1.0 // indirect
115115
github.com/ebitengine/purego v0.8.4 // indirect
116116
github.com/emicklei/dot v1.9.0 // indirect
117-
github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect
117+
github.com/ethereum/c-kzg-4844/v2 v2.1.6 // indirect
118118
github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect
119119
github.com/fatih/color v1.18.0 // indirect
120120
github.com/felixge/httpsnoop v1.0.4 // indirect
@@ -268,7 +268,7 @@ require (
268268
github.com/spaolacci/murmur3 v1.1.0 // indirect
269269
github.com/spf13/cast v1.10.0 // indirect
270270
github.com/spf13/pflag v1.0.10 // indirect
271-
github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe // indirect
271+
github.com/supranational/blst v0.3.16 // indirect
272272
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
273273
github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e // indirect
274274
github.com/tilinna/z85 v1.0.0 // indirect

go.sum

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
133133
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
134134
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU=
135135
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U=
136+
github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA=
137+
github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc=
136138
github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ=
137139
github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4=
138140
github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8=
@@ -171,16 +173,16 @@ github.com/emicklei/dot v1.9.0 h1:FyaJNctdMfaEIbTQ1FkKZ1UCZyJJSkyvkrXOVoNZPKU=
171173
github.com/emicklei/dot v1.9.0/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s=
172174
github.com/emicklei/proto v1.14.2 h1:wJPxPy2Xifja9cEMrcA/g08art5+7CGJNFNk35iXC1I=
173175
github.com/emicklei/proto v1.14.2/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=
174-
github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s=
175-
github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs=
176+
github.com/ethereum/c-kzg-4844/v2 v2.1.6 h1:xQymkKCT5E2Jiaoqf3v4wsNgjZLY0lRSkZn27fRjSls=
177+
github.com/ethereum/c-kzg-4844/v2 v2.1.6/go.mod h1:8HMkUZ5JRv4hpw/XUrYWSQNAUzhHMg2UDb/U+5m+XNw=
176178
github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk=
177179
github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab/go.mod h1:IuLm4IsPipXKF7CW5Lzf68PIbZ5yl7FFd74l/E0o9A8=
178-
github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes=
179-
github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o=
180+
github.com/ethereum/go-ethereum v1.17.1 h1:IjlQDjgxg2uL+GzPRkygGULPMLzcYWncEI7wbaizvho=
181+
github.com/ethereum/go-ethereum v1.17.1/go.mod h1:7UWOVHL7K3b8RfVRea022btnzLCaanwHtBuH1jUCH/I=
180182
github.com/ethpandaops/beacon v0.65.0 h1:ssnab73uiuzhmhtU56q9D3ecVrEYv5n+tuqrXRK4YAg=
181183
github.com/ethpandaops/beacon v0.65.0/go.mod h1:lgzrJjQVV77wZ+PJymsY3bQbAK4jrtP8n3WOwMf1Pcs=
182-
github.com/ethpandaops/ethcore v0.0.0-20260225041126-afac0c250cdf h1:8tgE9iUsf9TyruUT3MXVjUlMy5aEc+fuzraRyPlUbBU=
183-
github.com/ethpandaops/ethcore v0.0.0-20260225041126-afac0c250cdf/go.mod h1:NblaW7ZBfBA85g9SsJyiDzeecTgvxMnFZTWUAj40vg8=
184+
github.com/ethpandaops/ethcore v0.0.0-20260506100832-68848ea0ddaa h1:DBdUJ+zYX7wgH5auHX8uJu/7f5NS+YkKRBA3TWaT4KY=
185+
github.com/ethpandaops/ethcore v0.0.0-20260506100832-68848ea0ddaa/go.mod h1:QsmYTdesob+vQ6pW4KtRVvxLZUNop3cdtd/DgD30hJU=
184186
github.com/ethpandaops/ethereum-package-go v0.8.1 h1:VN5l8UXveyw7gp0Glj8BRzS/D5RKyvhLeaoi/C5Jy5M=
185187
github.com/ethpandaops/ethereum-package-go v0.8.1/go.mod h1:LQThCwlCeeNBTdXOFV+xSwudoced53x+o/Orya3Y+oo=
186188
github.com/ethpandaops/ethwallclock v0.4.0 h1:+sgnhf4pk6hLPukP076VxkiLloE4L0Yk1yat+ZyHh1g=
@@ -252,6 +254,8 @@ github.com/gofrs/uuid/v5 v5.4.0 h1:EfbpCTjqMuGyq5ZJwxqzn3Cbr2d0rUZU7v5ycAk/e/0=
252254
github.com/gofrs/uuid/v5 v5.4.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8=
253255
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
254256
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
257+
github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=
258+
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
255259
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
256260
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
257261
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -295,6 +299,10 @@ github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5T
295299
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA=
296300
github.com/govalues/decimal v0.1.36 h1:dojDpsSvrk0ndAx8+saW5h9WDIHdWpIwrH/yhl9olyU=
297301
github.com/govalues/decimal v0.1.36/go.mod h1:Ee7eI3Llf7hfqDZtpj8Q6NCIgJy1iY3kH1pSwDrNqlM=
302+
github.com/grafana/pyroscope-go v1.2.7 h1:VWBBlqxjyR0Cwk2W6UrE8CdcdD80GOFNutj0Kb1T8ac=
303+
github.com/grafana/pyroscope-go v1.2.7/go.mod h1:o/bpSLiJYYP6HQtvcoVKiE9s5RiNgjYTj1DhiddP2Pc=
304+
github.com/grafana/pyroscope-go/godeltaprof v0.1.9 h1:c1Us8i6eSmkW+Ez05d3co8kasnuOY813tbMN8i/a3Og=
305+
github.com/grafana/pyroscope-go/godeltaprof v0.1.9/go.mod h1:2+l7K7twW49Ct4wFluZD3tZ6e0SjanjcUUBPVD/UuGU=
298306
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 h1:sGm2vDRFUrQJO/Veii4h4zG2vvqG6uWNkBHSTqXOZk0=
299307
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2/go.mod h1:wd1YpapPLivG6nQgbf7ZkG1hhSOXDhhn4MLTknx2aAc=
300308
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
@@ -306,6 +314,8 @@ github.com/hamba/avro/v2 v2.30.0/go.mod h1:X6gDhYv6DQVAT56VqOKuW+PLnQrEQqGB9l1nh
306314
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
307315
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
308316
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
317+
github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE=
318+
github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0=
309319
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
310320
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
311321
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
@@ -500,6 +510,8 @@ github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4
500510
github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE=
501511
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
502512
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
513+
github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A=
514+
github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4=
503515
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
504516
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
505517
github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ=
@@ -707,6 +719,8 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE
707719
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
708720
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
709721
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
722+
github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=
723+
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
710724
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
711725
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
712726
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
@@ -754,8 +768,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
754768
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
755769
github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203 h1:QVqDTf3h2WHt08YuiTGPZLls0Wq99X9bWd0Q5ZSBesM=
756770
github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203/go.mod h1:oqN97ltKNihBbwlX8dLpwxCl3+HnXKV/R0e+sRLd9C8=
757-
github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe h1:nbdqkIGOGfUAD54q1s2YBcBz/WcsxCO9HUQ4aGV5hUw=
758-
github.com/supranational/blst v0.3.16-0.20250831170142-f48500c1fdbe/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw=
771+
github.com/supranational/blst v0.3.16 h1:bTDadT+3fK497EvLdWRQEjiGnUtzJ7jjIUMF0jqwYhE=
772+
github.com/supranational/blst v0.3.16/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw=
759773
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs=
760774
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
761775
github.com/testcontainers/testcontainers-go v0.40.0 h1:pSdJYLOVgLE8YdUY2FHQ1Fxu+aMnb6JfVz1mxk7OeMU=

pkg/mimicry/coordinator/static/config.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@ import (
66
)
77

88
type Config struct {
9-
RetryInterval time.Duration `yaml:"retryInterval" default:"60s"`
10-
NodeRecords []string `yaml:"nodeRecords"`
9+
RetryInterval time.Duration `yaml:"retryInterval" default:"60s"`
10+
MaxConcurrentPeers int `yaml:"maxConcurrentPeers" default:"0"`
11+
NodeRecords []string `yaml:"nodeRecords"`
1112
}
1213

1314
func (c *Config) Validate() error {
1415
if len(c.NodeRecords) == 0 {
1516
return errors.New("nodeRecords is required")
1617
}
1718

19+
if c.MaxConcurrentPeers < 0 {
20+
return errors.New("maxConcurrentPeers cannot be negative")
21+
}
22+
1823
return nil
1924
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package static
2+
3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/require"
7+
)
8+
9+
func TestConfigValidateRejectsNegativeMaxConcurrentPeers(t *testing.T) {
10+
cfg := &Config{
11+
NodeRecords: []string{"enr:test"},
12+
MaxConcurrentPeers: -1,
13+
}
14+
15+
require.ErrorContains(t, cfg.Validate(), "maxConcurrentPeers")
16+
}

0 commit comments

Comments
 (0)