Skip to content

Commit fa75d33

Browse files
committed
account for UseNativeReth in Contender config
1 parent 838b0fb commit fa75d33

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

playground/components.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -718,22 +718,33 @@ func (n *nullService) Name() string {
718718
return "null"
719719
}
720720

721-
type Contender struct{}
721+
type Contender struct {
722+
UseNativeReth bool
723+
}
722724

723725
func (c *Contender) Name() string {
724726
return "contender"
725727
}
726728

727729
func (c *Contender) Run(service *Service, ctx *ExContext) {
730+
var targetNode string
731+
732+
if c.UseNativeReth {
733+
targetNode = "http://host.docker.internal:8545"
734+
} else {
735+
targetNode = Connect("el", "http")
736+
}
737+
728738
args := []string{
729739
"spam",
730740
"-l", // loop indefinitely
731741
"--min-balance", "10 ether",
732-
"-r", Connect("el", "http"),
733-
"--tpb", "20", // send 20 txs per block
742+
"-r", targetNode,
743+
"--tps", "20", // send 20 txs per block
734744
}
735745
service.WithImage("flashbots/contender").
736746
WithTag("latest").
737747
WithArgs(args...).
738748
DependsOnHealthy("beacon")
749+
739750
}

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+
svcManager.AddService("contender", &Contender{
63+
UseNativeReth: b.l1Recipe.useNativeReth,
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+
svcManager.AddService("contender", &Contender{
111+
UseNativeReth: l.useNativeReth,
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+
svcManager.AddService("contender", &Contender{
131+
UseNativeReth: false,
132+
})
131133

132134
return svcManager
133135
}

0 commit comments

Comments
 (0)