Skip to content

Commit

Permalink
op-node: Hide rethDB option
Browse files Browse the repository at this point in the history
If the rethDB option is used without the proper build configuration,
the op-node will panic. Note that we do not have this build configuration
in our releases. This hides the option to use it, but does not fully
remove it. There was some duplication required to easily hide the
command line flag while still being able to use it for testing purposes.

This commit should be reverted when rethDB is stable.
  • Loading branch information
trianglesphere committed Oct 30, 2023
1 parent c3efa31 commit 3f3ad34
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions op-node/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ var (
Usage: "The L1 RethDB path, used to fetch receipts for L1 blocks. Only applicable when using the `reth_db` RPC kind with `l1.rpckind`.",
EnvVars: prefixEnvVars("L1_RETHDB"),
Required: false,
Hidden: true,
}
L1RPCRateLimit = &cli.Float64Flag{
Name: "l1.rpc-rate-limit",
Expand Down
8 changes: 6 additions & 2 deletions op-service/sources/receipts.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,13 @@ var RPCProviderKinds = []RPCProviderKind{
RPCKindBasic,
RPCKindAny,
RPCKindStandard,
RPCKindRethDB,
}

// Copy of RPCProviderKinds with RethDB added to all RethDB to be used but to hide it from the flags
var validRPCProviderKinds = func() []RPCProviderKind {
return append(RPCProviderKinds, RPCKindRethDB)
}()

func (kind RPCProviderKind) String() string {
return string(kind)
}
Expand All @@ -159,7 +163,7 @@ func (kind *RPCProviderKind) Clone() any {
}

func ValidRPCProviderKind(value RPCProviderKind) bool {
for _, k := range RPCProviderKinds {
for _, k := range validRPCProviderKinds {
if k == value {
return true
}
Expand Down

0 comments on commit 3f3ad34

Please sign in to comment.