Skip to content

Commit 59327e7

Browse files
authored
Update recipe_l1.go
1 parent 1ca515d commit 59327e7

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

internal/recipe_l1.go

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,18 @@ func (l *L1Recipe) Artifacts() *ArtifactsBuilder {
5252
func (l *L1Recipe) Apply(ctx *ExContext, artifacts *Artifacts) *Manifest {
5353
svcManager := NewManifest(ctx, artifacts.Out)
5454

55-
svcManager.AddService("el", &RethEL{
55+
// Add bootnode service first
56+
bootnode := &Bootnode{
57+
DiscoveryPort: 30301,
58+
}
59+
svcManager.AddService("bootnode", bootnode)
60+
61+
el := &RethEL{
5662
UseRethForValidation: l.useRethForValidation,
5763
UseNativeReth: l.useNativeReth,
58-
})
64+
}
65+
svcManager.AddService("el", el)
66+
svcManager.MustGetService("el").DependsOnHealthy("bootnode")
5967

6068
var elService string
6169
if l.secondaryELPort != 0 {
@@ -70,22 +78,34 @@ func (l *L1Recipe) Apply(ctx *ExContext, artifacts *Artifacts) *Manifest {
7078
elService = "el"
7179
}
7280

73-
svcManager.AddService("beacon", &LighthouseBeaconNode{
81+
// Add beacon node with dependency on bootnode
82+
beacon := &LighthouseBeaconNode{
7483
ExecutionNode: elService,
7584
MevBoostNode: "mev-boost",
76-
})
77-
svcManager.AddService("validator", &LighthouseValidator{
85+
}
86+
svcManager.AddService("beacon", beacon)
87+
svcManager.MustGetService("beacon").DependsOnHealthy("bootnode")
88+
89+
// Add validator with dependency on beacon node
90+
validator := &LighthouseValidator{
7891
BeaconNode: "beacon",
79-
})
92+
}
93+
svcManager.AddService("validator", validator)
94+
svcManager.MustGetService("validator").DependsOnHealthy("beacon")
8095

8196
mevBoostValidationServer := ""
8297
if l.useRethForValidation {
8398
mevBoostValidationServer = "el"
8499
}
85-
svcManager.AddService("mev-boost", &MevBoostRelay{
100+
101+
// Add mev-boost with dependency on beacon node
102+
mevBoost := &MevBoostRelay{
86103
BeaconClient: "beacon",
87104
ValidationServer: mevBoostValidationServer,
88-
})
105+
}
106+
svcManager.AddService("mev-boost", mevBoost)
107+
svcManager.MustGetService("mev-boost").DependsOnHealthy("beacon")
108+
89109
return svcManager
90110
}
91111

0 commit comments

Comments
 (0)