@@ -52,10 +52,18 @@ func (l *L1Recipe) Artifacts() *ArtifactsBuilder {
52
52
func (l * L1Recipe ) Apply (ctx * ExContext , artifacts * Artifacts ) * Manifest {
53
53
svcManager := NewManifest (ctx , artifacts .Out )
54
54
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 {
56
62
UseRethForValidation : l .useRethForValidation ,
57
63
UseNativeReth : l .useNativeReth ,
58
- })
64
+ }
65
+ svcManager .AddService ("el" , el )
66
+ svcManager .MustGetService ("el" ).DependsOnHealthy ("bootnode" )
59
67
60
68
var elService string
61
69
if l .secondaryELPort != 0 {
@@ -70,22 +78,34 @@ func (l *L1Recipe) Apply(ctx *ExContext, artifacts *Artifacts) *Manifest {
70
78
elService = "el"
71
79
}
72
80
73
- svcManager .AddService ("beacon" , & LighthouseBeaconNode {
81
+ // Add beacon node with dependency on bootnode
82
+ beacon := & LighthouseBeaconNode {
74
83
ExecutionNode : elService ,
75
84
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 {
78
91
BeaconNode : "beacon" ,
79
- })
92
+ }
93
+ svcManager .AddService ("validator" , validator )
94
+ svcManager .MustGetService ("validator" ).DependsOnHealthy ("beacon" )
80
95
81
96
mevBoostValidationServer := ""
82
97
if l .useRethForValidation {
83
98
mevBoostValidationServer = "el"
84
99
}
85
- svcManager .AddService ("mev-boost" , & MevBoostRelay {
100
+
101
+ // Add mev-boost with dependency on beacon node
102
+ mevBoost := & MevBoostRelay {
86
103
BeaconClient : "beacon" ,
87
104
ValidationServer : mevBoostValidationServer ,
88
- })
105
+ }
106
+ svcManager .AddService ("mev-boost" , mevBoost )
107
+ svcManager .MustGetService ("mev-boost" ).DependsOnHealthy ("beacon" )
108
+
89
109
return svcManager
90
110
}
91
111
0 commit comments