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
e9303108
Unverified
Commit
e9303108
authored
Aug 21, 2023
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-node: improve rpc init error messages
parent
6295ff59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
types.go
op-node/rollup/types.go
+4
-4
No files found.
op-node/rollup/types.go
View file @
e9303108
...
@@ -139,7 +139,7 @@ type L1Client interface {
...
@@ -139,7 +139,7 @@ type L1Client interface {
func
(
cfg
*
Config
)
CheckL1ChainID
(
ctx
context
.
Context
,
client
L1Client
)
error
{
func
(
cfg
*
Config
)
CheckL1ChainID
(
ctx
context
.
Context
,
client
L1Client
)
error
{
id
,
err
:=
client
.
ChainID
(
ctx
)
id
,
err
:=
client
.
ChainID
(
ctx
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"failed to get L1 chain ID: %w"
,
err
)
}
}
if
cfg
.
L1ChainID
.
Cmp
(
id
)
!=
0
{
if
cfg
.
L1ChainID
.
Cmp
(
id
)
!=
0
{
return
fmt
.
Errorf
(
"incorrect L1 RPC chain id %d, expected %d"
,
id
,
cfg
.
L1ChainID
)
return
fmt
.
Errorf
(
"incorrect L1 RPC chain id %d, expected %d"
,
id
,
cfg
.
L1ChainID
)
...
@@ -151,7 +151,7 @@ func (cfg *Config) CheckL1ChainID(ctx context.Context, client L1Client) error {
...
@@ -151,7 +151,7 @@ func (cfg *Config) CheckL1ChainID(ctx context.Context, client L1Client) error {
func
(
cfg
*
Config
)
CheckL1GenesisBlockHash
(
ctx
context
.
Context
,
client
L1Client
)
error
{
func
(
cfg
*
Config
)
CheckL1GenesisBlockHash
(
ctx
context
.
Context
,
client
L1Client
)
error
{
l1GenesisBlockRef
,
err
:=
client
.
L1BlockRefByNumber
(
ctx
,
cfg
.
Genesis
.
L1
.
Number
)
l1GenesisBlockRef
,
err
:=
client
.
L1BlockRefByNumber
(
ctx
,
cfg
.
Genesis
.
L1
.
Number
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"failed to get L1 genesis blockhash: %w"
,
err
)
}
}
if
l1GenesisBlockRef
.
Hash
!=
cfg
.
Genesis
.
L1
.
Hash
{
if
l1GenesisBlockRef
.
Hash
!=
cfg
.
Genesis
.
L1
.
Hash
{
return
fmt
.
Errorf
(
"incorrect L1 genesis block hash %s, expected %s"
,
l1GenesisBlockRef
.
Hash
,
cfg
.
Genesis
.
L1
.
Hash
)
return
fmt
.
Errorf
(
"incorrect L1 genesis block hash %s, expected %s"
,
l1GenesisBlockRef
.
Hash
,
cfg
.
Genesis
.
L1
.
Hash
)
...
@@ -168,7 +168,7 @@ type L2Client interface {
...
@@ -168,7 +168,7 @@ type L2Client interface {
func
(
cfg
*
Config
)
CheckL2ChainID
(
ctx
context
.
Context
,
client
L2Client
)
error
{
func
(
cfg
*
Config
)
CheckL2ChainID
(
ctx
context
.
Context
,
client
L2Client
)
error
{
id
,
err
:=
client
.
ChainID
(
ctx
)
id
,
err
:=
client
.
ChainID
(
ctx
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"failed to get L2 chain ID: %w"
,
err
)
}
}
if
cfg
.
L2ChainID
.
Cmp
(
id
)
!=
0
{
if
cfg
.
L2ChainID
.
Cmp
(
id
)
!=
0
{
return
fmt
.
Errorf
(
"incorrect L2 RPC chain id %d, expected %d"
,
id
,
cfg
.
L2ChainID
)
return
fmt
.
Errorf
(
"incorrect L2 RPC chain id %d, expected %d"
,
id
,
cfg
.
L2ChainID
)
...
@@ -180,7 +180,7 @@ func (cfg *Config) CheckL2ChainID(ctx context.Context, client L2Client) error {
...
@@ -180,7 +180,7 @@ func (cfg *Config) CheckL2ChainID(ctx context.Context, client L2Client) error {
func
(
cfg
*
Config
)
CheckL2GenesisBlockHash
(
ctx
context
.
Context
,
client
L2Client
)
error
{
func
(
cfg
*
Config
)
CheckL2GenesisBlockHash
(
ctx
context
.
Context
,
client
L2Client
)
error
{
l2GenesisBlockRef
,
err
:=
client
.
L2BlockRefByNumber
(
ctx
,
cfg
.
Genesis
.
L2
.
Number
)
l2GenesisBlockRef
,
err
:=
client
.
L2BlockRefByNumber
(
ctx
,
cfg
.
Genesis
.
L2
.
Number
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
fmt
.
Errorf
(
"failed to get L2 genesis blockhash: %w"
,
err
)
}
}
if
l2GenesisBlockRef
.
Hash
!=
cfg
.
Genesis
.
L2
.
Hash
{
if
l2GenesisBlockRef
.
Hash
!=
cfg
.
Genesis
.
L2
.
Hash
{
return
fmt
.
Errorf
(
"incorrect L2 genesis block hash %s, expected %s"
,
l2GenesisBlockRef
.
Hash
,
cfg
.
Genesis
.
L2
.
Hash
)
return
fmt
.
Errorf
(
"incorrect L2 genesis block hash %s, expected %s"
,
l2GenesisBlockRef
.
Hash
,
cfg
.
Genesis
.
L2
.
Hash
)
...
...
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