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
5946bd7e
Unverified
Commit
5946bd7e
authored
Dec 23, 2022
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-e2e: action-test extended time without batches in L1 blocks
parent
8fed3675
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
l2_batcher_test.go
op-e2e/actions/l2_batcher_test.go
+45
-0
No files found.
op-e2e/actions/l2_batcher_test.go
View file @
5946bd7e
...
@@ -194,3 +194,48 @@ func TestL2Finalization(gt *testing.T) {
...
@@ -194,3 +194,48 @@ func TestL2Finalization(gt *testing.T) {
require
.
Equal
(
t
,
uint64
(
3
),
sequencer
.
SyncStatus
()
.
FinalizedL1
.
Number
)
require
.
Equal
(
t
,
uint64
(
3
),
sequencer
.
SyncStatus
()
.
FinalizedL1
.
Number
)
require
.
Equal
(
t
,
heightToSubmit
,
sequencer
.
SyncStatus
()
.
FinalizedL2
.
Number
,
"unknown/bad finalized L1 blocks are ignored"
)
require
.
Equal
(
t
,
heightToSubmit
,
sequencer
.
SyncStatus
()
.
FinalizedL2
.
Number
,
"unknown/bad finalized L1 blocks are ignored"
)
}
}
func
TestExtendedTimeWithoutL1Batches
(
gt
*
testing
.
T
)
{
t
:=
NewDefaultTesting
(
gt
)
p
:=
&
e2eutils
.
TestParams
{
MaxSequencerDrift
:
20
,
// larger than L1 block time we simulate in this test (12)
SequencerWindowSize
:
24
,
ChannelTimeout
:
20
,
}
dp
:=
e2eutils
.
MakeDeployParams
(
t
,
p
)
sd
:=
e2eutils
.
Setup
(
t
,
dp
,
defaultAlloc
)
log
:=
testlog
.
Logger
(
t
,
log
.
LvlError
)
miner
,
engine
,
sequencer
:=
setupSequencerTest
(
t
,
sd
,
log
)
_
,
verifier
:=
setupVerifier
(
t
,
sd
,
log
,
miner
.
L1Client
(
t
,
sd
.
RollupCfg
))
batcher
:=
NewL2Batcher
(
log
,
sd
.
RollupCfg
,
&
BatcherCfg
{
MinL1TxSize
:
0
,
MaxL1TxSize
:
128
_000
,
BatcherKey
:
dp
.
Secrets
.
Batcher
,
},
sequencer
.
RollupClient
(),
miner
.
EthClient
(),
engine
.
EthClient
())
sequencer
.
ActL2PipelineFull
(
t
)
verifier
.
ActL2PipelineFull
(
t
)
// make a long L1 chain, up to just one block left for L2 blocks to be included.
for
i
:=
uint64
(
0
);
i
<
p
.
SequencerWindowSize
-
1
;
i
++
{
miner
.
ActEmptyBlock
(
t
)
}
// Now build a L2 chain that references all of these L1 blocks
sequencer
.
ActL1HeadSignal
(
t
)
sequencer
.
ActBuildToL1Head
(
t
)
// Now submit all the L2 blocks in the very last L1 block within sequencer window range
batcher
.
ActSubmitAll
(
t
)
miner
.
ActL1StartBlock
(
12
)(
t
)
miner
.
ActL1IncludeTx
(
dp
.
Addresses
.
Batcher
)(
t
)
miner
.
ActL1EndBlock
(
t
)
// Now sync the verifier, and see if the L2 chain of the sequencer is safe
verifier
.
ActL2PipelineFull
(
t
)
require
.
Equal
(
t
,
sequencer
.
L2Unsafe
(),
verifier
.
L2Safe
(),
"all L2 blocks should have been included just in time"
)
sequencer
.
ActL2PipelineFull
(
t
)
require
.
Equal
(
t
,
sequencer
.
L2Unsafe
(),
sequencer
.
L2Safe
(),
"same for sequencer"
)
}
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