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
d5429669
Unverified
Commit
d5429669
authored
Oct 26, 2023
by
Adrian Sutton
Committed by
GitHub
Oct 26, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7880 from ethereum-optimism/aj/disable-cannon-http
op-e2e: Disable cannon tests when using HTTP instead of WS
parents
48c3d060
fdc2193e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
13 deletions
+24
-13
faultproof_test.go
op-e2e/faultproof_test.go
+7
-7
helper.go
op-e2e/helper.go
+10
-1
op_geth.go
op-e2e/op_geth.go
+1
-1
setup.go
op-e2e/setup.go
+6
-4
No files found.
op-e2e/faultproof_test.go
View file @
d5429669
...
...
@@ -18,7 +18,7 @@ import (
)
func
TestMultipleCannonGames
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
InitParallel
(
t
,
SkipIfHTTP
)
ctx
:=
context
.
Background
()
sys
,
l1Client
:=
startFaultDisputeSystem
(
t
)
...
...
@@ -78,7 +78,7 @@ func TestMultipleCannonGames(t *testing.T) {
}
func
TestMultipleGameTypes
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
InitParallel
(
t
,
SkipIfHTTP
)
ctx
:=
context
.
Background
()
sys
,
l1Client
:=
startFaultDisputeSystem
(
t
)
...
...
@@ -277,7 +277,7 @@ func TestChallengerCompleteExhaustiveDisputeGame(t *testing.T) {
}
func
TestCannonDisputeGame
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
InitParallel
(
t
,
SkipIfHTTP
)
tests
:=
[]
struct
{
name
string
...
...
@@ -328,7 +328,7 @@ func TestCannonDisputeGame(t *testing.T) {
}
func
TestCannonDefendStep
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
InitParallel
(
t
,
SkipIfHTTP
)
ctx
:=
context
.
Background
()
sys
,
l1Client
:=
startFaultDisputeSystem
(
t
)
...
...
@@ -370,7 +370,7 @@ func TestCannonDefendStep(t *testing.T) {
}
func
TestCannonProposedOutputRootInvalid
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
InitParallel
(
t
,
SkipIfHTTP
)
// honestStepsFail attempts to perform both an attack and defend step using the correct trace.
honestStepsFail
:=
func
(
ctx
context
.
Context
,
game
*
disputegame
.
CannonGameHelper
,
correctTrace
*
disputegame
.
HonestHelper
,
parentClaimIdx
int64
)
{
// Attack step should fail
...
...
@@ -448,7 +448,7 @@ func TestCannonProposedOutputRootInvalid(t *testing.T) {
}
func
TestCannonPoisonedPostState
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
InitParallel
(
t
,
SkipIfHTTP
)
ctx
:=
context
.
Background
()
sys
,
l1Client
:=
startFaultDisputeSystem
(
t
)
...
...
@@ -558,7 +558,7 @@ func setupDisputeGameForInvalidOutputRoot(t *testing.T, outputRoot common.Hash)
}
func
TestCannonChallengeWithCorrectRoot
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
InitParallel
(
t
,
SkipIfHTTP
)
ctx
:=
context
.
Background
()
sys
,
l1Client
:=
startFaultDisputeSystem
(
t
)
...
...
op-e2e/helper.go
View file @
d5429669
...
...
@@ -7,9 +7,18 @@ import (
var
enableParallelTesting
bool
=
os
.
Getenv
(
"OP_E2E_DISABLE_PARALLEL"
)
!=
"true"
func
InitParallel
(
t
*
testing
.
T
)
{
func
InitParallel
(
t
*
testing
.
T
,
opts
...
func
(
t
*
testing
.
T
)
)
{
t
.
Helper
()
if
enableParallelTesting
{
t
.
Parallel
()
}
for
_
,
opt
:=
range
opts
{
opt
(
t
)
}
}
func
SkipIfHTTP
(
t
*
testing
.
T
)
{
if
UseHTTP
()
{
t
.
Skip
(
"Skipping test because HTTP connection is in use"
)
}
}
op-e2e/op_geth.go
View file @
d5429669
...
...
@@ -102,7 +102,7 @@ func NewOpGeth(t *testing.T, ctx context.Context, cfg *SystemConfig) (*OpGeth, e
)
require
.
Nil
(
t
,
err
)
l2Client
,
err
:=
ethclient
.
Dial
(
node
.
HTTPEndpoint
(
))
l2Client
,
err
:=
ethclient
.
Dial
(
selectEndpoint
(
node
))
require
.
Nil
(
t
,
err
)
genesisPayload
,
err
:=
eth
.
BlockAsPayload
(
l2GenesisBlock
,
cfg
.
DeployConfig
.
CanyonTime
(
l2GenesisBlock
.
Time
()))
...
...
op-e2e/setup.go
View file @
d5429669
...
...
@@ -758,9 +758,12 @@ func (sys *System) newMockNetPeer() (host.Host, error) {
return
sys
.
Mocknet
.
AddPeerWithPeerstore
(
p
,
eps
)
}
func
UseHTTP
()
bool
{
return
os
.
Getenv
(
"OP_E2E_USE_HTTP"
)
==
"true"
}
func
selectEndpoint
(
node
EthInstance
)
string
{
useHTTP
:=
os
.
Getenv
(
"OP_E2E_USE_HTTP"
)
==
"true"
if
useHTTP
{
if
UseHTTP
()
{
log
.
Info
(
"using HTTP client"
)
return
node
.
HTTPEndpoint
()
}
...
...
@@ -785,9 +788,8 @@ type WSOrHTTPEndpoint interface {
}
func
configureL2
(
rollupNodeCfg
*
rollupNode
.
Config
,
l2Node
WSOrHTTPEndpoint
,
jwtSecret
[
32
]
byte
)
{
useHTTP
:=
os
.
Getenv
(
"OP_E2E_USE_HTTP"
)
==
"true"
l2EndpointConfig
:=
l2Node
.
WSAuthEndpoint
()
if
useHTTP
{
if
UseHTTP
()
{
l2EndpointConfig
=
l2Node
.
HTTPAuthEndpoint
()
}
...
...
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