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
ea82c698
Commit
ea82c698
authored
Sep 15, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix dialing
parent
9f1aaccf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
19 deletions
+2
-19
service.go
op-challenger/game/service.go
+2
-4
dial.go
op-service/client/dial.go
+0
-15
No files found.
op-challenger/game/service.go
View file @
ea82c698
...
@@ -16,7 +16,6 @@ import (
...
@@ -16,7 +16,6 @@ import (
oppprof
"github.com/ethereum-optimism/optimism/op-service/pprof"
oppprof
"github.com/ethereum-optimism/optimism/op-service/pprof"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
)
)
...
@@ -36,11 +35,10 @@ func NewService(ctx context.Context, logger log.Logger, cfg *config.Config) (*Se
...
@@ -36,11 +35,10 @@ func NewService(ctx context.Context, logger log.Logger, cfg *config.Config) (*Se
return
nil
,
fmt
.
Errorf
(
"failed to create the transaction manager: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to create the transaction manager: %w"
,
err
)
}
}
rpcClient
,
err
:=
client
.
DialRPC
ClientWithTimeout
(
client
.
DefaultDialTimeout
,
logger
,
cfg
.
L1EthRpc
)
l1Client
,
err
:=
client
.
DialEth
ClientWithTimeout
(
client
.
DefaultDialTimeout
,
logger
,
cfg
.
L1EthRpc
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to dial L1: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to dial L1: %w"
,
err
)
}
}
l1Client
:=
ethclient
.
NewClient
(
rpcClient
)
pprofConfig
:=
cfg
.
PprofConfig
pprofConfig
:=
cfg
.
PprofConfig
if
pprofConfig
.
Enabled
{
if
pprofConfig
.
Enabled
{
...
@@ -79,7 +77,7 @@ func NewService(ctx context.Context, logger log.Logger, cfg *config.Config) (*Se
...
@@ -79,7 +77,7 @@ func NewService(ctx context.Context, logger log.Logger, cfg *config.Config) (*Se
return
fault
.
NewGamePlayer
(
ctx
,
logger
,
m
,
cfg
,
dir
,
addr
,
txMgr
,
l1Client
)
return
fault
.
NewGamePlayer
(
ctx
,
logger
,
m
,
cfg
,
dir
,
addr
,
txMgr
,
l1Client
)
})
})
pollClient
,
err
:=
opClient
.
NewRPCWithClient
(
ctx
,
logger
,
cfg
.
L1EthRpc
,
opClient
.
NewBaseRPCClient
(
rpcClient
),
cfg
.
PollInterval
)
pollClient
,
err
:=
opClient
.
NewRPCWithClient
(
ctx
,
logger
,
cfg
.
L1EthRpc
,
opClient
.
NewBaseRPCClient
(
l1Client
.
Client
()
),
cfg
.
PollInterval
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to create RPC client: %w"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to create RPC client: %w"
,
err
)
}
}
...
...
op-service/client/dial.go
View file @
ea82c698
...
@@ -33,21 +33,6 @@ func DialEthClientWithTimeout(timeout time.Duration, log log.Logger, url string)
...
@@ -33,21 +33,6 @@ func DialEthClientWithTimeout(timeout time.Duration, log log.Logger, url string)
return
ethclient
.
NewClient
(
c
),
nil
return
ethclient
.
NewClient
(
c
),
nil
}
}
// DialRPCClientWithTimeout attempts to dial the L1 provider using the provided
// URL. If the dial doesn't complete within defaultDialTimeout seconds, this
// method will return an error.
func
DialRPCClientWithTimeout
(
timeout
time
.
Duration
,
log
log
.
Logger
,
url
string
)
(
*
rpc
.
Client
,
error
)
{
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
timeout
)
defer
cancel
()
c
,
err
:=
dialRPCClientWithBackoff
(
ctx
,
log
,
url
)
if
err
!=
nil
{
return
nil
,
err
}
return
c
,
nil
}
// DialRollupClientWithTimeout attempts to dial the RPC provider using the provided URL.
// DialRollupClientWithTimeout attempts to dial the RPC provider using the provided URL.
// If the dial doesn't complete within timeout seconds, this method will return an error.
// If the dial doesn't complete within timeout seconds, this method will return an error.
func
DialRollupClientWithTimeout
(
timeout
time
.
Duration
,
log
log
.
Logger
,
url
string
)
(
*
sources
.
RollupClient
,
error
)
{
func
DialRollupClientWithTimeout
(
timeout
time
.
Duration
,
log
log
.
Logger
,
url
string
)
(
*
sources
.
RollupClient
,
error
)
{
...
...
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