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
3618dbb1
Unverified
Commit
3618dbb1
authored
Sep 29, 2023
by
Adrian Sutton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-e2e: Back to sending transaction via RPC.
Combine waiting and getting of transactions and improve error messages.
parent
18288915
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
17 deletions
+10
-17
l2_batcher_test.go
op-e2e/actions/l2_batcher_test.go
+1
-1
l2_engine.go
op-e2e/actions/l2_engine.go
+9
-16
No files found.
op-e2e/actions/l2_batcher_test.go
View file @
3618dbb1
...
@@ -464,7 +464,7 @@ func TestBigL2Txs(gt *testing.T) {
...
@@ -464,7 +464,7 @@ func TestBigL2Txs(gt *testing.T) {
Value
:
big
.
NewInt
(
0
),
Value
:
big
.
NewInt
(
0
),
Data
:
data
,
Data
:
data
,
})
})
engine
.
ActSendTx
(
t
,
tx
)
require
.
NoError
(
gt
,
cl
.
SendTransaction
(
t
.
Ctx
(),
tx
)
)
engine
.
ActL2IncludeTx
(
dp
.
Addresses
.
Alice
)(
t
)
engine
.
ActL2IncludeTx
(
dp
.
Addresses
.
Alice
)(
t
)
}
}
sequencer
.
ActL2EndBlock
(
t
)
sequencer
.
ActL2EndBlock
(
t
)
...
...
op-e2e/actions/l2_engine.go
View file @
3618dbb1
...
@@ -171,13 +171,6 @@ func (e *L2Engine) ActL2RPCFail(t Testing) {
...
@@ -171,13 +171,6 @@ func (e *L2Engine) ActL2RPCFail(t Testing) {
e
.
failL2RPC
=
errors
.
New
(
"mock L2 RPC error"
)
e
.
failL2RPC
=
errors
.
New
(
"mock L2 RPC error"
)
}
}
// ActSendTx adds a transaction to the tx pool and ensures any required promotion to the pending tx queue is complete
// before returning.
func
(
e
*
L2Engine
)
ActSendTx
(
t
Testing
,
tx
*
types
.
Transaction
)
{
err
:=
errors
.
Join
(
e
.
eth
.
TxPool
()
.
Add
([]
*
types
.
Transaction
{
tx
},
true
,
true
)
...
)
require
.
NoError
(
t
,
err
,
"Add tx to pool"
)
}
// ActL2IncludeTx includes the next transaction from the given address in the block that is being built
// ActL2IncludeTx includes the next transaction from the given address in the block that is being built
func
(
e
*
L2Engine
)
ActL2IncludeTx
(
from
common
.
Address
)
Action
{
func
(
e
*
L2Engine
)
ActL2IncludeTx
(
from
common
.
Address
)
Action
{
return
func
(
t
Testing
)
{
return
func
(
t
Testing
)
{
...
@@ -186,20 +179,20 @@ func (e *L2Engine) ActL2IncludeTx(from common.Address) Action {
...
@@ -186,20 +179,20 @@ func (e *L2Engine) ActL2IncludeTx(from common.Address) Action {
return
return
}
}
var
i
uint64
var
txs
[]
*
types
.
Transaction
var
q
[]
*
types
.
Transaction
// Wait for the tx to be in the pending tx queue
// Wait for the tx to be in the pending tx queue
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
1
0
*
time
.
Second
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
3
0
*
time
.
Second
)
defer
cancel
()
defer
cancel
()
err
:=
wait
.
For
(
ctx
,
2
*
time
.
Second
,
func
()
(
bool
,
error
)
{
err
:=
wait
.
For
(
ctx
,
time
.
Second
,
func
()
(
bool
,
error
)
{
i
:
=
e
.
engineApi
.
PendingIndices
(
from
)
i
=
e
.
engineApi
.
PendingIndices
(
from
)
txs
,
_
:
=
e
.
eth
.
TxPool
()
.
ContentFrom
(
from
)
txs
,
q
=
e
.
eth
.
TxPool
()
.
ContentFrom
(
from
)
return
uint64
(
len
(
txs
))
>
i
,
nil
return
uint64
(
len
(
txs
))
>
i
,
nil
})
})
require
.
NoError
(
t
,
err
,
"wait for tx to be in pending tx queue"
)
require
.
NoError
(
t
,
err
,
"no pending txs from %s, and have %d unprocessable queued txs from this account: %w"
,
from
,
len
(
q
),
err
)
i
:=
e
.
engineApi
.
PendingIndices
(
from
)
txs
,
q
:=
e
.
eth
.
TxPool
()
.
ContentFrom
(
from
)
require
.
Greaterf
(
t
,
uint64
(
len
(
txs
)),
i
,
"no pending txs from %s, and have %d unprocessable queued txs from this account"
,
from
,
len
(
q
))
tx
:=
txs
[
i
]
tx
:=
txs
[
i
]
err
=
e
.
engineApi
.
IncludeTx
(
tx
,
from
)
err
=
e
.
engineApi
.
IncludeTx
(
tx
,
from
)
if
errors
.
Is
(
err
,
engineapi
.
ErrNotBuildingBlock
)
{
if
errors
.
Is
(
err
,
engineapi
.
ErrNotBuildingBlock
)
{
...
...
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