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
008a5921
Unverified
Commit
008a5921
authored
Oct 14, 2022
by
mergify[bot]
Committed by
GitHub
Oct 14, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into jg/doctx_in_dial
parents
69a19fa1
c930dcc2
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
421 additions
and
1 deletion
+421
-1
l1_miner.go
op-e2e/actions/l1_miner.go
+1
-0
l2_engine.go
op-e2e/actions/l2_engine.go
+1
-0
user.go
op-e2e/actions/user.go
+336
-0
user_test.go
op-e2e/actions/user_test.go
+82
-0
sequencer.go
op-node/rollup/driver/sequencer.go
+1
-1
No files found.
op-e2e/actions/l1_miner.go
View file @
008a5921
...
@@ -106,6 +106,7 @@ func (s *L1Miner) ActL1IncludeTx(from common.Address) Action {
...
@@ -106,6 +106,7 @@ func (s *L1Miner) ActL1IncludeTx(from common.Address) Action {
return
return
}
}
s
.
pendingIndices
[
from
]
=
i
+
1
// won't retry the tx
s
.
pendingIndices
[
from
]
=
i
+
1
// won't retry the tx
s
.
l1BuildingState
.
Prepare
(
tx
.
Hash
(),
len
(
s
.
l1Transactions
))
receipt
,
err
:=
core
.
ApplyTransaction
(
s
.
l1Cfg
.
Config
,
s
.
l1Chain
,
&
s
.
l1BuildingHeader
.
Coinbase
,
receipt
,
err
:=
core
.
ApplyTransaction
(
s
.
l1Cfg
.
Config
,
s
.
l1Chain
,
&
s
.
l1BuildingHeader
.
Coinbase
,
s
.
l1GasPool
,
s
.
l1BuildingState
,
s
.
l1BuildingHeader
,
tx
,
&
s
.
l1BuildingHeader
.
GasUsed
,
*
s
.
l1Chain
.
GetVMConfig
())
s
.
l1GasPool
,
s
.
l1BuildingState
,
s
.
l1BuildingHeader
,
tx
,
&
s
.
l1BuildingHeader
.
GasUsed
,
*
s
.
l1Chain
.
GetVMConfig
())
if
err
!=
nil
{
if
err
!=
nil
{
...
...
op-e2e/actions/l2_engine.go
View file @
008a5921
...
@@ -174,6 +174,7 @@ func (e *L2Engine) ActL2IncludeTx(from common.Address) Action {
...
@@ -174,6 +174,7 @@ func (e *L2Engine) ActL2IncludeTx(from common.Address) Action {
return
return
}
}
e
.
pendingIndices
[
from
]
=
i
+
1
// won't retry the tx
e
.
pendingIndices
[
from
]
=
i
+
1
// won't retry the tx
e
.
l2BuildingState
.
Prepare
(
tx
.
Hash
(),
len
(
e
.
l2Transactions
))
receipt
,
err
:=
core
.
ApplyTransaction
(
e
.
l2Cfg
.
Config
,
e
.
l2Chain
,
&
e
.
l2BuildingHeader
.
Coinbase
,
receipt
,
err
:=
core
.
ApplyTransaction
(
e
.
l2Cfg
.
Config
,
e
.
l2Chain
,
&
e
.
l2BuildingHeader
.
Coinbase
,
e
.
l2GasPool
,
e
.
l2BuildingState
,
e
.
l2BuildingHeader
,
tx
,
&
e
.
l2BuildingHeader
.
GasUsed
,
*
e
.
l2Chain
.
GetVMConfig
())
e
.
l2GasPool
,
e
.
l2BuildingState
,
e
.
l2BuildingHeader
,
tx
,
&
e
.
l2BuildingHeader
.
GasUsed
,
*
e
.
l2Chain
.
GetVMConfig
())
if
err
!=
nil
{
if
err
!=
nil
{
...
...
op-e2e/actions/user.go
0 → 100644
View file @
008a5921
This diff is collapsed.
Click to expand it.
op-e2e/actions/user_test.go
0 → 100644
View file @
008a5921
package
actions
import
(
"math/rand"
"testing"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum-optimism/optimism/op-node/withdrawals"
)
func
TestCrossLayerUser
(
gt
*
testing
.
T
)
{
t
:=
NewDefaultTesting
(
gt
)
dp
:=
e2eutils
.
MakeDeployParams
(
t
,
defaultRollupTestParams
)
sd
:=
e2eutils
.
Setup
(
t
,
dp
,
defaultAlloc
)
log
:=
testlog
.
Logger
(
t
,
log
.
LvlDebug
)
miner
,
seqEngine
,
seq
:=
setupSequencerTest
(
t
,
sd
,
log
)
// need to start derivation before we can make L2 blocks
seq
.
ActL2PipelineFull
(
t
)
l1Cl
:=
miner
.
EthClient
()
l2Cl
:=
seqEngine
.
EthClient
()
withdrawalsCl
:=
&
withdrawals
.
Client
{}
// TODO: need a rollup node actor to wrap for output root proof RPC
addresses
:=
e2eutils
.
CollectAddresses
(
sd
,
dp
)
l1UserEnv
:=
&
BasicUserEnv
[
*
L1Bindings
]{
EthCl
:
l1Cl
,
Signer
:
types
.
LatestSigner
(
sd
.
L1Cfg
.
Config
),
AddressCorpora
:
addresses
,
Bindings
:
NewL1Bindings
(
t
,
l1Cl
,
&
sd
.
DeploymentsL1
),
}
l2UserEnv
:=
&
BasicUserEnv
[
*
L2Bindings
]{
EthCl
:
l2Cl
,
Signer
:
types
.
LatestSigner
(
sd
.
L2Cfg
.
Config
),
AddressCorpora
:
addresses
,
Bindings
:
NewL2Bindings
(
t
,
l2Cl
,
withdrawalsCl
),
}
alice
:=
NewCrossLayerUser
(
log
,
dp
.
Secrets
.
Alice
,
rand
.
New
(
rand
.
NewSource
(
1234
)))
alice
.
L1
.
SetUserEnv
(
l1UserEnv
)
alice
.
L2
.
SetUserEnv
(
l2UserEnv
)
// regular L2 tx, in new L2 block
alice
.
L2
.
ActResetTxOpts
(
t
)
alice
.
L2
.
ActSetTxToAddr
(
&
dp
.
Addresses
.
Bob
)(
t
)
alice
.
L2
.
ActMakeTx
(
t
)
seq
.
ActL2StartBlock
(
t
)
seqEngine
.
ActL2IncludeTx
(
alice
.
Address
())(
t
)
seq
.
ActL2EndBlock
(
t
)
alice
.
L2
.
ActCheckReceiptStatusOfLastTx
(
true
)(
t
)
// regular L1 tx, in new L1 block
alice
.
L1
.
ActResetTxOpts
(
t
)
alice
.
L1
.
ActSetTxToAddr
(
&
dp
.
Addresses
.
Bob
)(
t
)
alice
.
L1
.
ActMakeTx
(
t
)
miner
.
ActL1StartBlock
(
12
)(
t
)
miner
.
ActL1IncludeTx
(
alice
.
Address
())(
t
)
miner
.
ActL1EndBlock
(
t
)
alice
.
L1
.
ActCheckReceiptStatusOfLastTx
(
true
)(
t
)
// regular Deposit, in new L1 block
alice
.
ActDeposit
(
t
)
miner
.
ActL1StartBlock
(
12
)(
t
)
miner
.
ActL1IncludeTx
(
alice
.
Address
())(
t
)
miner
.
ActL1EndBlock
(
t
)
seq
.
ActL1HeadSignal
(
t
)
// sync sequencer build enough blocks to adopt latest L1 origin
for
seq
.
SyncStatus
()
.
UnsafeL2
.
L1Origin
.
Number
<
miner
.
l1Chain
.
CurrentBlock
()
.
NumberU64
()
{
seq
.
ActL2StartBlock
(
t
)
seq
.
ActL2EndBlock
(
t
)
}
// Now that the L2 chain adopted the latest L1 block, check that we processed the deposit
alice
.
ActCheckDepositStatus
(
true
,
true
)(
t
)
}
op-node/rollup/driver/sequencer.go
View file @
008a5921
...
@@ -91,6 +91,7 @@ func (d *Sequencer) CompleteBuildingBlock(ctx context.Context) (*eth.ExecutionPa
...
@@ -91,6 +91,7 @@ func (d *Sequencer) CompleteBuildingBlock(ctx context.Context) (*eth.ExecutionPa
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to complete building on top of L2 chain %s, error (%d): %w"
,
d
.
buildingOnto
.
HeadBlockHash
,
errTyp
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to complete building on top of L2 chain %s, error (%d): %w"
,
d
.
buildingOnto
.
HeadBlockHash
,
errTyp
,
err
)
}
}
d
.
buildingID
=
eth
.
PayloadID
{}
return
payload
,
nil
return
payload
,
nil
}
}
...
@@ -103,7 +104,6 @@ func (d *Sequencer) CreateNewBlock(ctx context.Context, l2Head eth.L2BlockRef, l
...
@@ -103,7 +104,6 @@ func (d *Sequencer) CreateNewBlock(ctx context.Context, l2Head eth.L2BlockRef, l
if
err
!=
nil
{
if
err
!=
nil
{
return
l2Head
,
nil
,
err
return
l2Head
,
nil
,
err
}
}
d
.
buildingID
=
eth
.
PayloadID
{}
// Generate an L2 block ref from the payload.
// Generate an L2 block ref from the payload.
ref
,
err
:=
derive
.
PayloadToBlockRef
(
payload
,
&
d
.
config
.
Genesis
)
ref
,
err
:=
derive
.
PayloadToBlockRef
(
payload
,
&
d
.
config
.
Genesis
)
...
...
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