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
9b2d40bd
Commit
9b2d40bd
authored
Nov 29, 2023
by
Tei Im
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add checks if there's no reorg during span batch derivation in e2e test
parent
823b6ed5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
span_batch_test.go
op-e2e/actions/span_batch_test.go
+23
-7
No files found.
op-e2e/actions/span_batch_test.go
View file @
9b2d40bd
...
@@ -438,25 +438,34 @@ func TestSpanBatchEmptyChain(gt *testing.T) {
...
@@ -438,25 +438,34 @@ func TestSpanBatchEmptyChain(gt *testing.T) {
verifier
.
ActL2PipelineFull
(
t
)
verifier
.
ActL2PipelineFull
(
t
)
miner
.
ActEmptyBlock
(
t
)
miner
.
ActEmptyBlock
(
t
)
sequencer
.
ActL1HeadSignal
(
t
)
// Make 1200 empty L2 blocks (L1BlockTime / L2BlockTime * 100)
// Make 1200 empty L2 blocks (L1BlockTime / L2BlockTime * 100)
for
i
:=
0
;
i
<
100
;
i
++
{
for
i
:=
0
;
i
<
100
;
i
++
{
sequencer
.
ActL1HeadSignal
(
t
)
sequencer
.
ActBuildToL1Head
(
t
)
sequencer
.
ActBuildToL1Head
(
t
)
if
i
%
10
==
9
{
if
i
%
10
==
9
{
// batch submit to L1
// batch submit to L1
batcher
.
ActSubmitAll
(
t
)
batcher
.
ActSubmitAll
(
t
)
// Since the unsafe head could be changed due to the reorg during derivation, save the current unsafe head.
unsafeHead
:=
sequencer
.
L2Unsafe
()
.
ID
()
// confirm batch on L1
// confirm batch on L1
miner
.
ActL1StartBlock
(
12
)(
t
)
miner
.
ActL1StartBlock
(
12
)(
t
)
miner
.
ActL1IncludeTx
(
dp
.
Addresses
.
Batcher
)(
t
)
miner
.
ActL1IncludeTx
(
dp
.
Addresses
.
Batcher
)(
t
)
miner
.
ActL1EndBlock
(
t
)
miner
.
ActL1EndBlock
(
t
)
sequencer
.
ActL1HeadSignal
(
t
)
sequencer
.
ActL2PipelineFull
(
t
)
// After derivation pipeline, the safe head must be same as latest unsafe head
// i.e. There must be no reorg during derivation pipeline.
require
.
Equal
(
t
,
sequencer
.
L2Safe
()
.
ID
(),
unsafeHead
)
}
else
{
}
else
{
miner
.
ActEmptyBlock
(
t
)
miner
.
ActEmptyBlock
(
t
)
sequencer
.
ActL1HeadSignal
(
t
)
}
}
}
}
sequencer
.
ActL1HeadSignal
(
t
)
sequencer
.
ActL2PipelineFull
(
t
)
verifier
.
ActL1HeadSignal
(
t
)
verifier
.
ActL1HeadSignal
(
t
)
verifier
.
ActL2PipelineFull
(
t
)
verifier
.
ActL2PipelineFull
(
t
)
...
@@ -515,9 +524,7 @@ func TestSpanBatchLowThroughputChain(gt *testing.T) {
...
@@ -515,9 +524,7 @@ func TestSpanBatchLowThroughputChain(gt *testing.T) {
totalTxCount
:=
0
totalTxCount
:=
0
// Make 600 L2 blocks (L1BlockTime / L2BlockTime * 50) including 1~3 txs
// Make 600 L2 blocks (L1BlockTime / L2BlockTime * 50) including 1~3 txs
for
i
:=
0
;
i
<
50
;
i
++
{
for
i
:=
0
;
i
<
50
;
i
++
{
sequencer
.
ActL1HeadSignal
(
t
)
for
sequencer
.
derivation
.
UnsafeL2Head
()
.
L1Origin
.
Number
<
sequencer
.
l1State
.
L1Head
()
.
Number
{
for
sequencer
.
derivation
.
UnsafeL2Head
()
.
L1Origin
.
Number
<
sequencer
.
l1State
.
L1Head
()
.
Number
{
sequencer
.
ActL2PipelineFull
(
t
)
sequencer
.
ActL2StartBlock
(
t
)
sequencer
.
ActL2StartBlock
(
t
)
// fill the block with random number of L2 txs
// fill the block with random number of L2 txs
for
j
:=
0
;
j
<
rand
.
Intn
(
3
);
j
++
{
for
j
:=
0
;
j
<
rand
.
Intn
(
3
);
j
++
{
...
@@ -552,16 +559,25 @@ func TestSpanBatchLowThroughputChain(gt *testing.T) {
...
@@ -552,16 +559,25 @@ func TestSpanBatchLowThroughputChain(gt *testing.T) {
// batch submit to L1
// batch submit to L1
batcher
.
ActSubmitAll
(
t
)
batcher
.
ActSubmitAll
(
t
)
// Since the unsafe head could be changed due to the reorg during derivation, save the current unsafe head.
unsafeHead
:=
sequencer
.
L2Unsafe
()
.
ID
()
// confirm batch on L1
// confirm batch on L1
miner
.
ActL1StartBlock
(
12
)(
t
)
miner
.
ActL1StartBlock
(
12
)(
t
)
miner
.
ActL1IncludeTx
(
dp
.
Addresses
.
Batcher
)(
t
)
miner
.
ActL1IncludeTx
(
dp
.
Addresses
.
Batcher
)(
t
)
miner
.
ActL1EndBlock
(
t
)
miner
.
ActL1EndBlock
(
t
)
sequencer
.
ActL1HeadSignal
(
t
)
sequencer
.
ActL2PipelineFull
(
t
)
// After derivation pipeline, the safe head must be same as latest unsafe head
// i.e. There must be no reorg during derivation pipeline.
require
.
Equal
(
t
,
sequencer
.
L2Safe
()
.
ID
(),
unsafeHead
)
}
else
{
}
else
{
miner
.
ActEmptyBlock
(
t
)
miner
.
ActEmptyBlock
(
t
)
sequencer
.
ActL1HeadSignal
(
t
)
}
}
}
}
sequencer
.
ActL1HeadSignal
(
t
)
sequencer
.
ActL2PipelineFull
(
t
)
verifier
.
ActL1HeadSignal
(
t
)
verifier
.
ActL1HeadSignal
(
t
)
verifier
.
ActL2PipelineFull
(
t
)
verifier
.
ActL2PipelineFull
(
t
)
...
...
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