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
02116fa5
Unverified
Commit
02116fa5
authored
Jun 23, 2023
by
Adrian Sutton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-e2e: Move TestStopStartSequencer test to adminrpc test file
parent
18f5efdb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
41 deletions
+42
-41
system_adminrpc_test.go
op-e2e/system_adminrpc_test.go
+42
-0
system_test.go
op-e2e/system_test.go
+0
-41
No files found.
op-e2e/system_adminrpc_test.go
View file @
02116fa5
...
@@ -3,6 +3,7 @@ package op_e2e
...
@@ -3,6 +3,7 @@ package op_e2e
import
(
import
(
"context"
"context"
"testing"
"testing"
"time"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/client"
"github.com/ethereum-optimism/optimism/op-node/node"
"github.com/ethereum-optimism/optimism/op-node/node"
...
@@ -14,6 +15,47 @@ import (
...
@@ -14,6 +15,47 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
)
)
func
TestStopStartSequencer
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
cfg
:=
DefaultSystemConfig
(
t
)
sys
,
err
:=
cfg
.
Start
()
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
defer
sys
.
Close
()
l2Seq
:=
sys
.
Clients
[
"sequencer"
]
rollupNode
:=
sys
.
RollupNodes
[
"sequencer"
]
nodeRPC
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
rollupNode
.
HTTPEndpoint
())
require
.
Nil
(
t
,
err
,
"Error dialing node"
)
blockBefore
:=
latestBlock
(
t
,
l2Seq
)
time
.
Sleep
(
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
+
1
)
*
time
.
Second
)
blockAfter
:=
latestBlock
(
t
,
l2Seq
)
require
.
Greaterf
(
t
,
blockAfter
,
blockBefore
,
"Chain did not advance"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Second
)
defer
cancel
()
blockHash
:=
common
.
Hash
{}
err
=
nodeRPC
.
CallContext
(
ctx
,
&
blockHash
,
"admin_stopSequencer"
)
require
.
Nil
(
t
,
err
,
"Error stopping sequencer"
)
blockBefore
=
latestBlock
(
t
,
l2Seq
)
time
.
Sleep
(
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
+
1
)
*
time
.
Second
)
blockAfter
=
latestBlock
(
t
,
l2Seq
)
require
.
Equal
(
t
,
blockAfter
,
blockBefore
,
"Chain advanced after stopping sequencer"
)
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Second
)
defer
cancel
()
err
=
nodeRPC
.
CallContext
(
ctx
,
nil
,
"admin_startSequencer"
,
blockHash
)
require
.
Nil
(
t
,
err
,
"Error starting sequencer"
)
blockBefore
=
latestBlock
(
t
,
l2Seq
)
time
.
Sleep
(
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
+
1
)
*
time
.
Second
)
blockAfter
=
latestBlock
(
t
,
l2Seq
)
require
.
Greater
(
t
,
blockAfter
,
blockBefore
,
"Chain did not advance after starting sequencer"
)
}
func
TestPersistSequencerStateWhenChanged
(
t
*
testing
.
T
)
{
func
TestPersistSequencerStateWhenChanged
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
InitParallel
(
t
)
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
...
...
op-e2e/system_test.go
View file @
02116fa5
...
@@ -1245,47 +1245,6 @@ func TestFees(t *testing.T) {
...
@@ -1245,47 +1245,6 @@ func TestFees(t *testing.T) {
require
.
Equal
(
t
,
balanceDiff
,
totalFee
,
"balances should add up"
)
require
.
Equal
(
t
,
balanceDiff
,
totalFee
,
"balances should add up"
)
}
}
func
TestStopStartSequencer
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
cfg
:=
DefaultSystemConfig
(
t
)
sys
,
err
:=
cfg
.
Start
()
require
.
Nil
(
t
,
err
,
"Error starting up system"
)
defer
sys
.
Close
()
l2Seq
:=
sys
.
Clients
[
"sequencer"
]
rollupNode
:=
sys
.
RollupNodes
[
"sequencer"
]
nodeRPC
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
rollupNode
.
HTTPEndpoint
())
require
.
Nil
(
t
,
err
,
"Error dialing node"
)
blockBefore
:=
latestBlock
(
t
,
l2Seq
)
time
.
Sleep
(
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
+
1
)
*
time
.
Second
)
blockAfter
:=
latestBlock
(
t
,
l2Seq
)
require
.
Greaterf
(
t
,
blockAfter
,
blockBefore
,
"Chain did not advance"
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Second
)
defer
cancel
()
blockHash
:=
common
.
Hash
{}
err
=
nodeRPC
.
CallContext
(
ctx
,
&
blockHash
,
"admin_stopSequencer"
)
require
.
Nil
(
t
,
err
,
"Error stopping sequencer"
)
blockBefore
=
latestBlock
(
t
,
l2Seq
)
time
.
Sleep
(
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
+
1
)
*
time
.
Second
)
blockAfter
=
latestBlock
(
t
,
l2Seq
)
require
.
Equal
(
t
,
blockAfter
,
blockBefore
,
"Chain advanced after stopping sequencer"
)
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Second
)
defer
cancel
()
err
=
nodeRPC
.
CallContext
(
ctx
,
nil
,
"admin_startSequencer"
,
blockHash
)
require
.
Nil
(
t
,
err
,
"Error starting sequencer"
)
blockBefore
=
latestBlock
(
t
,
l2Seq
)
time
.
Sleep
(
time
.
Duration
(
cfg
.
DeployConfig
.
L2BlockTime
+
1
)
*
time
.
Second
)
blockAfter
=
latestBlock
(
t
,
l2Seq
)
require
.
Greater
(
t
,
blockAfter
,
blockBefore
,
"Chain did not advance after starting sequencer"
)
}
func
TestStopStartBatcher
(
t
*
testing
.
T
)
{
func
TestStopStartBatcher
(
t
*
testing
.
T
)
{
InitParallel
(
t
)
InitParallel
(
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