Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
ef7a44e2
Unverified
Commit
ef7a44e2
authored
Sep 25, 2023
by
OptimismBot
Committed by
GitHub
Sep 25, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7363 from ethereum-optimism/fix-beta-flags
op-node: update flags, remove BETA_ prefix
parents
8393e837
fc381232
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
flags.go
op-node/flags/flags.go
+2
-2
flags_test.go
op-node/flags/flags_test.go
+22
-0
No files found.
op-node/flags/flags.go
View file @
ef7a44e2
...
@@ -246,12 +246,12 @@ var (
...
@@ -246,12 +246,12 @@ var (
RollupHalt
=
&
cli
.
StringFlag
{
RollupHalt
=
&
cli
.
StringFlag
{
Name
:
"rollup.halt"
,
Name
:
"rollup.halt"
,
Usage
:
"Opt-in option to halt on incompatible protocol version requirements of the given level (major/minor/patch/none), as signaled onchain in L1"
,
Usage
:
"Opt-in option to halt on incompatible protocol version requirements of the given level (major/minor/patch/none), as signaled onchain in L1"
,
EnvVars
:
prefixEnvVars
(
"
BETA_
ROLLUP_HALT"
),
EnvVars
:
prefixEnvVars
(
"ROLLUP_HALT"
),
}
}
RollupLoadProtocolVersions
=
&
cli
.
BoolFlag
{
RollupLoadProtocolVersions
=
&
cli
.
BoolFlag
{
Name
:
"rollup.load-protocol-versions"
,
Name
:
"rollup.load-protocol-versions"
,
Usage
:
"Load protocol versions from the superchain L1 ProtocolVersions contract (if available), and report in logs and metrics"
,
Usage
:
"Load protocol versions from the superchain L1 ProtocolVersions contract (if available), and report in logs and metrics"
,
EnvVars
:
prefixEnvVars
(
"
BETA_
ROLLUP_LOAD_PROTOCOL_VERSIONS"
),
EnvVars
:
prefixEnvVars
(
"ROLLUP_LOAD_PROTOCOL_VERSIONS"
),
}
}
CanyonOverrideFlag
=
&
cli
.
Uint64Flag
{
CanyonOverrideFlag
=
&
cli
.
Uint64Flag
{
Name
:
"override.canyon"
,
Name
:
"override.canyon"
,
...
...
op-node/flags/flags_test.go
View file @
ef7a44e2
package
flags
package
flags
import
(
import
(
"strings"
"testing"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"github.com/urfave/cli/v2"
"github.com/urfave/cli/v2"
)
)
...
@@ -29,3 +31,23 @@ func TestUniqueFlags(t *testing.T) {
...
@@ -29,3 +31,23 @@ func TestUniqueFlags(t *testing.T) {
seenCLI
[
name
]
=
struct
{}{}
seenCLI
[
name
]
=
struct
{}{}
}
}
}
}
// TestBetaFlags test that all flags starting with "beta." have "BETA_" in the env var, and vice versa.
func
TestBetaFlags
(
t
*
testing
.
T
)
{
for
_
,
flag
:=
range
Flags
{
envFlag
,
ok
:=
flag
.
(
interface
{
GetEnvVars
()
[]
string
})
if
!
ok
||
len
(
envFlag
.
GetEnvVars
())
==
0
{
// skip flags without env-var support
continue
}
name
:=
flag
.
Names
()[
0
]
envName
:=
envFlag
.
GetEnvVars
()[
0
]
if
strings
.
HasPrefix
(
name
,
"beta."
)
{
assert
.
Contains
(
t
,
envName
,
"BETA_"
,
"%q flag must contain BETA in env var to match
\"
beta.
\"
flag name"
,
name
)
}
if
strings
.
Contains
(
envName
,
"BETA_"
)
{
assert
.
True
(
t
,
strings
.
HasPrefix
(
name
,
"beta."
),
"%q flag must start with
\"
beta.
\"
in flag name to match
\"
BETA_
\"
env var"
,
name
)
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment