@@ -28,6 +28,10 @@ func (r *RollupBoost) Run(service *service, ctx *ExContext) {
28
28
)
29
29
}
30
30
31
+ func (r * RollupBoost ) Name () string {
32
+ return "rollup-boost"
33
+ }
34
+
31
35
type OpBatcher struct {
32
36
L1Node string
33
37
L2Node string
@@ -51,6 +55,10 @@ func (o *OpBatcher) Run(service *service, ctx *ExContext) {
51
55
)
52
56
}
53
57
58
+ func (o * OpBatcher ) Name () string {
59
+ return "op-batcher"
60
+ }
61
+
54
62
type OpNode struct {
55
63
L1Node string
56
64
L1Beacon string
@@ -62,6 +70,7 @@ func (o *OpNode) Run(service *service, ctx *ExContext) {
62
70
WithImage ("us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node" ).
63
71
WithTag ("v1.11.0" ).
64
72
WithEntrypoint ("op-node" ).
73
+ WithEnv ("A" , "B" ). // this is just a placeholder to make sure env works since we e2e test with the recipes
65
74
WithArgs (
66
75
"--l1" , Connect (o .L1Node , "http" ),
67
76
"--l1.beacon" , Connect (o .L1Beacon , "http" ),
@@ -90,6 +99,10 @@ func (o *OpNode) Run(service *service, ctx *ExContext) {
90
99
)
91
100
}
92
101
102
+ func (o * OpNode ) Name () string {
103
+ return "op-node"
104
+ }
105
+
93
106
type OpGeth struct {
94
107
UseDeterministicP2PKey bool
95
108
@@ -159,16 +172,14 @@ func (o *OpGeth) Run(service *service, ctx *ExContext) {
159
172
)
160
173
}
161
174
162
- var _ ServiceReady = & OpGeth {}
163
-
164
- func (o * OpGeth ) Ready (out io.Writer , service * service , ctx context.Context ) error {
165
- logs := service .logs
175
+ func (o * OpGeth ) Name () string {
176
+ return "op-geth"
177
+ }
166
178
167
- if err := logs .WaitForLog ("HTTP server started" , 5 * time .Second ); err != nil {
168
- return err
169
- }
179
+ var _ ServiceReady = & OpGeth {}
170
180
171
- enodeLine , err := logs .FindLog ("enode://" )
181
+ func (o * OpGeth ) Ready (service * service ) error {
182
+ enodeLine , err := service .logs .FindLog ("enode://" )
172
183
if err != nil {
173
184
return err
174
185
}
@@ -262,6 +273,10 @@ func (r *RethEL) Run(svc *service, ctx *ExContext) {
262
273
}
263
274
}
264
275
276
+ func (r * RethEL ) Name () string {
277
+ return "reth"
278
+ }
279
+
265
280
var _ ServiceWatchdog = & RethEL {}
266
281
267
282
func (r * RethEL ) Watchdog (out io.Writer , service * service , ctx context.Context ) error {
@@ -283,15 +298,9 @@ func (l *LighthouseBeaconNode) Run(svc *service, ctx *ExContext) {
283
298
"bn" ,
284
299
"--datadir" , "{{.Dir}}/data_beacon_node" ,
285
300
"--testnet-dir" , "{{.Dir}}/testnet" ,
301
+ "--enable-private-discovery" ,
286
302
"--disable-peer-scoring" ,
287
303
"--staking" ,
288
- "--disable-discovery" ,
289
- "--disable-upnp" ,
290
- "--disable-packet-filter" ,
291
- "--target-peers" , "0" ,
292
- "--boot-nodes" , "" ,
293
- "--debug-level" , "error" ,
294
- "--logfile-debug-level" , "error" ,
295
304
"--enr-address" , "127.0.0.1" ,
296
305
"--enr-udp-port" , `{{Port "p2p" 9000}}` ,
297
306
"--enr-tcp-port" , `{{Port "p2p" 9000}}` ,
@@ -302,12 +311,21 @@ func (l *LighthouseBeaconNode) Run(svc *service, ctx *ExContext) {
302
311
"--http-port" , `{{Port "http" 3500}}` ,
303
312
"--http-address" , "0.0.0.0" ,
304
313
"--http-allow-origin" , "*" ,
314
+ "--disable-packet-filter" ,
315
+ "--target-peers" , "0" ,
305
316
"--execution-endpoint" , Connect (l .ExecutionNode , "authrpc" ),
306
317
"--execution-jwt" , "{{.Dir}}/jwtsecret" ,
307
318
"--always-prepare-payload" ,
308
319
"--prepare-payload-lookahead" , "8000" ,
309
320
"--suggested-fee-recipient" , "0x690B9A9E9aa1C9dB991C7721a92d351Db4FaC990" ,
310
- )
321
+ ).
322
+ WithReady (ReadyCheck {
323
+ QueryURL : "http://localhost:3500/eth/v1/node/syncing" ,
324
+ Interval : 1 * time .Second ,
325
+ Timeout : 30 * time .Second ,
326
+ Retries : 3 ,
327
+ StartPeriod : 1 * time .Second ,
328
+ })
311
329
312
330
if l .MevBoostNode != "" {
313
331
svc .WithArgs (
@@ -318,15 +336,8 @@ func (l *LighthouseBeaconNode) Run(svc *service, ctx *ExContext) {
318
336
}
319
337
}
320
338
321
- var _ ServiceReady = & LighthouseBeaconNode {}
322
-
323
- func (l * LighthouseBeaconNode ) Ready (logOutput io.Writer , service * service , ctx context.Context ) error {
324
- beaconNodeURL := fmt .Sprintf ("http://localhost:%d" , service .MustGetPort ("http" ).HostPort )
325
-
326
- if err := waitForChainAlive (ctx , logOutput , beaconNodeURL , 30 * time .Second ); err != nil {
327
- return err
328
- }
329
- return nil
339
+ func (l * LighthouseBeaconNode ) Name () string {
340
+ return "lighthouse-beacon-node"
330
341
}
331
342
332
343
type LighthouseValidator struct {
@@ -351,6 +362,10 @@ func (l *LighthouseValidator) Run(service *service, ctx *ExContext) {
351
362
)
352
363
}
353
364
365
+ func (l * LighthouseValidator ) Name () string {
366
+ return "lighthouse-validator"
367
+ }
368
+
354
369
type ClProxy struct {
355
370
PrimaryBuilder string
356
371
SecondaryBuilder string
@@ -368,6 +383,10 @@ func (c *ClProxy) Run(service *service, ctx *ExContext) {
368
383
)
369
384
}
370
385
386
+ func (c * ClProxy ) Name () string {
387
+ return "cl-proxy"
388
+ }
389
+
371
390
type MevBoostRelay struct {
372
391
BeaconClient string
373
392
ValidationServer string
@@ -378,6 +397,7 @@ func (m *MevBoostRelay) Run(service *service, ctx *ExContext) {
378
397
WithImage ("docker.io/flashbots/playground-utils" ).
379
398
WithTag ("latest" ).
380
399
WithEntrypoint ("mev-boost-relay" ).
400
+ DependsOnHealthy (m .BeaconClient ).
381
401
WithArgs (
382
402
"--api-listen-addr" , "0.0.0.0" ,
383
403
"--api-listen-port" , `{{Port "http" 5555}}` ,
@@ -389,6 +409,10 @@ func (m *MevBoostRelay) Run(service *service, ctx *ExContext) {
389
409
}
390
410
}
391
411
412
+ func (m * MevBoostRelay ) Name () string {
413
+ return "mev-boost-relay"
414
+ }
415
+
392
416
var _ ServiceWatchdog = & MevBoostRelay {}
393
417
394
418
func (m * MevBoostRelay ) Watchdog (out io.Writer , service * service , ctx context.Context ) error {
@@ -413,24 +437,24 @@ func (b *BuilderHubPostgres) Run(service *service, ctx *ExContext) {
413
437
WithImage ("docker.io/flashbots/builder-hub-db" ).
414
438
WithTag ("latest" ).
415
439
WithPort ("postgres" , 5432 ).
416
- WithLabel ("POSTGRES_USER" , "postgres" ).
417
- WithLabel ("POSTGRES_PASSWORD" , "postgres" ).
418
- WithLabel ("POSTGRES_DB" , "postgres" )
440
+ WithEnv ("POSTGRES_USER" , "postgres" ).
441
+ WithEnv ("POSTGRES_PASSWORD" , "postgres" ).
442
+ WithEnv ("POSTGRES_DB" , "postgres" ).
443
+ WithReady (ReadyCheck {
444
+ Test : []string {"pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" },
445
+ Interval : 1 * time .Second ,
446
+ Timeout : 30 * time .Second ,
447
+ Retries : 3 ,
448
+ StartPeriod : 1 * time .Second ,
449
+ })
419
450
}
420
451
421
- var _ ServiceReady = & BuilderHubPostgres {}
422
-
423
- func (b * BuilderHubPostgres ) Ready (out io.Writer , service * service , ctx context.Context ) error {
424
- logs := service .logs
425
- if err := logs .WaitForLog ("database system is ready to accept connections" , 30 * time .Second ); err != nil {
426
- return err
427
- }
428
-
429
- fmt .Fprintln (out , "PostgreSQL is ready for builder-hub" )
430
- return nil
452
+ func (b * BuilderHubPostgres ) Name () string {
453
+ return "builder-hub-postgres"
431
454
}
432
455
433
456
type BuilderHub struct {
457
+ postgres string
434
458
}
435
459
436
460
func (b * BuilderHub ) Run (service * service , ctx * ExContext ) {
@@ -444,22 +468,14 @@ func (b *BuilderHub) Run(service *service, ctx *ExContext) {
444
468
"--metrics-addr" , fmt .Sprintf ("0.0.0.0:%s" , `{{Port "metrics" 8090}}` ),
445
469
"--log-json" , "true" ,
446
470
"--log-debug" ,
447
- // Use proper template format for postgres connection
448
- "--postgres-dsn " , `postgres://postgres:postgres@{{Service "builder-hub-postgres" "postgres"}}/postgres?sslmode=disable` ,
449
- "--mock-secrets" , "true" , // Use mock secrets for easier testing
450
- )
471
+ "--postgres-dsn" , "postgres:// postgres:postgres@" + Connect ( b . postgres , "postgres" ) + ":5432/postgres?sslmode=disable" ,
472
+ "--mock-secrets " , "true" ,
473
+ ).
474
+ DependsOnHealthy ( b . postgres )
451
475
}
452
476
453
- var _ ServiceReady = & BuilderHub {}
454
-
455
- func (b * BuilderHub ) Ready (out io.Writer , service * service , ctx context.Context ) error {
456
- logs := service .logs
457
- if err := logs .WaitForLog ("Starting API service" , 30 * time .Second ); err != nil {
458
- return err
459
- }
460
-
461
- fmt .Fprintln (out , "Builder-Hub service is ready" )
462
- return nil
477
+ func (b * BuilderHub ) Name () string {
478
+ return "builder-hub"
463
479
}
464
480
465
481
type BuilderHubMockProxy struct {
@@ -473,9 +489,40 @@ func (b *BuilderHubMockProxy) Run(service *service, ctx *ExContext) {
473
489
WithPort ("http" , 8888 )
474
490
475
491
if b .TargetService != "" {
476
- service .nodeRefs = append (service .nodeRefs , & NodeRef {
477
- Service : b .TargetService ,
478
- PortLabel : "http" ,
479
- })
492
+ service .DependsOnHealthy (b .TargetService )
493
+ }
494
+ }
495
+
496
+ func (b * BuilderHubMockProxy ) Name () string {
497
+ return "builder-hub-mock-proxy"
498
+ }
499
+
500
+ type OpReth struct {
501
+ }
502
+
503
+ func (o * OpReth ) Run (service * service , ctx * ExContext ) {
504
+ panic ("BUG: op-reth is not implemented yet" )
505
+ }
506
+
507
+ func (o * OpReth ) Name () string {
508
+ return "op-reth"
509
+ }
510
+
511
+ func (o * OpReth ) ReleaseArtifact () * release {
512
+ return & release {
513
+ Name : "op-reth" ,
514
+ Repo : "reth" ,
515
+ Org : "paradigmxyz" ,
516
+ Version : "v1.3.4" ,
517
+ Arch : func (goos , goarch string ) string {
518
+ if goos == "linux" {
519
+ return "x86_64-unknown-linux-gnu"
520
+ } else if goos == "darwin" && goarch == "arm64" { // Apple M1
521
+ return "aarch64-apple-darwin"
522
+ } else if goos == "darwin" && goarch == "amd64" {
523
+ return "x86_64-apple-darwin"
524
+ }
525
+ return ""
526
+ },
480
527
}
481
528
}
0 commit comments