Skip to content

Commit f6d3c3b

Browse files
authored
feat: add client_bin benchmark variable for testing different client binaries (#165)
1 parent 6a757e9 commit f6d3c3b

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

runner/benchmark/benchmark.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ func NewParamsFromValues(assignments map[string]interface{}) (*types.RunParams,
5454
} else {
5555
return nil, fmt.Errorf("invalid node type %s", v)
5656
}
57+
case "client_bin":
58+
if vStr, ok := v.(string); ok {
59+
params.ClientBinPath = vStr
60+
} else {
61+
return nil, fmt.Errorf("invalid client bin %s", v)
62+
}
5763
case "validator_node_type":
5864
if vStr, ok := v.(string); ok {
5965
params.ValidatorNodeType = vStr

runner/network/types/types.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ type RunParams struct {
8888

8989
// NodeArgs are the arguments to be passed to the node binary.
9090
NodeArgs []string
91+
92+
// ClientBinPath is an optional override for the client binary path.
93+
ClientBinPath string
9194
}
9295

9396
func (p RunParams) ToConfig() map[string]interface{} {
@@ -115,6 +118,18 @@ func (p RunParams) ToConfig() map[string]interface{} {
115118
// ClientOptions applies any client customization options to the given client options.
116119
func (p RunParams) ClientOptions(prevClientOptions config.ClientOptions) config.ClientOptions {
117120
prevClientOptions.NodeArgs = p.NodeArgs
121+
if p.ClientBinPath != "" {
122+
switch p.NodeType {
123+
case "reth":
124+
prevClientOptions.RethBin = p.ClientBinPath
125+
case "geth":
126+
prevClientOptions.GethBin = p.ClientBinPath
127+
case "builder":
128+
prevClientOptions.BuilderBin = p.ClientBinPath
129+
case "base-reth-node":
130+
prevClientOptions.BaseRethNodeBin = p.ClientBinPath
131+
}
132+
}
118133
return prevClientOptions
119134
}
120135

0 commit comments

Comments
 (0)