Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
- "Submitted builder validator registration settings for custom builders" log message moved to debug level.
- config: Genesis validator root is now hardcoded in params.BeaconConfig()
- `grpc-gateway-host` is renamed to http-host. The old name can still be used as an alias.
- `grpc-gateway-port` is renamed to http-port.
- `grpc-gateway-corsdomain` is renamed to http-cors-domain.
- `grpc-gateway-port` is renamed to http-port. The old name can still be used as an alias.
- `grpc-gateway-corsdomain` is renamed to http-cors-domain. The old name can still be used as an alias.
- `api-timeout` is changed from int flag to duration flag, default value updated.

### Deprecated
Expand Down
23 changes: 23 additions & 0 deletions beacon-chain/node/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,26 @@ func TestConfigureInterop(t *testing.T) {
})
}
}

func TestAliasFlag(t *testing.T) {
// Create a new app with the flag
app := &cli.App{
Flags: []cli.Flag{flags.HTTPServerHost},
Action: func(c *cli.Context) error {
// Test if the alias works and sets the flag correctly
if c.IsSet("grpc-gateway-host") && c.IsSet("http-host") {
return nil
}
return cli.Exit("Alias or flag not set", 1)
},
}

// Simulate command line arguments that include the alias
args := []string{"app", "--grpc-gateway-host", "config.yml"}

// Run the app with the simulated arguments
err := app.Run(args)

// Check if the alias set the flag correctly
assert.NoError(t, err)
}
2 changes: 1 addition & 1 deletion cmd/validator/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ var (
}
// HTTPServerCorsDomain adds accepted cross origin request addresses.
HTTPServerCorsDomain = &cli.StringFlag{
Name: "corsdomain",
Name: "http-cors-domain",
Usage: `Comma separated list of domains from which to accept cross origin requests (browser enforced).`,
Value: "http://localhost:7500,http://127.0.0.1:7500,http://0.0.0.0:7500,http://localhost:4242,http://127.0.0.1:4242,http://localhost:4200,http://0.0.0.0:4242,http://127.0.0.1:4200,http://0.0.0.0:4200,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000",
Aliases: []string{"grpc-gateway-corsdomain"},
Expand Down
3 changes: 2 additions & 1 deletion testing/endtoend/components/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,13 @@ func (v *ValidatorNode) Start(ctx context.Context) error {
if err != nil {
return err
}
portFlagName := "grpc-gateway-port" // TODO: replace port flag name with flags.HTTPServerPort.Name in a future release
args := []string{
fmt.Sprintf("--%s=%s/eth2-val-%d", cmdshared.DataDirFlag.Name, e2e.TestParams.TestPath, index),
fmt.Sprintf("--%s=%s", cmdshared.LogFileName.Name, logFile.Name()),
fmt.Sprintf("--%s=%s", flags.GraffitiFileFlag.Name, gFile),
fmt.Sprintf("--%s=%d", flags.MonitoringPortFlag.Name, e2e.TestParams.Ports.ValidatorMetricsPort+index),
fmt.Sprintf("--%s=%d", flags.HTTPServerPort.Name, e2e.TestParams.Ports.ValidatorHTTPPort+index),
fmt.Sprintf("--%s=%d", portFlagName, e2e.TestParams.Ports.ValidatorHTTPPort+index),
fmt.Sprintf("--%s=localhost:%d", flags.BeaconRPCProviderFlag.Name, beaconRPCPort),

fmt.Sprintf("--%s=%s", flags.GRPCHeadersFlag.Name, "dummy=value,foo=bar"), // Sending random headers shouldn't break anything.
Expand Down