Skip to content

Commit d00255a

Browse files
committed
add --contender flag to enable contender
1 parent a8f6b07 commit d00255a

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ var networkName string
3030
var labels playground.MapStringFlag
3131
var disableLogs bool
3232
var platform string
33+
var contenderEnabled bool
3334

3435
var rootCmd = &cobra.Command{
3536
Use: "playground",
@@ -179,6 +180,7 @@ func main() {
179180
recipeCmd.Flags().Var(&labels, "labels", "list of labels to apply to the resources")
180181
recipeCmd.Flags().BoolVar(&disableLogs, "disable-logs", false, "disable logs")
181182
recipeCmd.Flags().StringVar(&platform, "platform", "", "docker platform to use")
183+
recipeCmd.Flags().BoolVar(&contenderEnabled, "contender", false, "spam nodes with contender")
182184

183185
cookCmd.AddCommand(recipeCmd)
184186
}
@@ -224,7 +226,7 @@ func runIt(recipe playground.Recipe) error {
224226
return err
225227
}
226228

227-
svcManager := recipe.Apply(&playground.ExContext{LogLevel: logLevel}, artifacts)
229+
svcManager := recipe.Apply(&playground.ExContext{LogLevel: logLevel, ContenderEnabled: contenderEnabled}, artifacts)
228230
if err := svcManager.Validate(); err != nil {
229231
return fmt.Errorf("failed to validate manifest: %w", err)
230232
}

playground/manifest.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ type ExContext struct {
8282
// Bootnode reference for EL nodes.
8383
// TODO: Extend for CL nodes too
8484
Bootnode *BootnodeRef
85+
86+
ContenderEnabled bool
8587
}
8688

8789
type BootnodeRef struct {

playground/recipe_buildernet.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ func (b *BuilderNetRecipe) Apply(ctx *ExContext, artifacts *Artifacts) *Manifest
5959
})
6060
}
6161

62-
svcManager.AddService("contender", &Contender{})
62+
if ctx.ContenderEnabled {
63+
svcManager.AddService("contender", &Contender{})
64+
}
6365

6466
return svcManager
6567
}

playground/recipe_l1.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ func (l *L1Recipe) Apply(ctx *ExContext, artifacts *Artifacts) *Manifest {
107107
})
108108
}
109109

110-
svcManager.AddService("contender", &Contender{})
110+
if ctx.ContenderEnabled {
111+
svcManager.AddService("contender", &Contender{})
112+
}
111113

112114
return svcManager
113115
}

playground/recipe_opstack.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ func (o *OpRecipe) Apply(ctx *ExContext, artifacts *Artifacts) *Manifest {
127127
MaxChannelDuration: o.batcherMaxChannelDuration,
128128
})
129129

130-
svcManager.AddService("contender", &Contender{})
130+
if ctx.ContenderEnabled {
131+
svcManager.AddService("contender", &Contender{})
132+
}
131133

132134
return svcManager
133135
}

0 commit comments

Comments
 (0)