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
2ebc5d8c
Commit
2ebc5d8c
authored
Sep 13, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactors
parent
ba9629c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
16 deletions
+7
-16
service.go
op-challenger/game/service.go
+6
-5
helper.go
op-e2e/e2eutils/challenger/helper.go
+1
-1
dial.go
op-service/client/dial.go
+0
-10
No files found.
op-challenger/game/service.go
View file @
2ebc5d8c
...
@@ -3,6 +3,7 @@ package game
...
@@ -3,6 +3,7 @@ package game
import
(
import
(
"context"
"context"
"fmt"
"fmt"
"regexp"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-challenger/config"
"github.com/ethereum-optimism/optimism/op-challenger/config"
...
@@ -10,6 +11,7 @@ import (
...
@@ -10,6 +11,7 @@ import (
"github.com/ethereum-optimism/optimism/op-challenger/game/scheduler"
"github.com/ethereum-optimism/optimism/op-challenger/game/scheduler"
"github.com/ethereum-optimism/optimism/op-challenger/metrics"
"github.com/ethereum-optimism/optimism/op-challenger/metrics"
"github.com/ethereum-optimism/optimism/op-challenger/version"
"github.com/ethereum-optimism/optimism/op-challenger/version"
opClient
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-service/client"
"github.com/ethereum-optimism/optimism/op-service/client"
"github.com/ethereum-optimism/optimism/op-service/clock"
"github.com/ethereum-optimism/optimism/op-service/clock"
oppprof
"github.com/ethereum-optimism/optimism/op-service/pprof"
oppprof
"github.com/ethereum-optimism/optimism/op-service/pprof"
...
@@ -76,12 +78,11 @@ func NewService(ctx context.Context, logger log.Logger, cfg *config.Config) (*Se
...
@@ -76,12 +78,11 @@ 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
)
})
})
polledClient
,
err
:=
client
.
DialPolledClientWithTimeout
(
ctx
,
client
.
DefaultDialTimeout
,
logger
,
cfg
.
L1EthRpc
,
cfg
.
PollInterval
)
var
rpcClient
opClient
.
RPC
=
opClient
.
NewBaseRPCClient
(
l1Client
.
Client
()
)
if
err
!=
nil
{
if
regexp
.
MustCompile
(
"^http(s)?://"
)
.
MatchString
(
cfg
.
L1EthRpc
)
{
r
eturn
nil
,
fmt
.
Errorf
(
"failed to dial L1: %w"
,
err
)
r
pcClient
=
opClient
.
NewPollingClient
(
ctx
,
logger
,
rpcClient
,
opClient
.
WithPollRate
(
cfg
.
PollInterval
)
)
}
}
monitor
:=
newGameMonitor
(
logger
,
cl
,
loader
,
sched
,
cfg
.
GameWindow
,
l1Client
.
BlockNumber
,
cfg
.
GameAllowlist
,
rpcClient
)
monitor
:=
newGameMonitor
(
logger
,
cl
,
loader
,
sched
,
cfg
.
GameWindow
,
l1Client
.
BlockNumber
,
cfg
.
GameAllowlist
,
polledClient
)
m
.
RecordInfo
(
version
.
SimpleWithMeta
)
m
.
RecordInfo
(
version
.
SimpleWithMeta
)
m
.
RecordUp
()
m
.
RecordUp
()
...
...
op-e2e/e2eutils/challenger/helper.go
View file @
2ebc5d8c
...
@@ -146,7 +146,7 @@ func NewChallengerConfig(t *testing.T, l1Endpoint string, options ...Option) *co
...
@@ -146,7 +146,7 @@ func NewChallengerConfig(t *testing.T, l1Endpoint string, options ...Option) *co
require
.
NoError
(
t
,
err
,
"cannon pre-state should be built. Make sure you've run make cannon-prestate"
)
require
.
NoError
(
t
,
err
,
"cannon pre-state should be built. Make sure you've run make cannon-prestate"
)
}
}
if
cfg
.
PollInterval
==
0
{
if
cfg
.
PollInterval
==
0
{
cfg
.
PollInterval
=
2
*
time
.
Second
cfg
.
PollInterval
=
time
.
Second
}
}
return
&
cfg
return
&
cfg
...
...
op-service/client/dial.go
View file @
2ebc5d8c
...
@@ -47,16 +47,6 @@ func DialRollupClientWithTimeout(timeout time.Duration, log log.Logger, url stri
...
@@ -47,16 +47,6 @@ func DialRollupClientWithTimeout(timeout time.Duration, log log.Logger, url stri
return
sources
.
NewRollupClient
(
client
.
NewBaseRPCClient
(
rpcCl
)),
nil
return
sources
.
NewRollupClient
(
client
.
NewBaseRPCClient
(
rpcCl
)),
nil
}
}
// DialPolledClientWithTimeout 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.
func
DialPolledClientWithTimeout
(
ctx
context
.
Context
,
timeout
time
.
Duration
,
log
log
.
Logger
,
url
string
,
pollInterval
time
.
Duration
)
(
client
.
RPC
,
error
)
{
opts
:=
[]
client
.
RPCOption
{
client
.
WithHttpPollInterval
(
pollInterval
),
client
.
WithDialBackoff
(
defaultRetryCount
),
}
return
client
.
NewRPC
(
ctx
,
log
,
url
,
opts
...
)
}
// Dials a JSON-RPC endpoint repeatedly, with a backoff, until a client connection is established. Auth is optional.
// Dials a JSON-RPC endpoint repeatedly, with a backoff, until a client connection is established. Auth is optional.
func
dialRPCClientWithBackoff
(
ctx
context
.
Context
,
log
log
.
Logger
,
addr
string
)
(
*
rpc
.
Client
,
error
)
{
func
dialRPCClientWithBackoff
(
ctx
context
.
Context
,
log
log
.
Logger
,
addr
string
)
(
*
rpc
.
Client
,
error
)
{
bOff
:=
retry
.
Fixed
(
defaultRetryTime
)
bOff
:=
retry
.
Fixed
(
defaultRetryTime
)
...
...
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