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
c8f36940
Unverified
Commit
c8f36940
authored
Oct 19, 2022
by
mergify[bot]
Committed by
GitHub
Oct 19, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into jg/decompress_channel_size_limit
parents
26a84835
936b8ba5
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
217 additions
and
51 deletions
+217
-51
friendly-rats-scream.md
.changeset/friendly-rats-scream.md
+5
-0
config.yml
.circleci/config.yml
+3
-3
legacy_withdrawal.go
op-chain-ops/crossdomain/legacy_withdrawal.go
+4
-4
migrate.go
op-chain-ops/crossdomain/migrate.go
+116
-0
migrate_test.go
op-chain-ops/crossdomain/migrate_test.go
+41
-0
withdrawal.go
op-chain-ops/crossdomain/withdrawal.go
+6
-6
withdrawals.go
op-chain-ops/crossdomain/withdrawals.go
+8
-11
withdrawals_test.go
op-chain-ops/crossdomain/withdrawals_test.go
+2
-3
l2_engine_api.go
op-e2e/actions/l2_engine_api.go
+1
-1
conf_depth.go
op-node/rollup/driver/conf_depth.go
+4
-1
conf_depth_test.go
op-node/rollup/driver/conf_depth_test.go
+18
-13
OptimismPortal.sol
packages/contracts-bedrock/contracts/L1/OptimismPortal.sol
+8
-8
001-InitImplementations.deploy.ts
...ontracts-bedrock/deploy/001-InitImplementations.deploy.ts
+1
-1
No files found.
.changeset/friendly-rats-scream.md
0 → 100644
View file @
c8f36940
---
'
@eth-optimism/contracts-bedrock'
:
patch
---
Moves initializers underneath constructors always
.circleci/config.yml
View file @
c8f36940
...
@@ -188,7 +188,7 @@ jobs:
...
@@ -188,7 +188,7 @@ jobs:
working_directory
:
packages/contracts-bedrock
working_directory
:
packages/contracts-bedrock
-
run
:
-
run
:
name
:
upload coverage
name
:
upload coverage
command
:
codecov --verbose --clean --flag contracts-bedrock-tests
command
:
codecov --verbose --clean --flag
s
contracts-bedrock-tests
environment
:
environment
:
FOUNDRY_PROFILE
:
ci
FOUNDRY_PROFILE
:
ci
-
run
:
-
run
:
...
@@ -260,7 +260,7 @@ jobs:
...
@@ -260,7 +260,7 @@ jobs:
working_directory
:
packages/<<parameters.package_name>>
working_directory
:
packages/<<parameters.package_name>>
-
run
:
-
run
:
name
:
Upload coverage
name
:
Upload coverage
command
:
codecov --verbose --clean --flag <<parameters.coverage_flag>>
command
:
codecov --verbose --clean --flag
s
<<parameters.coverage_flag>>
bedrock-go-tests
:
bedrock-go-tests
:
docker
:
docker
:
...
@@ -351,7 +351,7 @@ jobs:
...
@@ -351,7 +351,7 @@ jobs:
working_directory
:
op-chain-ops
working_directory
:
op-chain-ops
-
run
:
-
run
:
name
:
upload coverage
name
:
upload coverage
command
:
codecov --verbose --clean --flag bedrock-go-tests
command
:
codecov --verbose --clean --flag
s
bedrock-go-tests
-
store_test_results
:
-
store_test_results
:
path
:
/test-results
path
:
/test-results
-
run
:
-
run
:
...
...
op-chain-ops/crossdomain/legacy_withdrawal.go
View file @
c8f36940
...
@@ -14,10 +14,10 @@ import (
...
@@ -14,10 +14,10 @@ import (
// LegacyWithdrawal represents a pre bedrock upgrade withdrawal.
// LegacyWithdrawal represents a pre bedrock upgrade withdrawal.
type
LegacyWithdrawal
struct
{
type
LegacyWithdrawal
struct
{
Target
*
common
.
Address
Target
*
common
.
Address
`json:"target"`
Sender
*
common
.
Address
Sender
*
common
.
Address
`json:"sender"`
Data
[]
byte
Data
[]
byte
`json:"data"`
Nonce
*
big
.
Int
Nonce
*
big
.
Int
`json:"nonce"`
}
}
var
_
WithdrawalMessage
=
(
*
LegacyWithdrawal
)(
nil
)
var
_
WithdrawalMessage
=
(
*
LegacyWithdrawal
)(
nil
)
...
...
op-chain-ops/crossdomain/migrate.go
0 → 100644
View file @
c8f36940
package
crossdomain
import
(
"errors"
"fmt"
"math/big"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
)
var
(
abiTrue
=
common
.
Hash
{
31
:
0x01
}
errLegacyStorageSlotNotFound
=
errors
.
New
(
"cannot find storage slot"
)
)
// MigrateWithdrawals will migrate a list of pending withdrawals given a StateDB.
func
MigrateWithdrawals
(
withdrawals
[]
*
PendingWithdrawal
,
db
vm
.
StateDB
,
l1CrossDomainMessenger
,
l1StandardBridge
*
common
.
Address
)
error
{
for
_
,
legacy
:=
range
withdrawals
{
legacySlot
,
err
:=
legacy
.
StorageSlot
()
if
err
!=
nil
{
return
err
}
legacyValue
:=
db
.
GetState
(
predeploys
.
LegacyMessagePasserAddr
,
legacySlot
)
if
legacyValue
!=
abiTrue
{
return
fmt
.
Errorf
(
"%w: %s"
,
errLegacyStorageSlotNotFound
,
legacyValue
)
}
withdrawal
,
err
:=
MigrateWithdrawal
(
&
legacy
.
LegacyWithdrawal
,
l1CrossDomainMessenger
,
l1StandardBridge
)
if
err
!=
nil
{
return
err
}
slot
,
err
:=
withdrawal
.
StorageSlot
()
if
err
!=
nil
{
return
err
}
db
.
SetState
(
predeploys
.
L2ToL1MessagePasserAddr
,
slot
,
abiTrue
)
}
return
nil
}
// MigrateWithdrawal will turn a LegacyWithdrawal into a bedrock
// style Withdrawal.
func
MigrateWithdrawal
(
withdrawal
*
LegacyWithdrawal
,
l1CrossDomainMessenger
,
l1StandardBridge
*
common
.
Address
)
(
*
Withdrawal
,
error
)
{
value
:=
new
(
big
.
Int
)
isFromL2StandardBridge
:=
*
withdrawal
.
Sender
==
predeploys
.
L2StandardBridgeAddr
if
withdrawal
.
Target
==
nil
{
return
nil
,
errors
.
New
(
"withdrawal target cannot be nil"
)
}
isToL1StandardBridge
:=
*
withdrawal
.
Target
==
*
l1StandardBridge
if
isFromL2StandardBridge
&&
isToL1StandardBridge
{
abi
,
err
:=
bindings
.
L1StandardBridgeMetaData
.
GetAbi
()
if
err
!=
nil
{
return
nil
,
err
}
method
,
err
:=
abi
.
MethodById
(
withdrawal
.
Data
)
if
err
!=
nil
{
return
nil
,
err
}
if
method
.
Name
==
"finalizeETHWithdrawal"
{
data
,
err
:=
method
.
Inputs
.
Unpack
(
withdrawal
.
Data
[
4
:
])
if
err
!=
nil
{
return
nil
,
err
}
// bounds check
if
len
(
data
)
<
3
{
return
nil
,
errors
.
New
(
"not enough data"
)
}
var
ok
bool
value
,
ok
=
data
[
2
]
.
(
*
big
.
Int
)
if
!
ok
{
return
nil
,
errors
.
New
(
"not big.Int"
)
}
}
}
abi
,
err
:=
bindings
.
L1CrossDomainMessengerMetaData
.
GetAbi
()
if
err
!=
nil
{
return
nil
,
err
}
versionedNonce
:=
EncodeVersionedNonce
(
withdrawal
.
Nonce
,
common
.
Big1
)
data
,
err
:=
abi
.
Pack
(
"relayMessage"
,
versionedNonce
,
withdrawal
.
Sender
,
withdrawal
.
Target
,
value
,
new
(
big
.
Int
),
withdrawal
.
Data
,
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"cannot abi encode relayMessage: %w"
,
err
)
}
w
:=
NewWithdrawal
(
withdrawal
.
Nonce
,
&
predeploys
.
L2CrossDomainMessengerAddr
,
l1CrossDomainMessenger
,
value
,
new
(
big
.
Int
),
data
,
)
return
w
,
nil
}
op-chain-ops/crossdomain/migrate_test.go
0 → 100644
View file @
c8f36940
package
crossdomain_test
import
(
"fmt"
"testing"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
"github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"
)
func
TestMigrateWithdrawal
(
t
*
testing
.
T
)
{
withdrawals
:=
make
([]
*
crossdomain
.
LegacyWithdrawal
,
0
)
for
_
,
receipt
:=
range
receipts
{
msg
,
err
:=
findCrossDomainMessage
(
receipt
)
require
.
Nil
(
t
,
err
)
withdrawal
,
err
:=
msg
.
ToWithdrawal
()
require
.
Nil
(
t
,
err
)
legacyWithdrawal
,
ok
:=
withdrawal
.
(
*
crossdomain
.
LegacyWithdrawal
)
require
.
True
(
t
,
ok
)
withdrawals
=
append
(
withdrawals
,
legacyWithdrawal
)
}
l1CrossDomainMessenger
:=
common
.
HexToAddress
(
"0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1"
)
l1StandardBridge
:=
common
.
HexToAddress
(
"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"
)
for
i
,
legacy
:=
range
withdrawals
{
t
.
Run
(
fmt
.
Sprintf
(
"test%d"
,
i
),
func
(
t
*
testing
.
T
)
{
withdrawal
,
err
:=
crossdomain
.
MigrateWithdrawal
(
legacy
,
&
l1CrossDomainMessenger
,
&
l1StandardBridge
)
require
.
Nil
(
t
,
err
)
require
.
NotNil
(
t
,
withdrawal
)
require
.
Equal
(
t
,
legacy
.
Nonce
.
Uint64
(),
withdrawal
.
Nonce
.
Uint64
())
require
.
Equal
(
t
,
*
withdrawal
.
Sender
,
predeploys
.
L2CrossDomainMessengerAddr
)
require
.
Equal
(
t
,
*
withdrawal
.
Target
,
l1CrossDomainMessenger
)
})
}
}
op-chain-ops/crossdomain/withdrawal.go
View file @
c8f36940
...
@@ -13,12 +13,12 @@ var _ WithdrawalMessage = (*Withdrawal)(nil)
...
@@ -13,12 +13,12 @@ var _ WithdrawalMessage = (*Withdrawal)(nil)
// Withdrawal represents a withdrawal transaction on L2
// Withdrawal represents a withdrawal transaction on L2
type
Withdrawal
struct
{
type
Withdrawal
struct
{
Nonce
*
big
.
Int
Nonce
*
big
.
Int
`json:"nonce"`
Sender
*
common
.
Address
Sender
*
common
.
Address
`json:"sender"`
Target
*
common
.
Address
Target
*
common
.
Address
`json:"target"`
Value
*
big
.
Int
Value
*
big
.
Int
`json:"value"`
GasLimit
*
big
.
Int
GasLimit
*
big
.
Int
`json:"gasLimit"`
Data
[]
byte
Data
[]
byte
`json:"data"`
}
}
// NewWithdrawal will create a Withdrawal
// NewWithdrawal will create a Withdrawal
...
...
op-chain-ops/crossdomain/withdrawals.go
View file @
c8f36940
...
@@ -15,12 +15,8 @@ import (
...
@@ -15,12 +15,8 @@ import (
// A PendingWithdrawal represents a withdrawal that has
// A PendingWithdrawal represents a withdrawal that has
// not been finalized on L1
// not been finalized on L1
type
PendingWithdrawal
struct
{
type
PendingWithdrawal
struct
{
Target
common
.
Address
`json:"target"`
LegacyWithdrawal
`json:"withdrawal"`
Sender
common
.
Address
`json:"sender"`
TransactionHash
common
.
Hash
`json:"transactionHash"`
Message
[]
byte
`json:"message"`
MessageNonce
*
big
.
Int
`json:"nonce"`
GasLimit
*
big
.
Int
`json:"gasLimit"`
TransactionHash
common
.
Hash
`json:"transactionHash"`
}
}
// Backends represents a set of backends for L1 and L2.
// Backends represents a set of backends for L1 and L2.
...
@@ -119,11 +115,12 @@ func GetPendingWithdrawals(messengers *Messengers, version *big.Int, start, end
...
@@ -119,11 +115,12 @@ func GetPendingWithdrawals(messengers *Messengers, version *big.Int, start, end
log
.
Info
(
"%s not yet relayed"
,
event
.
Raw
.
TxHash
)
log
.
Info
(
"%s not yet relayed"
,
event
.
Raw
.
TxHash
)
withdrawal
:=
PendingWithdrawal
{
withdrawal
:=
PendingWithdrawal
{
Target
:
event
.
Target
,
LegacyWithdrawal
:
LegacyWithdrawal
{
Sender
:
event
.
Sender
,
Target
:
&
event
.
Target
,
Message
:
event
.
Message
,
Sender
:
&
event
.
Sender
,
MessageNonce
:
event
.
MessageNonce
,
Data
:
event
.
Message
,
GasLimit
:
event
.
GasLimit
,
Nonce
:
event
.
MessageNonce
,
},
TransactionHash
:
event
.
Raw
.
TxHash
,
TransactionHash
:
event
.
Raw
.
TxHash
,
}
}
...
...
op-chain-ops/crossdomain/withdrawals_test.go
View file @
c8f36940
...
@@ -272,8 +272,7 @@ func TestGetPendingWithdrawals(t *testing.T) {
...
@@ -272,8 +272,7 @@ func TestGetPendingWithdrawals(t *testing.T) {
for
i
,
msg
:=
range
msgs
[
3
:
]
{
for
i
,
msg
:=
range
msgs
[
3
:
]
{
withdrawal
:=
withdrawals
[
i
]
withdrawal
:=
withdrawals
[
i
]
require
.
Equal
(
t
,
msg
.
Target
,
withdrawal
.
Target
)
require
.
Equal
(
t
,
msg
.
Target
,
*
withdrawal
.
Target
)
require
.
Equal
(
t
,
msg
.
Message
,
withdrawal
.
Message
)
require
.
Equal
(
t
,
msg
.
Message
,
withdrawal
.
Data
)
require
.
Equal
(
t
,
uint64
(
msg
.
MinGasLimit
),
withdrawal
.
GasLimit
.
Uint64
())
}
}
}
}
op-e2e/actions/l2_engine_api.go
View file @
c8f36940
...
@@ -96,7 +96,7 @@ func (ea *L2EngineAPI) startBlock(parent common.Hash, params *eth.PayloadAttribu
...
@@ -96,7 +96,7 @@ func (ea *L2EngineAPI) startBlock(parent common.Hash, params *eth.PayloadAttribu
if
err
:=
tx
.
UnmarshalBinary
(
otx
);
err
!=
nil
{
if
err
:=
tx
.
UnmarshalBinary
(
otx
);
err
!=
nil
{
return
fmt
.
Errorf
(
"transaction %d is not valid: %v"
,
i
,
err
)
return
fmt
.
Errorf
(
"transaction %d is not valid: %v"
,
i
,
err
)
}
}
ea
.
l2BuildingState
.
Prepare
(
tx
.
Hash
(),
i
)
receipt
,
err
:=
core
.
ApplyTransaction
(
ea
.
l2Cfg
.
Config
,
ea
.
l2Chain
,
&
ea
.
l2BuildingHeader
.
Coinbase
,
receipt
,
err
:=
core
.
ApplyTransaction
(
ea
.
l2Cfg
.
Config
,
ea
.
l2Chain
,
&
ea
.
l2BuildingHeader
.
Coinbase
,
ea
.
l2GasPool
,
ea
.
l2BuildingState
,
ea
.
l2BuildingHeader
,
&
tx
,
&
ea
.
l2BuildingHeader
.
GasUsed
,
*
ea
.
l2Chain
.
GetVMConfig
())
ea
.
l2GasPool
,
ea
.
l2BuildingState
,
ea
.
l2BuildingHeader
,
&
tx
,
&
ea
.
l2BuildingHeader
.
GasUsed
,
*
ea
.
l2Chain
.
GetVMConfig
())
if
err
!=
nil
{
if
err
!=
nil
{
...
...
op-node/rollup/driver/conf_depth.go
View file @
c8f36940
...
@@ -6,6 +6,7 @@ import (
...
@@ -6,6 +6,7 @@ import (
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
)
)
// confDepth is an util that wraps the L1 input fetcher used in the pipeline,
// confDepth is an util that wraps the L1 input fetcher used in the pipeline,
...
@@ -30,7 +31,9 @@ func (c *confDepth) L1BlockRefByNumber(ctx context.Context, num uint64) (eth.L1B
...
@@ -30,7 +31,9 @@ func (c *confDepth) L1BlockRefByNumber(ctx context.Context, num uint64) (eth.L1B
// TODO: performance optimization: buffer the l1Unsafe, invalidate any reorged previous buffer content,
// TODO: performance optimization: buffer the l1Unsafe, invalidate any reorged previous buffer content,
// and instantly return the origin by number from the buffer if we can.
// and instantly return the origin by number from the buffer if we can.
if
num
==
0
||
c
.
depth
==
0
||
num
+
c
.
depth
<=
c
.
l1Head
()
.
Number
{
// Don't apply the conf depth is l1Head is empty (as it is during the startup case before the l1State is initialized).
l1Head
:=
c
.
l1Head
()
if
num
==
0
||
c
.
depth
==
0
||
num
+
c
.
depth
<=
l1Head
.
Number
||
l1Head
.
Hash
==
(
common
.
Hash
{})
{
return
c
.
L1Fetcher
.
L1BlockRefByNumber
(
ctx
,
num
)
return
c
.
L1Fetcher
.
L1BlockRefByNumber
(
ctx
,
num
)
}
}
return
eth
.
L1BlockRef
{},
ethereum
.
NotFound
return
eth
.
L1BlockRef
{},
ethereum
.
NotFound
...
...
op-node/rollup/driver/conf_depth_test.go
View file @
c8f36940
...
@@ -9,11 +9,15 @@ import (
...
@@ -9,11 +9,15 @@ import (
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
)
)
var
exHash
=
common
.
Hash
{
0xff
}
type
confTest
struct
{
type
confTest
struct
{
name
string
name
string
head
uint64
head
uint64
hash
common
.
Hash
// hash of head block
req
uint64
req
uint64
depth
uint64
depth
uint64
pass
bool
pass
bool
...
@@ -21,7 +25,7 @@ type confTest struct {
...
@@ -21,7 +25,7 @@ type confTest struct {
func
(
ct
*
confTest
)
Run
(
t
*
testing
.
T
)
{
func
(
ct
*
confTest
)
Run
(
t
*
testing
.
T
)
{
l1Fetcher
:=
&
testutils
.
MockL1Source
{}
l1Fetcher
:=
&
testutils
.
MockL1Source
{}
l1Head
:=
eth
.
L1BlockRef
{
Number
:
ct
.
head
}
l1Head
:=
eth
.
L1BlockRef
{
Number
:
ct
.
head
,
Hash
:
ct
.
hash
}
l1HeadGetter
:=
func
()
eth
.
L1BlockRef
{
return
l1Head
}
l1HeadGetter
:=
func
()
eth
.
L1BlockRef
{
return
l1Head
}
cd
:=
NewConfDepth
(
ct
.
depth
,
l1HeadGetter
,
l1Fetcher
)
cd
:=
NewConfDepth
(
ct
.
depth
,
l1HeadGetter
,
l1Fetcher
)
...
@@ -43,18 +47,19 @@ func TestConfDepth(t *testing.T) {
...
@@ -43,18 +47,19 @@ func TestConfDepth(t *testing.T) {
// note: we're not testing overflows.
// note: we're not testing overflows.
// If a request is large enough to overflow the conf depth check, it's not returning anything anyway.
// If a request is large enough to overflow the conf depth check, it's not returning anything anyway.
testCases
:=
[]
confTest
{
testCases
:=
[]
confTest
{
{
name
:
"zero conf future"
,
head
:
4
,
req
:
5
,
depth
:
0
,
pass
:
true
},
{
name
:
"zero conf future"
,
head
:
4
,
hash
:
exHash
,
req
:
5
,
depth
:
0
,
pass
:
true
},
{
name
:
"zero conf present"
,
head
:
4
,
req
:
4
,
depth
:
0
,
pass
:
true
},
{
name
:
"zero conf present"
,
head
:
4
,
hash
:
exHash
,
req
:
4
,
depth
:
0
,
pass
:
true
},
{
name
:
"zero conf past"
,
head
:
4
,
req
:
4
,
depth
:
0
,
pass
:
true
},
{
name
:
"zero conf past"
,
head
:
4
,
hash
:
exHash
,
req
:
4
,
depth
:
0
,
pass
:
true
},
{
name
:
"one conf future"
,
head
:
4
,
req
:
5
,
depth
:
1
,
pass
:
false
},
{
name
:
"one conf future"
,
head
:
4
,
hash
:
exHash
,
req
:
5
,
depth
:
1
,
pass
:
false
},
{
name
:
"one conf present"
,
head
:
4
,
req
:
4
,
depth
:
1
,
pass
:
false
},
{
name
:
"one conf present"
,
head
:
4
,
hash
:
exHash
,
req
:
4
,
depth
:
1
,
pass
:
false
},
{
name
:
"one conf past"
,
head
:
4
,
req
:
3
,
depth
:
1
,
pass
:
true
},
{
name
:
"one conf past"
,
head
:
4
,
hash
:
exHash
,
req
:
3
,
depth
:
1
,
pass
:
true
},
{
name
:
"two conf future"
,
head
:
4
,
req
:
5
,
depth
:
2
,
pass
:
false
},
{
name
:
"two conf future"
,
head
:
4
,
hash
:
exHash
,
req
:
5
,
depth
:
2
,
pass
:
false
},
{
name
:
"two conf present"
,
head
:
4
,
req
:
4
,
depth
:
2
,
pass
:
false
},
{
name
:
"two conf present"
,
head
:
4
,
hash
:
exHash
,
req
:
4
,
depth
:
2
,
pass
:
false
},
{
name
:
"two conf not like 1"
,
head
:
4
,
req
:
3
,
depth
:
2
,
pass
:
false
},
{
name
:
"two conf not like 1"
,
head
:
4
,
hash
:
exHash
,
req
:
3
,
depth
:
2
,
pass
:
false
},
{
name
:
"two conf pass"
,
head
:
4
,
req
:
2
,
depth
:
2
,
pass
:
true
},
{
name
:
"two conf pass"
,
head
:
4
,
hash
:
exHash
,
req
:
2
,
depth
:
2
,
pass
:
true
},
{
name
:
"easy pass"
,
head
:
100
,
req
:
20
,
depth
:
5
,
pass
:
true
},
{
name
:
"easy pass"
,
head
:
100
,
hash
:
exHash
,
req
:
20
,
depth
:
5
,
pass
:
true
},
{
name
:
"genesis case"
,
head
:
0
,
req
:
0
,
depth
:
4
,
pass
:
true
},
{
name
:
"genesis case"
,
head
:
0
,
hash
:
exHash
,
req
:
0
,
depth
:
4
,
pass
:
true
},
{
name
:
"no L1 state"
,
req
:
10
,
depth
:
4
,
pass
:
true
},
}
}
for
_
,
tc
:=
range
testCases
{
for
_
,
tc
:=
range
testCases
{
t
.
Run
(
tc
.
name
,
tc
.
Run
)
t
.
Run
(
tc
.
name
,
tc
.
Run
)
...
...
packages/contracts-bedrock/contracts/L1/OptimismPortal.sol
View file @
c8f36940
...
@@ -99,6 +99,14 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
...
@@ -99,6 +99,14 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
initialize();
initialize();
}
}
/**
* @notice Initializer;
*/
function initialize() public initializer {
l2Sender = DEFAULT_L2_SENDER;
__ResourceMetering_init();
}
/**
/**
* @notice Accepts value so that users can send ETH directly to this contract and have the
* @notice Accepts value so that users can send ETH directly to this contract and have the
* funds be deposited to their address on L2. This is intended as a convenience
* funds be deposited to their address on L2. This is intended as a convenience
...
@@ -214,14 +222,6 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
...
@@ -214,14 +222,6 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
return _isOutputFinalized(proposal);
return _isOutputFinalized(proposal);
}
}
/**
* @notice Initializer;
*/
function initialize() public initializer {
l2Sender = DEFAULT_L2_SENDER;
__ResourceMetering_init();
}
/**
/**
* @notice Accepts deposits of ETH and data, and emits a TransactionDeposited event for use in
* @notice Accepts deposits of ETH and data, and emits a TransactionDeposited event for use in
* deriving deposit transactions. Note that if a deposit is made by a contract, its
* deriving deposit transactions. Note that if a deposit is made by a contract, its
...
...
packages/contracts-bedrock/deploy/001-InitImplementations.deploy.ts
View file @
c8f36940
...
@@ -7,7 +7,7 @@ import '@eth-optimism/hardhat-deploy-config'
...
@@ -7,7 +7,7 @@ import '@eth-optimism/hardhat-deploy-config'
const
upgradeABIs
=
{
const
upgradeABIs
=
{
L2OutputOracleProxy
:
async
(
deployConfig
)
=>
[
L2OutputOracleProxy
:
async
(
deployConfig
)
=>
[
'
initialize(bytes32,
uint256
,address)
'
,
'
initialize(bytes32,
address
,address)
'
,
[
[
deployConfig
.
l2OutputOracleGenesisL2Output
,
deployConfig
.
l2OutputOracleGenesisL2Output
,
deployConfig
.
l2OutputOracleProposer
,
deployConfig
.
l2OutputOracleProposer
,
...
...
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