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
f2ffb97d
Unverified
Commit
f2ffb97d
authored
Jun 01, 2023
by
Michael de Hoog
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add E2E test
parent
97c359a3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
6 deletions
+53
-6
config.go
op-batcher/batcher/config.go
+1
-1
setup.go
op-e2e/setup.go
+9
-5
system_test.go
op-e2e/system_test.go
+43
-0
No files found.
op-batcher/batcher/config.go
View file @
f2ffb97d
...
@@ -79,7 +79,7 @@ type CLIConfig struct {
...
@@ -79,7 +79,7 @@ type CLIConfig struct {
PollInterval
time
.
Duration
PollInterval
time
.
Duration
// MaxPendingTransactions is the maximum number of concurrent pending
// MaxPendingTransactions is the maximum number of concurrent pending
// transactions sent to the transaction manager.
// transactions sent to the transaction manager
(0 == no limit)
.
MaxPendingTransactions
uint64
MaxPendingTransactions
uint64
// MaxL1TxSize is the maximum size of a batch tx submitted to L1.
// MaxL1TxSize is the maximum size of a batch tx submitted to L1.
...
...
op-e2e/setup.go
View file @
f2ffb97d
...
@@ -183,6 +183,7 @@ func DefaultSystemConfig(t *testing.T) SystemConfig {
...
@@ -183,6 +183,7 @@ func DefaultSystemConfig(t *testing.T) SystemConfig {
GethOptions
:
map
[
string
][]
GethOption
{},
GethOptions
:
map
[
string
][]
GethOption
{},
P2PTopology
:
nil
,
// no P2P connectivity by default
P2PTopology
:
nil
,
// no P2P connectivity by default
NonFinalizedProposals
:
false
,
NonFinalizedProposals
:
false
,
BatcherTargetL1TxSizeBytes
:
100
_000
,
}
}
}
}
...
@@ -229,6 +230,9 @@ type SystemConfig struct {
...
@@ -229,6 +230,9 @@ type SystemConfig struct {
// Explicitly disable batcher, for tests that rely on unsafe L2 payloads
// Explicitly disable batcher, for tests that rely on unsafe L2 payloads
DisableBatcher
bool
DisableBatcher
bool
// Target L1 tx size for the batcher transactions
BatcherTargetL1TxSizeBytes
uint64
}
}
type
System
struct
{
type
System
struct
{
...
@@ -611,11 +615,11 @@ func (cfg SystemConfig) Start(_opts ...SystemConfigOption) (*System, error) {
...
@@ -611,11 +615,11 @@ func (cfg SystemConfig) Start(_opts ...SystemConfigOption) (*System, error) {
L1EthRpc
:
sys
.
Nodes
[
"l1"
]
.
WSEndpoint
(),
L1EthRpc
:
sys
.
Nodes
[
"l1"
]
.
WSEndpoint
(),
L2EthRpc
:
sys
.
Nodes
[
"sequencer"
]
.
WSEndpoint
(),
L2EthRpc
:
sys
.
Nodes
[
"sequencer"
]
.
WSEndpoint
(),
RollupRpc
:
sys
.
RollupNodes
[
"sequencer"
]
.
HTTPEndpoint
(),
RollupRpc
:
sys
.
RollupNodes
[
"sequencer"
]
.
HTTPEndpoint
(),
MaxPendingTransactions
:
1
,
MaxPendingTransactions
:
0
,
MaxChannelDuration
:
1
,
MaxChannelDuration
:
1
,
MaxL1TxSize
:
120
_000
,
MaxL1TxSize
:
120
_000
,
CompressorConfig
:
compressor
.
CLIConfig
{
CompressorConfig
:
compressor
.
CLIConfig
{
TargetL1TxSizeBytes
:
100
_000
,
TargetL1TxSizeBytes
:
cfg
.
BatcherTargetL1TxSizeBytes
,
TargetNumFrames
:
1
,
TargetNumFrames
:
1
,
ApproxComprRatio
:
0.4
,
ApproxComprRatio
:
0.4
,
},
},
...
...
op-e2e/system_test.go
View file @
f2ffb97d
...
@@ -1370,6 +1370,49 @@ func TestStopStartBatcher(t *testing.T) {
...
@@ -1370,6 +1370,49 @@ func TestStopStartBatcher(t *testing.T) {
require
.
Greater
(
t
,
newSeqStatus
.
SafeL2
.
Number
,
seqStatus
.
SafeL2
.
Number
,
"Safe chain did not advance after batcher was restarted"
)
require
.
Greater
(
t
,
newSeqStatus
.
SafeL2
.
Number
,
seqStatus
.
SafeL2
.
Number
,
"Safe chain did not advance after batcher was restarted"
)
}
}
func
TestBatcherMultiTx
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
cfg
:=
DefaultSystemConfig
(
t
)
cfg
.
BatcherTargetL1TxSizeBytes
=
2
// ensures that batcher txs are as small as possible
cfg
.
DisableBatcher
=
true
sys
,
err
:=
cfg
.
Start
()
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
defer
sys
.
Close
()
l1Client
:=
sys
.
Clients
[
"l1"
]
l2Seq
:=
sys
.
Clients
[
"sequencer"
]
_
,
err
=
waitForBlock
(
big
.
NewInt
(
10
),
l2Seq
,
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
*
15
)
*
time
.
Second
)
require
.
Nil
(
t
,
err
,
"Waiting for L2 blocks"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Second
)
defer
cancel
()
l1Number
,
err
:=
l1Client
.
BlockNumber
(
ctx
)
require
.
Nil
(
t
,
err
)
// start batch submission
err
=
sys
.
BatchSubmitter
.
Start
()
require
.
Nil
(
t
,
err
)
// wait for 3 L1 blocks
_
,
err
=
waitForBlock
(
big
.
NewInt
(
int64
(
l1Number
)
+
3
),
l1Client
,
time
.
Duration
(
cfg
.
DeployConfig
.
L1BlockTime
*
5
)
*
time
.
Second
)
require
.
Nil
(
t
,
err
,
"Waiting for l1 blocks"
)
// count the number of transactions submitted to L1 in the last 3 blocks
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
10
*
time
.
Second
)
defer
cancel
()
totalTxCount
:=
0
for
i
:=
int64
(
0
);
i
<
3
;
i
++
{
block
,
err
:=
l1Client
.
BlockByNumber
(
ctx
,
big
.
NewInt
(
int64
(
l1Number
)
+
i
+
1
))
require
.
Nil
(
t
,
err
)
totalTxCount
+=
len
(
block
.
Transactions
())
}
// expect at least 10 batcher transactions, given 10 L2 blocks were generated above
require
.
GreaterOrEqual
(
t
,
totalTxCount
,
10
)
}
func
safeAddBig
(
a
*
big
.
Int
,
b
*
big
.
Int
)
*
big
.
Int
{
func
safeAddBig
(
a
*
big
.
Int
,
b
*
big
.
Int
)
*
big
.
Int
{
return
new
(
big
.
Int
)
.
Add
(
a
,
b
)
return
new
(
big
.
Int
)
.
Add
(
a
,
b
)
}
}
...
...
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