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
c7d53af8
Unverified
Commit
c7d53af8
authored
Sep 05, 2023
by
mergify[bot]
Committed by
GitHub
Sep 05, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into aj/deposit-create-contract
parents
524e7e2e
ab7496c8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
8 deletions
+86
-8
codecov.yml
codecov.yml
+1
-4
peers.go
op-e2e/e2eutils/geth/peers.go
+49
-0
l2_gossip_test.go
op-e2e/l2_gossip_test.go
+32
-0
setup.go
op-e2e/setup.go
+1
-1
tx_helper.go
op-e2e/tx_helper.go
+3
-3
No files found.
codecov.yml
View file @
c7d53af8
comment
:
layout
:
"
reach,
diff,
flags,
files"
behavior
:
default
require_changes
:
true
# only post the comment if coverage changes
comment
:
false
ignore
:
-
"
op-e2e"
-
"
**/*.t.sol"
...
...
op-e2e/e2eutils/geth/peers.go
0 → 100644
View file @
c7d53af8
package
geth
import
(
"context"
"testing"
"time"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/wait"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/eth/ethconfig"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/stretchr/testify/require"
)
// ConnectP2P creates a p2p peer connection between node1 and node2.
func
ConnectP2P
(
t
*
testing
.
T
,
node1
*
ethclient
.
Client
,
node2
*
ethclient
.
Client
)
{
var
targetInfo
p2p
.
NodeInfo
require
.
NoError
(
t
,
node2
.
Client
()
.
Call
(
&
targetInfo
,
"admin_nodeInfo"
),
"get node info"
)
var
peerAdded
bool
require
.
NoError
(
t
,
node1
.
Client
()
.
Call
(
&
peerAdded
,
"admin_addPeer"
,
targetInfo
.
Enode
),
"add peer"
)
require
.
True
(
t
,
peerAdded
,
"should have added peer successfully"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
30
*
time
.
Second
)
defer
cancel
()
err
:=
wait
.
For
(
ctx
,
time
.
Second
,
func
()
(
bool
,
error
)
{
var
peerCount
hexutil
.
Uint64
if
err
:=
node1
.
Client
()
.
Call
(
&
peerCount
,
"net_peerCount"
);
err
!=
nil
{
return
false
,
err
}
t
.
Logf
(
"Peer count %v"
,
uint64
(
peerCount
))
return
peerCount
>=
hexutil
.
Uint64
(
1
),
nil
})
require
.
NoError
(
t
,
err
,
"wait for a peer to be connected"
)
}
func
WithP2P
()
func
(
ethCfg
*
ethconfig
.
Config
,
nodeCfg
*
node
.
Config
)
error
{
return
func
(
ethCfg
*
ethconfig
.
Config
,
nodeCfg
*
node
.
Config
)
error
{
ethCfg
.
RollupDisableTxPoolGossip
=
false
nodeCfg
.
P2P
=
p2p
.
Config
{
NoDiscovery
:
true
,
ListenAddr
:
"127.0.0.1:0"
,
MaxPeers
:
10
,
}
return
nil
}
}
op-e2e/l2_gossip_test.go
0 → 100644
View file @
c7d53af8
package
op_e2e
import
(
"testing"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils/geth"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
)
func
TestTxGossip
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
cfg
:=
DefaultSystemConfig
(
t
)
gethOpts
:=
[]
GethOption
{
geth
.
WithP2P
(),
}
cfg
.
GethOptions
[
"sequencer"
]
=
gethOpts
cfg
.
GethOptions
[
"verifier"
]
=
gethOpts
sys
,
err
:=
cfg
.
Start
(
t
)
require
.
NoError
(
t
,
err
,
"Start system"
)
seqClient
:=
sys
.
Clients
[
"sequencer"
]
verifClient
:=
sys
.
Clients
[
"verifier"
]
geth
.
ConnectP2P
(
t
,
seqClient
,
verifClient
)
// Send a transaction to the verifier and it should be gossiped to the sequencer and included in a block.
SendL2Tx
(
t
,
cfg
,
verifClient
,
cfg
.
Secrets
.
Alice
,
func
(
opts
*
TxOpts
)
{
opts
.
ToAddr
=
&
common
.
Address
{
0xaa
}
opts
.
Value
=
common
.
Big1
opts
.
VerifyOnClients
(
seqClient
,
verifClient
)
})
}
op-e2e/setup.go
View file @
c7d53af8
...
...
@@ -457,7 +457,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste
ethClient
=
gethInst
}
else
{
if
len
(
cfg
.
GethOptions
[
name
])
>
0
{
t
.
Errorf
(
"External L2 nodes do not support configuration through GethOptions"
)
t
.
Skip
(
"External L2 nodes do not support configuration through GethOptions"
)
}
ethClient
=
(
&
ExternalRunner
{
Name
:
name
,
...
...
op-e2e/tx_helper.go
View file @
c7d53af8
...
...
@@ -93,16 +93,16 @@ func SendL2Tx(t *testing.T, cfg SystemConfig, l2Client *ethclient.Client, privKe
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
30
*
time
.
Second
)
defer
cancel
()
err
:=
l2Client
.
SendTransaction
(
ctx
,
tx
)
require
.
N
il
(
t
,
err
,
"Sending L2 tx"
)
require
.
N
oError
(
t
,
err
,
"Sending L2 tx"
)
receipt
,
err
:=
waitForTransaction
(
tx
.
Hash
(),
l2Client
,
10
*
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
)
*
time
.
Second
)
require
.
N
il
(
t
,
err
,
"Waiting for L2 tx"
)
require
.
N
oError
(
t
,
err
,
"Waiting for L2 tx"
)
require
.
Equal
(
t
,
opts
.
ExpectedStatus
,
receipt
.
Status
,
"TX should have expected status"
)
for
i
,
client
:=
range
opts
.
VerifyClients
{
t
.
Logf
(
"Waiting for tx %v on verification client %d"
,
tx
.
Hash
(),
i
)
receiptVerif
,
err
:=
waitForTransaction
(
tx
.
Hash
(),
client
,
10
*
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
)
*
time
.
Second
)
require
.
N
il
f
(
t
,
err
,
"Waiting for L2 tx on verification client %d"
,
i
)
require
.
N
oError
f
(
t
,
err
,
"Waiting for L2 tx on verification client %d"
,
i
)
require
.
Equalf
(
t
,
receipt
,
receiptVerif
,
"Receipts should be the same on sequencer and verification client %d"
,
i
)
}
return
receipt
...
...
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