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
50bffd00
Unverified
Commit
50bffd00
authored
Aug 03, 2023
by
mergify[bot]
Committed by
GitHub
Aug 03, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feat/deploy-script
parents
838e8968
d9207c6f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
18 deletions
+7
-18
bedrock_test.go
indexer/integration_tests/bedrock_test.go
+2
-1
system_tob_test.go
op-e2e/system_tob_test.go
+1
-1
withdrawal_helper.go
op-e2e/withdrawal_helper.go
+1
-1
utils.go
op-node/withdrawals/utils.go
+3
-15
No files found.
indexer/integration_tests/bedrock_test.go
View file @
50bffd00
...
...
@@ -22,6 +22,7 @@ import (
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
op_e2e
"github.com/ethereum-optimism/optimism/op-e2e"
"github.com/ethereum-optimism/optimism/op-e2e/config"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/withdrawals"
...
...
@@ -208,7 +209,7 @@ func TestBedrockIndexer(t *testing.T) {
require
.
Nil
(
t
,
wd
.
BedrockFinalizedTxHash
)
// Finalize withdrawal
err
=
withdrawals
.
WaitForFinalizationPeriod
(
e2eutils
.
TimeoutCtx
(
t
,
30
*
time
.
Second
),
l1Client
,
cfg
.
L1Deployments
.
OptimismPortalProxy
,
proveReceipt
.
BlockNumber
)
err
=
withdrawals
.
WaitForFinalizationPeriod
(
e2eutils
.
TimeoutCtx
(
t
,
30
*
time
.
Second
),
l1Client
,
proveReceipt
.
BlockNumber
,
config
.
L1Deployments
.
L2OutputOracleProxy
)
require
.
Nil
(
t
,
err
)
finReceipt
:=
op_e2e
.
FinalizeWithdrawal
(
t
,
cfg
,
l1Client
,
cfg
.
Secrets
.
Alice
,
wdReceipt
,
wdParams
)
...
...
op-e2e/system_tob_test.go
View file @
50bffd00
...
...
@@ -676,7 +676,7 @@ func TestMixedWithdrawalValidity(t *testing.T) {
// Wait for finalization and then create the Finalized Withdrawal Transaction
ctx
,
cancel
=
context
.
WithTimeout
(
context
.
Background
(),
45
*
time
.
Duration
(
cfg
.
DeployConfig
.
L1BlockTime
)
*
time
.
Second
)
defer
cancel
()
err
=
withdrawals
.
WaitForFinalizationPeriod
(
ctx
,
l1Client
,
cfg
.
L1Deployments
.
OptimismPortalProxy
,
header
.
Number
)
err
=
withdrawals
.
WaitForFinalizationPeriod
(
ctx
,
l1Client
,
header
.
Number
,
cfg
.
L1Deployments
.
L2OutputOracleProxy
)
require
.
Nil
(
t
,
err
)
// Finalize withdrawal
...
...
op-e2e/withdrawal_helper.go
View file @
50bffd00
...
...
@@ -145,7 +145,7 @@ func FinalizeWithdrawal(t *testing.T, cfg SystemConfig, l1Client *ethclient.Clie
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
30
*
time
.
Duration
(
cfg
.
DeployConfig
.
L1BlockTime
)
*
time
.
Second
)
defer
cancel
()
err
:=
withdrawals
.
WaitForFinalizationPeriod
(
ctx
,
l1Client
,
config
.
L1Deployments
.
OptimismPortalProxy
,
withdrawalProofReceipt
.
BlockNumber
)
err
:=
withdrawals
.
WaitForFinalizationPeriod
(
ctx
,
l1Client
,
withdrawalProofReceipt
.
BlockNumber
,
config
.
L1Deployments
.
L2OutputOracleProxy
)
require
.
Nil
(
t
,
err
)
opts
,
err
:=
bind
.
NewKeyedTransactorWithChainID
(
privKey
,
cfg
.
L1ChainIDBig
())
...
...
op-node/withdrawals/utils.go
View file @
50bffd00
...
...
@@ -36,7 +36,7 @@ func WaitForOutputRootPublished(ctx context.Context, client *ethclient.Client, l
}
getL2BlockFromLatestOutput
:=
func
()
(
*
big
.
Int
,
error
)
{
return
l2OO
.
LatestBlockNumber
(
opts
)
}
outputBlockNum
,
err
:=
utils
.
WaitAndGet
[
*
big
.
Int
]
(
ctx
,
time
.
Second
,
getL2BlockFromLatestOutput
,
func
(
latest
*
big
.
Int
)
bool
{
outputBlockNum
,
err
:=
utils
.
WaitAndGet
(
ctx
,
time
.
Second
,
getL2BlockFromLatestOutput
,
func
(
latest
*
big
.
Int
)
bool
{
return
latest
.
Cmp
(
l2BlockNumber
)
>=
0
})
if
err
!=
nil
{
...
...
@@ -48,12 +48,12 @@ func WaitForOutputRootPublished(ctx context.Context, client *ethclient.Client, l
// WaitForFinalizationPeriod waits until the L1 chain has progressed far enough that l1ProvingBlockNum has completed
// the finalization period.
// This functions polls and can block for a very long time if used on mainnet.
func
WaitForFinalizationPeriod
(
ctx
context
.
Context
,
client
*
ethclient
.
Client
,
portalAddr
common
.
Address
,
l1ProvingBlockNum
*
big
.
Int
)
error
{
func
WaitForFinalizationPeriod
(
ctx
context
.
Context
,
client
*
ethclient
.
Client
,
l1ProvingBlockNum
*
big
.
Int
,
l2OutputOracleAddr
common
.
Address
)
error
{
l1ProvingBlockNum
=
new
(
big
.
Int
)
.
Set
(
l1ProvingBlockNum
)
// Don't clobber caller owned l1ProvingBlockNum
opts
:=
&
bind
.
CallOpts
{
Context
:
ctx
}
// Load finalization period
l2OO
,
err
:=
createL2OOCaller
(
ctx
,
client
,
portalAddr
)
l2OO
,
err
:=
bindings
.
NewL2OutputOracleCaller
(
l2OutputOracleAddr
,
client
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"create L2OOCaller: %w"
,
err
)
}
...
...
@@ -81,18 +81,6 @@ func WaitForFinalizationPeriod(ctx context.Context, client *ethclient.Client, po
})
}
func
createL2OOCaller
(
ctx
context
.
Context
,
client
*
ethclient
.
Client
,
portalAddr
common
.
Address
)
(
*
bindings
.
L2OutputOracleCaller
,
error
)
{
portal
,
err
:=
bindings
.
NewOptimismPortalCaller
(
portalAddr
,
client
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"create OptimismPortalCaller: %w"
,
err
)
}
l2OOAddress
,
err
:=
portal
.
L2ORACLE
(
&
bind
.
CallOpts
{
Context
:
ctx
})
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"create L2ORACLE: %w"
,
err
)
}
return
bindings
.
NewL2OutputOracleCaller
(
l2OOAddress
,
client
)
}
type
ProofClient
interface
{
GetProof
(
context
.
Context
,
common
.
Address
,
[]
string
,
*
big
.
Int
)
(
*
gethclient
.
AccountResult
,
error
)
}
...
...
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