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
f5b55a13
Unverified
Commit
f5b55a13
authored
Nov 10, 2023
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-e2e: L1 dencun e2e test
parent
b2e31964
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
system_test.go
op-e2e/system_test.go
+21
-3
No files found.
op-e2e/system_test.go
View file @
f5b55a13
...
@@ -155,6 +155,22 @@ func TestL2OutputSubmitter(t *testing.T) {
...
@@ -155,6 +155,22 @@ func TestL2OutputSubmitter(t *testing.T) {
}
}
}
}
func
TestSystemE2EDencunAtGenesis
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
cfg
:=
DefaultSystemConfig
(
t
)
genesisActivation
:=
uint64
(
0
)
cfg
.
DeployConfig
.
L1CancunTimeOffset
=
&
genesisActivation
sys
,
err
:=
cfg
.
Start
(
t
)
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
defer
sys
.
Close
()
runE2ESystemTest
(
t
,
sys
)
head
,
err
:=
sys
.
Clients
[
"l1"
]
.
BlockByNumber
(
context
.
Background
(),
big
.
NewInt
(
0
))
require
.
NoError
(
t
,
err
)
require
.
NotNil
(
t
,
head
.
ExcessBlobGas
(),
"L1 is building dencun blocks since genesis"
)
}
// TestSystemE2E sets up a L1 Geth node, a rollup node, and a L2 geth node and then confirms that L1 deposits are reflected on L2.
// TestSystemE2E sets up a L1 Geth node, a rollup node, and a L2 geth node and then confirms that L1 deposits are reflected on L2.
// All nodes are run in process (but are the full nodes, not mocked or stubbed).
// All nodes are run in process (but are the full nodes, not mocked or stubbed).
func
TestSystemE2E
(
t
*
testing
.
T
)
{
func
TestSystemE2E
(
t
*
testing
.
T
)
{
...
@@ -165,7 +181,9 @@ func TestSystemE2E(t *testing.T) {
...
@@ -165,7 +181,9 @@ func TestSystemE2E(t *testing.T) {
sys
,
err
:=
cfg
.
Start
(
t
)
sys
,
err
:=
cfg
.
Start
(
t
)
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
defer
sys
.
Close
()
defer
sys
.
Close
()
}
func
runE2ESystemTest
(
t
*
testing
.
T
,
sys
*
System
)
{
log
:=
testlog
.
Logger
(
t
,
log
.
LvlInfo
)
log
:=
testlog
.
Logger
(
t
,
log
.
LvlInfo
)
log
.
Info
(
"genesis"
,
"l2"
,
sys
.
RollupConfig
.
Genesis
.
L2
,
"l1"
,
sys
.
RollupConfig
.
Genesis
.
L1
,
"l2_time"
,
sys
.
RollupConfig
.
Genesis
.
L2Time
)
log
.
Info
(
"genesis"
,
"l2"
,
sys
.
RollupConfig
.
Genesis
.
L2
,
"l1"
,
sys
.
RollupConfig
.
Genesis
.
L1
,
"l2_time"
,
sys
.
RollupConfig
.
Genesis
.
L2Time
)
...
@@ -185,11 +203,11 @@ func TestSystemE2E(t *testing.T) {
...
@@ -185,11 +203,11 @@ func TestSystemE2E(t *testing.T) {
require
.
Nil
(
t
,
err
)
require
.
Nil
(
t
,
err
)
// Send deposit transaction
// Send deposit transaction
opts
,
err
:=
bind
.
NewKeyedTransactorWithChainID
(
ethPrivKey
,
cfg
.
L1ChainIDBig
())
opts
,
err
:=
bind
.
NewKeyedTransactorWithChainID
(
ethPrivKey
,
sys
.
cfg
.
L1ChainIDBig
())
require
.
Nil
(
t
,
err
)
require
.
Nil
(
t
,
err
)
mintAmount
:=
big
.
NewInt
(
1
_000_000_000_000
)
mintAmount
:=
big
.
NewInt
(
1
_000_000_000_000
)
opts
.
Value
=
mintAmount
opts
.
Value
=
mintAmount
SendDepositTx
(
t
,
cfg
,
l1Client
,
l2Verif
,
opts
,
func
(
l2Opts
*
DepositTxOpts
)
{})
SendDepositTx
(
t
,
sys
.
cfg
,
l1Client
,
l2Verif
,
opts
,
func
(
l2Opts
*
DepositTxOpts
)
{})
// Confirm balance
// Confirm balance
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
15
*
time
.
Second
)
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
15
*
time
.
Second
)
...
@@ -202,7 +220,7 @@ func TestSystemE2E(t *testing.T) {
...
@@ -202,7 +220,7 @@ func TestSystemE2E(t *testing.T) {
require
.
Equal
(
t
,
mintAmount
,
diff
,
"Did not get expected balance change"
)
require
.
Equal
(
t
,
mintAmount
,
diff
,
"Did not get expected balance change"
)
// Submit TX to L2 sequencer node
// Submit TX to L2 sequencer node
receipt
:=
SendL2Tx
(
t
,
cfg
,
l2Seq
,
ethPrivKey
,
func
(
opts
*
TxOpts
)
{
receipt
:=
SendL2Tx
(
t
,
sys
.
cfg
,
l2Seq
,
ethPrivKey
,
func
(
opts
*
TxOpts
)
{
opts
.
Value
=
big
.
NewInt
(
1
_000_000_000
)
opts
.
Value
=
big
.
NewInt
(
1
_000_000_000
)
opts
.
Nonce
=
1
// Already have deposit
opts
.
Nonce
=
1
// Already have deposit
opts
.
ToAddr
=
&
common
.
Address
{
0xff
,
0xff
}
opts
.
ToAddr
=
&
common
.
Address
{
0xff
,
0xff
}
...
...
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