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
837eac37
Unverified
Commit
837eac37
authored
Apr 25, 2023
by
OptimismBot
Committed by
GitHub
Apr 25, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5534 from ethereum-optimism/aj/fpp-goerli-config
op-program: Embed goerli L2 chain config
parents
77bab8b9
9b85d9b4
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
135 additions
and
59 deletions
+135
-59
main_test.go
op-program/host/cmd/main_test.go
+80
-57
chaincfg.go
op-program/host/config/chaincfg.go
+41
-0
config.go
op-program/host/config/config.go
+10
-1
flags.go
op-program/host/flags/flags.go
+4
-1
No files found.
op-program/host/cmd/main_test.go
View file @
837eac37
This diff is collapsed.
Click to expand it.
op-program/host/config/chaincfg.go
0 → 100644
View file @
837eac37
package
config
import
(
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/params"
)
var
OPGoerliChainConfig
=
&
params
.
ChainConfig
{
ChainID
:
big
.
NewInt
(
420
),
HomesteadBlock
:
big
.
NewInt
(
0
),
DAOForkBlock
:
nil
,
DAOForkSupport
:
false
,
EIP150Block
:
big
.
NewInt
(
0
),
EIP150Hash
:
common
.
Hash
{},
EIP155Block
:
big
.
NewInt
(
0
),
EIP158Block
:
big
.
NewInt
(
0
),
ByzantiumBlock
:
big
.
NewInt
(
0
),
ConstantinopleBlock
:
big
.
NewInt
(
0
),
PetersburgBlock
:
big
.
NewInt
(
0
),
IstanbulBlock
:
big
.
NewInt
(
0
),
MuirGlacierBlock
:
big
.
NewInt
(
0
),
BerlinBlock
:
big
.
NewInt
(
0
),
LondonBlock
:
big
.
NewInt
(
4061224
),
ArrowGlacierBlock
:
big
.
NewInt
(
4061224
),
GrayGlacierBlock
:
big
.
NewInt
(
4061224
),
MergeNetsplitBlock
:
big
.
NewInt
(
4061224
),
BedrockBlock
:
big
.
NewInt
(
4061224
),
RegolithTime
:
&
params
.
OptimismGoerliRegolithTime
,
TerminalTotalDifficulty
:
big
.
NewInt
(
0
),
TerminalTotalDifficultyPassed
:
true
,
Optimism
:
&
params
.
OptimismConfig
{
EIP1559Elasticity
:
10
,
EIP1559Denominator
:
50
,
},
}
var
L2ChainConfigsByName
=
map
[
string
]
*
params
.
ChainConfig
{
"goerli"
:
OPGoerliChainConfig
,
}
op-program/host/config/config.go
View file @
837eac37
...
...
@@ -123,7 +123,16 @@ func NewConfigFromCLI(ctx *cli.Context) (*Config, error) {
return
nil
,
ErrInvalidL1Head
}
l2GenesisPath
:=
ctx
.
GlobalString
(
flags
.
L2GenesisPath
.
Name
)
l2ChainConfig
,
err
:=
loadChainConfigFromGenesis
(
l2GenesisPath
)
var
l2ChainConfig
*
params
.
ChainConfig
if
l2GenesisPath
==
""
{
networkName
:=
ctx
.
GlobalString
(
flags
.
Network
.
Name
)
l2ChainConfig
=
L2ChainConfigsByName
[
networkName
]
if
l2ChainConfig
==
nil
{
return
nil
,
fmt
.
Errorf
(
"flag %s is required for network %s"
,
flags
.
L2GenesisPath
.
Name
,
networkName
)
}
}
else
{
l2ChainConfig
,
err
=
loadChainConfigFromGenesis
(
l2GenesisPath
)
}
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"invalid genesis: %w"
,
err
)
}
...
...
op-program/host/flags/flags.go
View file @
837eac37
...
...
@@ -96,13 +96,13 @@ var requiredFlags = []cli.Flag{
L2Head
,
L2Claim
,
L2BlockNumber
,
L2GenesisPath
,
}
var
programFlags
=
[]
cli
.
Flag
{
RollupConfig
,
Network
,
DataDir
,
L2NodeAddr
,
L2GenesisPath
,
L1NodeAddr
,
L1TrustRPC
,
L1RPCProviderKind
,
...
...
@@ -124,6 +124,9 @@ func CheckRequired(ctx *cli.Context) error {
if
rollupConfig
!=
""
&&
network
!=
""
{
return
fmt
.
Errorf
(
"cannot specify both %s and %s"
,
RollupConfig
.
Name
,
Network
.
Name
)
}
if
network
==
""
&&
ctx
.
GlobalString
(
L2GenesisPath
.
Name
)
==
""
{
return
fmt
.
Errorf
(
"flag %s is required for custom networks"
,
L2GenesisPath
.
Name
)
}
for
_
,
flag
:=
range
requiredFlags
{
if
!
ctx
.
IsSet
(
flag
.
GetName
())
{
return
fmt
.
Errorf
(
"flag %s is required"
,
flag
.
GetName
())
...
...
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