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
338711c2
Unverified
Commit
338711c2
authored
Feb 15, 2023
by
mergify[bot]
Committed by
GitHub
Feb 15, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into jg/txmgr_cleanup_pt3
parents
551aaee4
88099c17
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
420 additions
and
86 deletions
+420
-86
go.mod
go.mod
+1
-1
go.sum
go.sum
+2
-2
go.mod
indexer/go.mod
+1
-1
go.sum
indexer/go.sum
+2
-2
l2outputoracle.go
op-bindings/bindings/l2outputoracle.go
+1
-1
config.go
op-chain-ops/genesis/config.go
+21
-3
test-deploy-config-devnet-l1.json
...in-ops/genesis/testdata/test-deploy-config-devnet-l1.json
+2
-0
immutables.go
op-chain-ops/immutables/immutables.go
+38
-0
immutables_test.go
op-chain-ops/immutables/immutables_test.go
+2
-0
setup.go
op-e2e/e2eutils/setup.go
+4
-0
setup.go
op-e2e/setup.go
+4
-0
block_info.go
op-node/eth/block_info.go
+5
-0
gossip.go
op-node/p2p/gossip.go
+17
-8
types.go
op-node/rollup/types.go
+43
-16
types_test.go
op-node/rollup/types_test.go
+122
-0
types.go
op-node/sources/types.go
+6
-0
l1info.go
op-node/testutils/l1info.go
+6
-0
go.mod
op-wheel/go.mod
+1
-1
go.sum
op-wheel/go.sum
+2
-2
update-op-geth.py
ops/scripts/update-op-geth.py
+1
-26
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+20
-19
L2OutputOracle.sol
packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol
+8
-2
Predeploys.sol
...ages/contracts-bedrock/contracts/libraries/Predeploys.sol
+5
-0
L2OutputOracle.t.sol
...ges/contracts-bedrock/contracts/test/L2OutputOracle.t.sol
+34
-0
getting-started.json
...ages/contracts-bedrock/deploy-config/getting-started.json
+47
-0
getting-started.ts
packages/contracts-bedrock/deploy-config/getting-started.ts
+4
-0
012-L2OutputOracleImpl.ts
packages/contracts-bedrock/deploy/012-L2OutputOracleImpl.ts
+13
-0
hardhat.config.ts
packages/contracts-bedrock/hardhat.config.ts
+6
-0
package.json
packages/contracts-bedrock/package.json
+1
-1
rollup-node-p2p.md
specs/rollup-node-p2p.md
+1
-1
No files found.
go.mod
View file @
338711c2
...
@@ -178,4 +178,4 @@ require (
...
@@ -178,4 +178,4 @@ require (
lukechampine.com/blake3 v1.1.7 // indirect
lukechampine.com/blake3 v1.1.7 // indirect
)
)
replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-202
21216190603-60b51d600468
replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-202
30214215134-401b7fd3309b
go.sum
View file @
338711c2
...
@@ -203,8 +203,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
...
@@ -203,8 +203,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/op-geth v0.0.0-202
21216190603-60b51d600468 h1:7KgjBYDji5AKi42eRYI+n8Gs+ZJVilSASL3WBu82c3M
=
github.com/ethereum-optimism/op-geth v0.0.0-202
30214215134-401b7fd3309b h1:qpsJ9tFppQOwO0rHrggOrSXW5XIx4G3DBEV6jrf9gU0
=
github.com/ethereum-optimism/op-geth v0.0.0-202
21216190603-60b51d600468
/go.mod h1:p0Yox74PhYlq1HvijrCBCD9A3cI7rXco7hT6KrQr+rY=
github.com/ethereum-optimism/op-geth v0.0.0-202
30214215134-401b7fd3309b
/go.mod h1:p0Yox74PhYlq1HvijrCBCD9A3cI7rXco7hT6KrQr+rY=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fjl/memsize v0.0.1 h1:+zhkb+dhUgx0/e+M8sF0QqiouvMQUiKR+QYvdxIOKcQ=
github.com/fjl/memsize v0.0.1 h1:+zhkb+dhUgx0/e+M8sF0QqiouvMQUiKR+QYvdxIOKcQ=
github.com/fjl/memsize v0.0.1/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fjl/memsize v0.0.1/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
...
...
indexer/go.mod
View file @
338711c2
...
@@ -2,7 +2,7 @@ module github.com/ethereum-optimism/optimism/indexer
...
@@ -2,7 +2,7 @@ module github.com/ethereum-optimism/optimism/indexer
go 1.17
go 1.17
replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-202
21216190603-60b51d600468
replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-202
30214215134-401b7fd3309b
require (
require (
github.com/ethereum-optimism/optimism/op-bindings v0.10.14
github.com/ethereum-optimism/optimism/op-bindings v0.10.14
...
...
indexer/go.sum
View file @
338711c2
...
@@ -266,8 +266,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
...
@@ -266,8 +266,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z8veEq5ZO3DfIhZ7xgRP9WTc=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/op-geth v0.0.0-202
21216190603-60b51d600468 h1:7KgjBYDji5AKi42eRYI+n8Gs+ZJVilSASL3WBu82c3M
=
github.com/ethereum-optimism/op-geth v0.0.0-202
30214215134-401b7fd3309b h1:qpsJ9tFppQOwO0rHrggOrSXW5XIx4G3DBEV6jrf9gU0
=
github.com/ethereum-optimism/op-geth v0.0.0-202
21216190603-60b51d600468
/go.mod h1:p0Yox74PhYlq1HvijrCBCD9A3cI7rXco7hT6KrQr+rY=
github.com/ethereum-optimism/op-geth v0.0.0-202
30214215134-401b7fd3309b
/go.mod h1:p0Yox74PhYlq1HvijrCBCD9A3cI7rXco7hT6KrQr+rY=
github.com/ethereum-optimism/optimism/op-batcher v0.10.14 h1:4C8hR2ut4kfzY9Lk7IZ8Utyw3P5rgiSabfech57nHP8=
github.com/ethereum-optimism/optimism/op-batcher v0.10.14 h1:4C8hR2ut4kfzY9Lk7IZ8Utyw3P5rgiSabfech57nHP8=
github.com/ethereum-optimism/optimism/op-batcher v0.10.14/go.mod h1:j+uvhHcyqifm+IjpIKMSrdGRVyjjdmtLnYazZGt+ti4=
github.com/ethereum-optimism/optimism/op-batcher v0.10.14/go.mod h1:j+uvhHcyqifm+IjpIKMSrdGRVyjjdmtLnYazZGt+ti4=
github.com/ethereum-optimism/optimism/op-bindings v0.10.1/go.mod h1:UeTZlpZyhOL3y9Sogzvbn8Z3q1tDmZEv1VmGxMiZYCg=
github.com/ethereum-optimism/optimism/op-bindings v0.10.1/go.mod h1:UeTZlpZyhOL3y9Sogzvbn8Z3q1tDmZEv1VmGxMiZYCg=
...
...
op-bindings/bindings/l2outputoracle.go
View file @
338711c2
...
@@ -38,7 +38,7 @@ type TypesOutputProposal struct {
...
@@ -38,7 +38,7 @@ type TypesOutputProposal struct {
// L2OutputOracleMetaData contains all meta data concerning the L2OutputOracle contract.
// L2OutputOracleMetaData contains all meta data concerning the L2OutputOracle contract.
var
L2OutputOracleMetaData
=
&
bind
.
MetaData
{
var
L2OutputOracleMetaData
=
&
bind
.
MetaData
{
ABI
:
"[{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_submissionInterval
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockTime
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingBlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingTimestamp
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_proposer
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_challenger
\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
constructor
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint8
\"
,
\"
name
\"
:
\"
version
\"
,
\"
type
\"
:
\"
uint8
\"
}],
\"
name
\"
:
\"
Initialized
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
l2OutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
l1Timestamp
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
OutputProposed
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
prevNextOutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
newNextOutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
OutputsDeleted
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
CHALLENGER
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
L2_BLOCK_TIME
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
PROPOSER
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
SUBMISSION_INTERVAL
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
computeL2Timestamp
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2OutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
deleteL2Outputs
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2OutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
getL2Output
\"
,
\"
outputs
\"
:[{
\"
components
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
timestamp
\"
,
\"
type
\"
:
\"
uint128
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
l2BlockNumber
\"
,
\"
type
\"
:
\"
uint128
\"
}],
\"
internalType
\"
:
\"
structTypes.OutputProposal
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
tuple
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
getL2OutputAfter
\"
,
\"
outputs
\"
:[{
\"
components
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
timestamp
\"
,
\"
type
\"
:
\"
uint128
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
l2BlockNumber
\"
,
\"
type
\"
:
\"
uint128
\"
}],
\"
internalType
\"
:
\"
structTypes.OutputProposal
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
tuple
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
getL2OutputIndexAfter
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingBlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingTimestamp
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
initialize
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
latestBlockNumber
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
latestOutputIndex
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
nextBlockNumber
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
nextOutputIndex
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
_outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
_l1BlockHash
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l1BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
proposeL2Output
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
payable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
startingBlockNumber
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
startingTimestamp
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
version
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
string
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
string
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
}]"
,
ABI
:
"[{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_submissionInterval
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockTime
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingBlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingTimestamp
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_proposer
\"
,
\"
type
\"
:
\"
address
\"
},{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"
_challenger
\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
constructor
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint8
\"
,
\"
name
\"
:
\"
version
\"
,
\"
type
\"
:
\"
uint8
\"
}],
\"
name
\"
:
\"
Initialized
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
l2OutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:false,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
l1Timestamp
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
OutputProposed
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
anonymous
\"
:false,
\"
inputs
\"
:[{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
prevNextOutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
indexed
\"
:true,
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
newNextOutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
OutputsDeleted
\"
,
\"
type
\"
:
\"
event
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
CHALLENGER
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
L2_BLOCK_TIME
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
PROPOSER
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
address
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
address
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
SUBMISSION_INTERVAL
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
computeL2Timestamp
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2OutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
deleteL2Outputs
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2OutputIndex
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
getL2Output
\"
,
\"
outputs
\"
:[{
\"
components
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
timestamp
\"
,
\"
type
\"
:
\"
uint128
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
l2BlockNumber
\"
,
\"
type
\"
:
\"
uint128
\"
}],
\"
internalType
\"
:
\"
structTypes.OutputProposal
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
tuple
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
getL2OutputAfter
\"
,
\"
outputs
\"
:[{
\"
components
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
timestamp
\"
,
\"
type
\"
:
\"
uint128
\"
},{
\"
internalType
\"
:
\"
uint128
\"
,
\"
name
\"
:
\"
l2BlockNumber
\"
,
\"
type
\"
:
\"
uint128
\"
}],
\"
internalType
\"
:
\"
structTypes.OutputProposal
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
tuple
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
getL2OutputIndexAfter
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingBlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_startingTimestamp
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
initialize
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
nonpayable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
latestBlockNumber
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
latestOutputIndex
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
nextBlockNumber
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
nextOutputIndex
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
_outputRoot
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l2BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
},{
\"
internalType
\"
:
\"
bytes32
\"
,
\"
name
\"
:
\"
_l1BlockHash
\"
,
\"
type
\"
:
\"
bytes32
\"
},{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"
_l1BlockNumber
\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
name
\"
:
\"
proposeL2Output
\"
,
\"
outputs
\"
:[],
\"
stateMutability
\"
:
\"
payable
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
startingBlockNumber
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
startingTimestamp
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
uint256
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
uint256
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
},{
\"
inputs
\"
:[],
\"
name
\"
:
\"
version
\"
,
\"
outputs
\"
:[{
\"
internalType
\"
:
\"
string
\"
,
\"
name
\"
:
\"\"
,
\"
type
\"
:
\"
string
\"
}],
\"
stateMutability
\"
:
\"
view
\"
,
\"
type
\"
:
\"
function
\"
}]"
,
Bin
:
"0x6101606040523480156200001257600080fd5b5060405162001
88b3803806200188b833981016040819052620000359162000262565b6001608052600060a081905260c05260e08690526101008590526001600160a01b03808316610140528116610120526200007084846200007c565b505050505050620002bf565b600054610100900460ff16158080156200009d5750600054600160ff909116105b80620000cd5750620000ba306200023660201b620011031760201c565b158015620000cd575060005460ff166001145b620001365760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff1916600117905580156200015a576000805461ff0019166101001790555b42821115620001e05760405162461bcd60e51b8152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201526374696d6560e01b608482015260a4016200012d565b60028290556001839055801562000231576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001600160a01b03163b151590565b80516001600160a01b03811681146200025d57600080fd5b919050565b60008060008060008060c087890312156200027c57600080fd5b86519550602087015194506040870151935060608701519250620002a36080880162000245565b9150620002b360a0880162000245565b90509295509295509295565b60805160a05160c05160e05161010051610120516101405161155562000336
60003960008181610351015261090001526000818161021b015261074101526000818161013f0152610e3701526000818161019b0152610e85015260006104b40152600061048b0152600061046201526115556000f3fe6080604052600436106101285760003560e01c806388786272116100a5578063bffa7f0f11610074578063d1de856c11610059578063d1de856c14610393578063dcec3348146103b3578063e4a30116146103c857600080fd5b8063bffa7f0f1461033f578063cf8e5cf01461037357600080fd5b8063887862721461029857806389c44cbb146102ae5780639aaab648146102d0578063a25ae557146102e357600080fd5b806369f16eec116100fc5780636b4d98dd116100e15780636b4d98dd1461020957806370872aa5146102625780637f0064201461027857600080fd5b806369f16eec146101df5780636abcf563146101f457600080fd5b80622134cc1461012d5780634599c78814610174578063529933df1461018957806354fd4d50146101bd575b600080fd5b34801561013957600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561018057600080fd5b506101616103e8565b34801561019557600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b3480156101c957600080fd5b506101d261045b565b60405161016b919061128c565b3480156101eb57600080fd5b506101616104fe565b34801561020057600080fd5b50600354610161565b34801561021557600080fd5b5061023d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016b565b34801561026e57600080fd5b5061016160015481565b34801561028457600080fd5b506101616102933660046112dd565b610510565b3480156102a457600080fd5b5061016160025481565b3480156102ba57600080fd5b506102ce6102c93660046112dd565b610729565b005b6102ce6102de3660046112f6565b6108e8565b3480156102ef57600080fd5b506103036102fe3660046112dd565b610d67565b60408051825181526020808401516fffffffffffffffffffffffffffffffff90811691830191909152928201519092169082015260600161016b565b34801561034b57600080fd5b5061023d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561037f57600080fd5b5061030361038e3660046112dd565b610dfb565b34801561039f57600080fd5b506101616103ae3660046112dd565b610e33565b3480156103bf57600080fd5b50610161610e81565b3480156103d457600080fd5b506102ce6103e3366004611328565b610eb6565b60035460009015610452576003805461040390600190611379565b8154811061041357610413611390565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16919050565b6001545b905090565b60606104867f000000000000000000000000000000000000000000000000000000000000000061111f565b6104af7f000000000000000000000000000000000000000000000000000000000000000061111f565b6104d87f000000000000000000000000000000000000000000000000000000000000000061111f565b6040516020016104ea939291906113bf565b604051602081830303815290604052905090565b60035460009061045690600190611379565b600061051a6103e8565b8211156105d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f7420666f72206120626c6f636b207468617420686173206e6f74206265656e2060648201527f70726f706f736564000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b600354610689576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f74206173206e6f206f7574707574732068617665206265656e2070726f706f7360648201527f6564207965740000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6003546000905b8082101561072257600060026106a68385611435565b6106b0919061147c565b905084600382815481106106c6576106c6611390565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16101561071857610711816001611435565b925061071c565b8091505b50610690565b5092915050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146107ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4c324f75747075744f7261636c653a206f6e6c7920746865206368616c6c656e60448201527f67657220616464726573732063616e2064656c657465206f757470757473000060648201526084016105cb565b60035481106108a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f4c324f75747075744f7261636c653a2063616e6e6f742064656c657465206f7560448201527f747075747320616674657220746865206c6174657374206f757470757420696e60648201527f6465780000000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b60006108b060035490565b90508160035581817f4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b660405160405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146109d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f4c324f75747075744f7261636c653a206f6e6c79207468652070726f706f736560448201527f7220616464726573732063616e2070726f706f7365206e6577206f757470757460648201527f7300000000000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6109db610e81565b8314610a8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a20626c6f636b206e756d626572206d757360448201527f7420626520657175616c20746f206e65787420657870656374656420626c6f6360648201527f6b206e756d626572000000000000000000000000000000000000000000000000608482015260a4016105cb565b42610a9984610e33565b10610b26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c324f75747075744f7261636c653a2063616e6e6f742070726f706f7365204c60448201527f32206f757470757420696e20746865206675747572650000000000000000000060648201526084016105cb565b83610bb3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4c324f75747075744f7261636c653a204c32206f75747075742070726f706f7360448201527f616c2063616e6e6f7420626520746865207a65726f206861736800000000000060648201526084016105cb565b8115610c6f5781814014610c6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604960248201527f4c324f75747075744f7261636c653a20626c6f636b206861736820646f65732060448201527f6e6f74206d61746368207468652068617368206174207468652065787065637460648201527f6564206865696768740000000000000000000000000000000000000000000000608482015260a4016105cb565b82610c7960035490565b857fa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e242604051610cab91815260200190565b60405180910390a45050604080516060810182529283526fffffffffffffffffffffffffffffffff4281166020850190815292811691840191825260038054600181018255600091909152935160029094027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b810194909455915190518216700100000000000000000000000000000000029116177fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c90910155565b604080516060810182526000808252602082018190529181019190915260038281548110610d9757610d97611390565b600091825260209182902060408051606081018252600290930290910180548352600101546fffffffffffffffffffffffffffffffff8082169484019490945270010000000000000000000000000000000090049092169181019190915292915050565b60408051606081018252600080825260208201819052918101919091526003610e2383610510565b81548110610d9757610d97611390565b60007f000000000000000000000000000000000000000000000000000000000000000060015483610e649190611379565b610e6e9190611490565b600254610e7b9190611435565b92915050565b60007f0000000000000000000000000000000000000000000000000000000000000000610eac6103e8565b6104569190611435565b600054610100900460ff1615808015610ed65750600054600160ff909116105b80610ef05750303b158015610ef0575060005460ff166001145b610f7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016105cb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610fda57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b42821115611091576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201527f74696d6500000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6002829055600183905580156110fe57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b60608160000361116257505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561118c5780611176816114cd565b91506111859050600a8361147c565b9150611166565b60008167ffffffffffffffff8111156111a7576111a7611505565b6040519080825280601f01601f1916602001820160405280156111d1576020820181803683370190505b5090505b8415611254576111e6600183611379565b91506111f3600a86611534565b6111fe906030611435565b60f81b81838151811061121357611213611390565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061124d600a8661147c565b94506111d5565b949350505050565b60005b8381101561127757818101518382015260200161125f565b83811115611286576000848401525b50505050565b60208152600082518060208401526112ab81604085016020870161125c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156112ef57600080fd5b5035919050565b6000806000806080858703121561130c57600080fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561133b57600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561138b5761138b61134a565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600084516113d181846020890161125c565b80830190507f2e00000000000000000000000000000000000000000000000000000000000000808252855161140d816001850160208a0161125c565b6001920191820152835161142881600284016020880161125c565b0160020195945050505050565b600082198211156114485761144861134a565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261148b5761148b61144d565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156114c8576114c861134a565b500290565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036114fe576114fe61134a565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000826115435761154361144d565b50069056fea164736f6c634300080f000a"
,
Bin
:
"0x6101606040523480156200001257600080fd5b5060405162001
9863803806200198683398101604081905262000035916200035d565b6001608081905260a052600060c05284620000bd5760405162461bcd60e51b815260206004820152603460248201527f4c324f75747075744f7261636c653a204c3220626c6f636b2074696d65206d7560448201527f73742062652067726561746572207468616e203000000000000000000000000060648201526084015b60405180910390fd5b848611620001435760405162461bcd60e51b815260206004820152604660248201527f4c324f75747075744f7261636c653a207375626d697373696f6e20696e74657260448201527f76616c206d7573742062652067726561746572207468616e204c3220626c6f636064820152656b2074696d6560d01b608482015260a401620000b4565b60e08690526101008590526001600160a01b03808316610140528116610120526200016f84846200017b565b505050505050620003ba565b600054610100900460ff16158080156200019c5750600054600160ff909116105b80620001cc5750620001b9306200033160201b620011031760201c565b158015620001cc575060005460ff166001145b620002315760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401620000b4565b6000805460ff19166001179055801562000255576000805461ff0019166101001790555b42821115620002db5760405162461bcd60e51b8152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201526374696d6560e01b608482015260a401620000b4565b6002829055600183905580156200032c576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6001600160a01b03163b151590565b80516001600160a01b03811681146200035857600080fd5b919050565b60008060008060008060c087890312156200037757600080fd5b865195506020870151945060408701519350606087015192506200039e6080880162000340565b9150620003ae60a0880162000340565b90509295509295509295565b60805160a05160c05160e05161010051610120516101405161155562000431
60003960008181610351015261090001526000818161021b015261074101526000818161013f0152610e3701526000818161019b0152610e85015260006104b40152600061048b0152600061046201526115556000f3fe6080604052600436106101285760003560e01c806388786272116100a5578063bffa7f0f11610074578063d1de856c11610059578063d1de856c14610393578063dcec3348146103b3578063e4a30116146103c857600080fd5b8063bffa7f0f1461033f578063cf8e5cf01461037357600080fd5b8063887862721461029857806389c44cbb146102ae5780639aaab648146102d0578063a25ae557146102e357600080fd5b806369f16eec116100fc5780636b4d98dd116100e15780636b4d98dd1461020957806370872aa5146102625780637f0064201461027857600080fd5b806369f16eec146101df5780636abcf563146101f457600080fd5b80622134cc1461012d5780634599c78814610174578063529933df1461018957806354fd4d50146101bd575b600080fd5b34801561013957600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b34801561018057600080fd5b506101616103e8565b34801561019557600080fd5b506101617f000000000000000000000000000000000000000000000000000000000000000081565b3480156101c957600080fd5b506101d261045b565b60405161016b919061128c565b3480156101eb57600080fd5b506101616104fe565b34801561020057600080fd5b50600354610161565b34801561021557600080fd5b5061023d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161016b565b34801561026e57600080fd5b5061016160015481565b34801561028457600080fd5b506101616102933660046112dd565b610510565b3480156102a457600080fd5b5061016160025481565b3480156102ba57600080fd5b506102ce6102c93660046112dd565b610729565b005b6102ce6102de3660046112f6565b6108e8565b3480156102ef57600080fd5b506103036102fe3660046112dd565b610d67565b60408051825181526020808401516fffffffffffffffffffffffffffffffff90811691830191909152928201519092169082015260600161016b565b34801561034b57600080fd5b5061023d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561037f57600080fd5b5061030361038e3660046112dd565b610dfb565b34801561039f57600080fd5b506101616103ae3660046112dd565b610e33565b3480156103bf57600080fd5b50610161610e81565b3480156103d457600080fd5b506102ce6103e3366004611328565b610eb6565b60035460009015610452576003805461040390600190611379565b8154811061041357610413611390565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16919050565b6001545b905090565b60606104867f000000000000000000000000000000000000000000000000000000000000000061111f565b6104af7f000000000000000000000000000000000000000000000000000000000000000061111f565b6104d87f000000000000000000000000000000000000000000000000000000000000000061111f565b6040516020016104ea939291906113bf565b604051602081830303815290604052905090565b60035460009061045690600190611379565b600061051a6103e8565b8211156105d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f7420666f72206120626c6f636b207468617420686173206e6f74206265656e2060648201527f70726f706f736564000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b600354610689576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604660248201527f4c324f75747075744f7261636c653a2063616e6e6f7420676574206f7574707560448201527f74206173206e6f206f7574707574732068617665206265656e2070726f706f7360648201527f6564207965740000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6003546000905b8082101561072257600060026106a68385611435565b6106b0919061147c565b905084600382815481106106c6576106c6611390565b600091825260209091206002909102016001015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16101561071857610711816001611435565b925061071c565b8091505b50610690565b5092915050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146107ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603e60248201527f4c324f75747075744f7261636c653a206f6e6c7920746865206368616c6c656e60448201527f67657220616464726573732063616e2064656c657465206f757470757473000060648201526084016105cb565b60035481106108a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f4c324f75747075744f7261636c653a2063616e6e6f742064656c657465206f7560448201527f747075747320616674657220746865206c6174657374206f757470757420696e60648201527f6465780000000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b60006108b060035490565b90508160035581817f4ee37ac2c786ec85e87592d3c5c8a1dd66f8496dda3f125d9ea8ca5f657629b660405160405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146109d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604160248201527f4c324f75747075744f7261636c653a206f6e6c79207468652070726f706f736560448201527f7220616464726573732063616e2070726f706f7365206e6577206f757470757460648201527f7300000000000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6109db610e81565b8314610a8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604860248201527f4c324f75747075744f7261636c653a20626c6f636b206e756d626572206d757360448201527f7420626520657175616c20746f206e65787420657870656374656420626c6f6360648201527f6b206e756d626572000000000000000000000000000000000000000000000000608482015260a4016105cb565b42610a9984610e33565b10610b26576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f4c324f75747075744f7261636c653a2063616e6e6f742070726f706f7365204c60448201527f32206f757470757420696e20746865206675747572650000000000000000000060648201526084016105cb565b83610bb3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f4c324f75747075744f7261636c653a204c32206f75747075742070726f706f7360448201527f616c2063616e6e6f7420626520746865207a65726f206861736800000000000060648201526084016105cb565b8115610c6f5781814014610c6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604960248201527f4c324f75747075744f7261636c653a20626c6f636b206861736820646f65732060448201527f6e6f74206d61746368207468652068617368206174207468652065787065637460648201527f6564206865696768740000000000000000000000000000000000000000000000608482015260a4016105cb565b82610c7960035490565b857fa7aaf2512769da4e444e3de247be2564225c2e7a8f74cfe528e46e17d24868e242604051610cab91815260200190565b60405180910390a45050604080516060810182529283526fffffffffffffffffffffffffffffffff4281166020850190815292811691840191825260038054600181018255600091909152935160029094027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b810194909455915190518216700100000000000000000000000000000000029116177fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c90910155565b604080516060810182526000808252602082018190529181019190915260038281548110610d9757610d97611390565b600091825260209182902060408051606081018252600290930290910180548352600101546fffffffffffffffffffffffffffffffff8082169484019490945270010000000000000000000000000000000090049092169181019190915292915050565b60408051606081018252600080825260208201819052918101919091526003610e2383610510565b81548110610d9757610d97611390565b60007f000000000000000000000000000000000000000000000000000000000000000060015483610e649190611379565b610e6e9190611490565b600254610e7b9190611435565b92915050565b60007f0000000000000000000000000000000000000000000000000000000000000000610eac6103e8565b6104569190611435565b600054610100900460ff1615808015610ed65750600054600160ff909116105b80610ef05750303b158015610ef0575060005460ff166001145b610f7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016105cb565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610fda57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b42821115611091576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526044602482018190527f4c324f75747075744f7261636c653a207374617274696e67204c322074696d65908201527f7374616d70206d757374206265206c657373207468616e2063757272656e742060648201527f74696d6500000000000000000000000000000000000000000000000000000000608482015260a4016105cb565b6002829055600183905580156110fe57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b60608160000361116257505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b811561118c5780611176816114cd565b91506111859050600a8361147c565b9150611166565b60008167ffffffffffffffff8111156111a7576111a7611505565b6040519080825280601f01601f1916602001820160405280156111d1576020820181803683370190505b5090505b8415611254576111e6600183611379565b91506111f3600a86611534565b6111fe906030611435565b60f81b81838151811061121357611213611390565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535061124d600a8661147c565b94506111d5565b949350505050565b60005b8381101561127757818101518382015260200161125f565b83811115611286576000848401525b50505050565b60208152600082518060208401526112ab81604085016020870161125c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000602082840312156112ef57600080fd5b5035919050565b6000806000806080858703121561130c57600080fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561133b57600080fd5b50508035926020909101359150565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008282101561138b5761138b61134a565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600084516113d181846020890161125c565b80830190507f2e00000000000000000000000000000000000000000000000000000000000000808252855161140d816001850160208a0161125c565b6001920191820152835161142881600284016020880161125c565b0160020195945050505050565b600082198211156114485761144861134a565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261148b5761148b61144d565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156114c8576114c861134a565b500290565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036114fe576114fe61134a565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000826115435761154361144d565b50069056fea164736f6c634300080f000a"
,
}
}
// L2OutputOracleABI is the input ABI used to generate the binding from.
// L2OutputOracleABI is the input ABI used to generate the binding from.
...
...
op-chain-ops/genesis/config.go
View file @
338711c2
...
@@ -22,7 +22,10 @@ import (
...
@@ -22,7 +22,10 @@ import (
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup"
)
)
var
ErrInvalidDeployConfig
=
errors
.
New
(
"invalid deploy config"
)
var
(
ErrInvalidDeployConfig
=
errors
.
New
(
"invalid deploy config"
)
ErrInvalidImmutablesConfig
=
errors
.
New
(
"invalid immutables config"
)
)
// DeployConfig represents the deployment configuration for Optimism
// DeployConfig represents the deployment configuration for Optimism
type
DeployConfig
struct
{
type
DeployConfig
struct
{
...
@@ -344,12 +347,27 @@ func NewDeployConfigWithNetwork(network, path string) (*DeployConfig, error) {
...
@@ -344,12 +347,27 @@ func NewDeployConfigWithNetwork(network, path string) (*DeployConfig, error) {
}
}
// NewL2ImmutableConfig will create an ImmutableConfig given an instance of a
// NewL2ImmutableConfig will create an ImmutableConfig given an instance of a
//
Hardhat and a DeployConfig
.
//
DeployConfig and a block
.
func
NewL2ImmutableConfig
(
config
*
DeployConfig
,
block
*
types
.
Block
)
(
immutables
.
ImmutableConfig
,
error
)
{
func
NewL2ImmutableConfig
(
config
*
DeployConfig
,
block
*
types
.
Block
)
(
immutables
.
ImmutableConfig
,
error
)
{
immutable
:=
make
(
immutables
.
ImmutableConfig
)
immutable
:=
make
(
immutables
.
ImmutableConfig
)
if
config
.
L1StandardBridgeProxy
==
(
common
.
Address
{})
{
return
immutable
,
fmt
.
Errorf
(
"L1StandardBridgeProxy cannot be address(0): %w"
,
ErrInvalidImmutablesConfig
)
}
if
config
.
L1CrossDomainMessengerProxy
==
(
common
.
Address
{})
{
return
immutable
,
fmt
.
Errorf
(
"L1CrossDomainMessengerProxy cannot be address(0): %w"
,
ErrInvalidImmutablesConfig
)
}
if
config
.
L1ERC721BridgeProxy
==
(
common
.
Address
{})
{
if
config
.
L1ERC721BridgeProxy
==
(
common
.
Address
{})
{
return
immutable
,
errors
.
New
(
"L1ERC721BridgeProxy cannot be address(0)"
)
return
immutable
,
fmt
.
Errorf
(
"L1ERC721BridgeProxy cannot be address(0): %w"
,
ErrInvalidImmutablesConfig
)
}
if
config
.
SequencerFeeVaultRecipient
==
(
common
.
Address
{})
{
return
immutable
,
fmt
.
Errorf
(
"SequencerFeeVaultRecipient cannot be address(0): %w"
,
ErrInvalidImmutablesConfig
)
}
if
config
.
BaseFeeVaultRecipient
==
(
common
.
Address
{})
{
return
immutable
,
fmt
.
Errorf
(
"BaseFeeVaultRecipient cannot be address(0): %w"
,
ErrInvalidImmutablesConfig
)
}
if
config
.
L1FeeVaultRecipient
==
(
common
.
Address
{})
{
return
immutable
,
fmt
.
Errorf
(
"L1FeeVaultRecipient cannot be address(0): %w"
,
ErrInvalidImmutablesConfig
)
}
}
immutable
[
"L2StandardBridge"
]
=
immutables
.
ImmutableValues
{
immutable
[
"L2StandardBridge"
]
=
immutables
.
ImmutableValues
{
...
...
op-chain-ops/genesis/testdata/test-deploy-config-devnet-l1.json
View file @
338711c2
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
"l1FeeVaultRecipient"
:
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788"
,
"l1FeeVaultRecipient"
:
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788"
,
"sequencerFeeVaultRecipient"
:
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788"
,
"sequencerFeeVaultRecipient"
:
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788"
,
"l1ERC721BridgeProxy"
:
"0xff000000000000000000000000000000000000ff"
,
"l1ERC721BridgeProxy"
:
"0xff000000000000000000000000000000000000ff"
,
"l1StandardBridgeProxy"
:
"0xff000000000000000000000000000000000000fd"
,
"l1CrossDomainMessengerProxy"
:
"0xff000000000000000000000000000000000000dd"
,
"deploymentWaitConfirmations"
:
1
,
"deploymentWaitConfirmations"
:
1
,
"fundDevAccounts"
:
true
"fundDevAccounts"
:
true
...
...
op-chain-ops/immutables/immutables.go
View file @
338711c2
package
immutables
package
immutables
import
(
import
(
"errors"
"fmt"
"fmt"
"math/big"
"math/big"
...
@@ -24,6 +25,39 @@ type ImmutableValues map[string]any
...
@@ -24,6 +25,39 @@ type ImmutableValues map[string]any
// contracts.
// contracts.
type
ImmutableConfig
map
[
string
]
ImmutableValues
type
ImmutableConfig
map
[
string
]
ImmutableValues
// Check does a sanity check that the specific values that
// Optimism uses are set inside of the ImmutableConfig.
func
(
i
ImmutableConfig
)
Check
()
error
{
if
_
,
ok
:=
i
[
"L2CrossDomainMessenger"
][
"otherMessenger"
];
!
ok
{
return
errors
.
New
(
"L2CrossDomainMessenger otherMessenger not set"
)
}
if
_
,
ok
:=
i
[
"L2StandardBridge"
][
"otherBridge"
];
!
ok
{
return
errors
.
New
(
"L2StandardBridge otherBridge not set"
)
}
if
_
,
ok
:=
i
[
"L2ERC721Bridge"
][
"messenger"
];
!
ok
{
return
errors
.
New
(
"L2ERC721Bridge messenger not set"
)
}
if
_
,
ok
:=
i
[
"L2ERC721Bridge"
][
"otherBridge"
];
!
ok
{
return
errors
.
New
(
"L2ERC721Bridge otherBridge not set"
)
}
if
_
,
ok
:=
i
[
"OptimismMintableERC721Factory"
][
"bridge"
];
!
ok
{
return
errors
.
New
(
"OptimismMintableERC20Factory bridge not set"
)
}
if
_
,
ok
:=
i
[
"OptimismMintableERC721Factory"
][
"remoteChainId"
];
!
ok
{
return
errors
.
New
(
"OptimismMintableERC20Factory remoteChainId not set"
)
}
if
_
,
ok
:=
i
[
"SequencerFeeVault"
][
"recipient"
];
!
ok
{
return
errors
.
New
(
"SequencerFeeVault recipient not set"
)
}
if
_
,
ok
:=
i
[
"L1FeeVault"
][
"recipient"
];
!
ok
{
return
errors
.
New
(
"L1FeeVault recipient not set"
)
}
if
_
,
ok
:=
i
[
"BaseFeeVault"
][
"recipient"
];
!
ok
{
return
errors
.
New
(
"BaseFeeVault recipient not set"
)
}
return
nil
}
// DeploymentResults represents the output of deploying each of the
// DeploymentResults represents the output of deploying each of the
// contracts so that the immutables can be set properly in the bytecode.
// contracts so that the immutables can be set properly in the bytecode.
type
DeploymentResults
map
[
string
]
hexutil
.
Bytes
type
DeploymentResults
map
[
string
]
hexutil
.
Bytes
...
@@ -31,6 +65,10 @@ type DeploymentResults map[string]hexutil.Bytes
...
@@ -31,6 +65,10 @@ type DeploymentResults map[string]hexutil.Bytes
// BuildOptimism will deploy the L2 predeploys so that their immutables are set
// BuildOptimism will deploy the L2 predeploys so that their immutables are set
// correctly.
// correctly.
func
BuildOptimism
(
immutable
ImmutableConfig
)
(
DeploymentResults
,
error
)
{
func
BuildOptimism
(
immutable
ImmutableConfig
)
(
DeploymentResults
,
error
)
{
if
err
:=
immutable
.
Check
();
err
!=
nil
{
return
DeploymentResults
{},
err
}
deployments
:=
[]
deployer
.
Constructor
{
deployments
:=
[]
deployer
.
Constructor
{
{
{
Name
:
"GasPriceOracle"
,
Name
:
"GasPriceOracle"
,
...
...
op-chain-ops/immutables/immutables_test.go
View file @
338711c2
...
@@ -19,9 +19,11 @@ func TestBuildOptimism(t *testing.T) {
...
@@ -19,9 +19,11 @@ func TestBuildOptimism(t *testing.T) {
},
},
"L2ERC721Bridge"
:
{
"L2ERC721Bridge"
:
{
"otherBridge"
:
common
.
HexToAddress
(
"0x1234567890123456789012345678901234567890"
),
"otherBridge"
:
common
.
HexToAddress
(
"0x1234567890123456789012345678901234567890"
),
"messenger"
:
common
.
HexToAddress
(
"0x1234567890123456789012345678901234567890"
),
},
},
"OptimismMintableERC721Factory"
:
{
"OptimismMintableERC721Factory"
:
{
"remoteChainId"
:
big
.
NewInt
(
1
),
"remoteChainId"
:
big
.
NewInt
(
1
),
"bridge"
:
common
.
HexToAddress
(
"0x1234567890123456789012345678901234567890"
),
},
},
"SequencerFeeVault"
:
{
"SequencerFeeVault"
:
{
"recipient"
:
common
.
HexToAddress
(
"0x1234567890123456789012345678901234567890"
),
"recipient"
:
common
.
HexToAddress
(
"0x1234567890123456789012345678901234567890"
),
...
...
op-e2e/e2eutils/setup.go
View file @
338711c2
...
@@ -102,6 +102,10 @@ func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams {
...
@@ -102,6 +102,10 @@ func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams {
GasPriceOracleScalar
:
1000
_000
,
GasPriceOracleScalar
:
1000
_000
,
DeploymentWaitConfirmations
:
1
,
DeploymentWaitConfirmations
:
1
,
SequencerFeeVaultRecipient
:
common
.
Address
{
19
:
1
},
BaseFeeVaultRecipient
:
common
.
Address
{
19
:
2
},
L1FeeVaultRecipient
:
common
.
Address
{
19
:
3
},
EIP1559Elasticity
:
10
,
EIP1559Elasticity
:
10
,
EIP1559Denominator
:
50
,
EIP1559Denominator
:
50
,
...
...
op-e2e/setup.go
View file @
338711c2
...
@@ -92,6 +92,10 @@ func DefaultSystemConfig(t *testing.T) SystemConfig {
...
@@ -92,6 +92,10 @@ func DefaultSystemConfig(t *testing.T) SystemConfig {
GasPriceOracleOverhead
:
2100
,
GasPriceOracleOverhead
:
2100
,
GasPriceOracleScalar
:
1
_000_000
,
GasPriceOracleScalar
:
1
_000_000
,
SequencerFeeVaultRecipient
:
common
.
Address
{
19
:
1
},
BaseFeeVaultRecipient
:
common
.
Address
{
19
:
2
},
L1FeeVaultRecipient
:
common
.
Address
{
19
:
3
},
DeploymentWaitConfirmations
:
1
,
DeploymentWaitConfirmations
:
1
,
EIP1559Elasticity
:
2
,
EIP1559Elasticity
:
2
,
...
...
op-node/eth/block_info.go
View file @
338711c2
...
@@ -20,6 +20,7 @@ type BlockInfo interface {
...
@@ -20,6 +20,7 @@ type BlockInfo interface {
MixDigest
()
common
.
Hash
MixDigest
()
common
.
Hash
BaseFee
()
*
big
.
Int
BaseFee
()
*
big
.
Int
ReceiptHash
()
common
.
Hash
ReceiptHash
()
common
.
Hash
GasUsed
()
uint64
}
}
func
InfoToL1BlockRef
(
info
BlockInfo
)
L1BlockRef
{
func
InfoToL1BlockRef
(
info
BlockInfo
)
L1BlockRef
{
...
@@ -79,6 +80,10 @@ func (h headerBlockInfo) ReceiptHash() common.Hash {
...
@@ -79,6 +80,10 @@ func (h headerBlockInfo) ReceiptHash() common.Hash {
return
h
.
Header
.
ReceiptHash
return
h
.
Header
.
ReceiptHash
}
}
func
(
h
headerBlockInfo
)
GasUsed
()
uint64
{
return
h
.
Header
.
GasUsed
}
// HeaderBlockInfo returns h as a BlockInfo implementation.
// HeaderBlockInfo returns h as a BlockInfo implementation.
func
HeaderBlockInfo
(
h
*
types
.
Header
)
BlockInfo
{
func
HeaderBlockInfo
(
h
*
types
.
Header
)
BlockInfo
{
return
headerBlockInfo
{
h
}
return
headerBlockInfo
{
h
}
...
...
op-node/p2p/gossip.go
View file @
338711c2
...
@@ -34,7 +34,8 @@ const (
...
@@ -34,7 +34,8 @@ const (
globalValidateThrottle
=
512
globalValidateThrottle
=
512
gossipHeartbeat
=
500
*
time
.
Millisecond
gossipHeartbeat
=
500
*
time
.
Millisecond
// seenMessagesTTL limits the duration that message IDs are remembered for gossip deduplication purposes
// seenMessagesTTL limits the duration that message IDs are remembered for gossip deduplication purposes
seenMessagesTTL
=
80
*
gossipHeartbeat
// 130 * gossipHeartbeat
seenMessagesTTL
=
130
*
gossipHeartbeat
DefaultMeshD
=
8
// topic stable mesh target count
DefaultMeshD
=
8
// topic stable mesh target count
DefaultMeshDlo
=
6
// topic stable mesh low watermark
DefaultMeshDlo
=
6
// topic stable mesh low watermark
DefaultMeshDhi
=
12
// topic stable mesh high watermark
DefaultMeshDhi
=
12
// topic stable mesh high watermark
...
@@ -234,7 +235,7 @@ func BuildBlocksValidator(log log.Logger, cfg *rollup.Config, runCfg GossipRunti
...
@@ -234,7 +235,7 @@ func BuildBlocksValidator(log log.Logger, cfg *rollup.Config, runCfg GossipRunti
// Seen block hashes per block height
// Seen block hashes per block height
// uint64 -> *seenBlocks
// uint64 -> *seenBlocks
blockHeightLRU
,
err
:=
lru
.
New
(
100
)
blockHeightLRU
,
err
:=
lru
.
New
(
100
0
)
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
fmt
.
Errorf
(
"failed to set up block height LRU cache: %w"
,
err
))
panic
(
fmt
.
Errorf
(
"failed to set up block height LRU cache: %w"
,
err
))
}
}
...
@@ -328,9 +329,9 @@ func BuildBlocksValidator(log log.Logger, cfg *rollup.Config, runCfg GossipRunti
...
@@ -328,9 +329,9 @@ func BuildBlocksValidator(log log.Logger, cfg *rollup.Config, runCfg GossipRunti
}
}
func
verifyBlockSignature
(
log
log
.
Logger
,
cfg
*
rollup
.
Config
,
runCfg
GossipRuntimeConfig
,
id
peer
.
ID
,
signatureBytes
[]
byte
,
payloadBytes
[]
byte
)
pubsub
.
ValidationResult
{
func
verifyBlockSignature
(
log
log
.
Logger
,
cfg
*
rollup
.
Config
,
runCfg
GossipRuntimeConfig
,
id
peer
.
ID
,
signatureBytes
[]
byte
,
payloadBytes
[]
byte
)
pubsub
.
ValidationResult
{
result
:=
verifyBlockSignatureWithHasher
(
log
,
cfg
,
runCfg
,
id
,
signatureBytes
,
payloadBytes
,
BlockSigningHash
)
result
:=
verifyBlockSignatureWithHasher
(
nil
,
cfg
,
runCfg
,
id
,
signatureBytes
,
payloadBytes
,
Legacy
BlockSigningHash
)
if
result
!=
pubsub
.
ValidationAccept
{
if
result
!=
pubsub
.
ValidationAccept
{
return
verifyBlockSignatureWithHasher
(
log
,
cfg
,
runCfg
,
id
,
signatureBytes
,
payloadBytes
,
Legacy
BlockSigningHash
)
return
verifyBlockSignatureWithHasher
(
log
,
cfg
,
runCfg
,
id
,
signatureBytes
,
payloadBytes
,
BlockSigningHash
)
}
}
return
result
return
result
}
}
...
@@ -338,13 +339,17 @@ func verifyBlockSignature(log log.Logger, cfg *rollup.Config, runCfg GossipRunti
...
@@ -338,13 +339,17 @@ func verifyBlockSignature(log log.Logger, cfg *rollup.Config, runCfg GossipRunti
func
verifyBlockSignatureWithHasher
(
log
log
.
Logger
,
cfg
*
rollup
.
Config
,
runCfg
GossipRuntimeConfig
,
id
peer
.
ID
,
signatureBytes
[]
byte
,
payloadBytes
[]
byte
,
hasher
func
(
cfg
*
rollup
.
Config
,
payloadBytes
[]
byte
)
(
common
.
Hash
,
error
))
pubsub
.
ValidationResult
{
func
verifyBlockSignatureWithHasher
(
log
log
.
Logger
,
cfg
*
rollup
.
Config
,
runCfg
GossipRuntimeConfig
,
id
peer
.
ID
,
signatureBytes
[]
byte
,
payloadBytes
[]
byte
,
hasher
func
(
cfg
*
rollup
.
Config
,
payloadBytes
[]
byte
)
(
common
.
Hash
,
error
))
pubsub
.
ValidationResult
{
signingHash
,
err
:=
hasher
(
cfg
,
payloadBytes
)
signingHash
,
err
:=
hasher
(
cfg
,
payloadBytes
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Warn
(
"failed to compute block signing hash"
,
"err"
,
err
,
"peer"
,
id
)
if
log
!=
nil
{
log
.
Warn
(
"failed to compute block signing hash"
,
"err"
,
err
,
"peer"
,
id
)
}
return
pubsub
.
ValidationReject
return
pubsub
.
ValidationReject
}
}
pub
,
err
:=
crypto
.
SigToPub
(
signingHash
[
:
],
signatureBytes
)
pub
,
err
:=
crypto
.
SigToPub
(
signingHash
[
:
],
signatureBytes
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Warn
(
"invalid block signature"
,
"err"
,
err
,
"peer"
,
id
)
if
log
!=
nil
{
log
.
Warn
(
"invalid block signature"
,
"err"
,
err
,
"peer"
,
id
)
}
return
pubsub
.
ValidationReject
return
pubsub
.
ValidationReject
}
}
addr
:=
crypto
.
PubkeyToAddress
(
*
pub
)
addr
:=
crypto
.
PubkeyToAddress
(
*
pub
)
...
@@ -355,10 +360,14 @@ func verifyBlockSignatureWithHasher(log log.Logger, cfg *rollup.Config, runCfg G
...
@@ -355,10 +360,14 @@ func verifyBlockSignatureWithHasher(log log.Logger, cfg *rollup.Config, runCfg G
// This means we may drop old payloads upon key rotation,
// This means we may drop old payloads upon key rotation,
// but this can be recovered from like any other missed unsafe payload.
// but this can be recovered from like any other missed unsafe payload.
if
expected
:=
runCfg
.
P2PSequencerAddress
();
expected
==
(
common
.
Address
{})
{
if
expected
:=
runCfg
.
P2PSequencerAddress
();
expected
==
(
common
.
Address
{})
{
log
.
Warn
(
"no configured p2p sequencer address, ignoring gossiped block"
,
"peer"
,
id
,
"addr"
,
addr
)
if
log
!=
nil
{
log
.
Warn
(
"no configured p2p sequencer address, ignoring gossiped block"
,
"peer"
,
id
,
"addr"
,
addr
)
}
return
pubsub
.
ValidationIgnore
return
pubsub
.
ValidationIgnore
}
else
if
addr
!=
expected
{
}
else
if
addr
!=
expected
{
log
.
Warn
(
"unexpected block author"
,
"err"
,
err
,
"peer"
,
id
,
"addr"
,
addr
,
"expected"
,
expected
)
if
log
!=
nil
{
log
.
Warn
(
"unexpected block author"
,
"err"
,
err
,
"peer"
,
id
,
"addr"
,
addr
,
"expected"
,
expected
)
}
return
pubsub
.
ValidationReject
return
pubsub
.
ValidationReject
}
}
return
pubsub
.
ValidationAccept
return
pubsub
.
ValidationAccept
...
...
op-node/rollup/types.go
View file @
338711c2
...
@@ -12,6 +12,27 @@ import (
...
@@ -12,6 +12,27 @@ import (
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/eth"
)
)
var
(
ErrBlockTimeZero
=
errors
.
New
(
"block time cannot be 0"
)
ErrMissingChannelTimeout
=
errors
.
New
(
"channel timeout must be set, this should cover at least a L1 block time"
)
ErrInvalidSeqWindowSize
=
errors
.
New
(
"sequencing window size must at least be 2"
)
ErrMissingGenesisL1Hash
=
errors
.
New
(
"genesis L1 hash cannot be empty"
)
ErrMissingGenesisL2Hash
=
errors
.
New
(
"genesis L2 hash cannot be empty"
)
ErrGenesisHashesSame
=
errors
.
New
(
"achievement get! rollup inception: L1 and L2 genesis cannot be the same"
)
ErrMissingGenesisL2Time
=
errors
.
New
(
"missing L2 genesis time"
)
ErrMissingBatcherAddr
=
errors
.
New
(
"missing genesis system config batcher address"
)
ErrMissingOverhead
=
errors
.
New
(
"missing genesis system config overhead"
)
ErrMissingScalar
=
errors
.
New
(
"missing genesis system config scalar"
)
ErrMissingGasLimit
=
errors
.
New
(
"missing genesis system config gas limit"
)
ErrMissingBatchInboxAddress
=
errors
.
New
(
"missing batch inbox address"
)
ErrMissingDepositContractAddress
=
errors
.
New
(
"missing deposit contract address"
)
ErrMissingL1ChainID
=
errors
.
New
(
"L1 chain ID must not be nil"
)
ErrMissingL2ChainID
=
errors
.
New
(
"L2 chain ID must not be nil"
)
ErrChainIDsSame
=
errors
.
New
(
"L1 and L2 chain IDs must be different"
)
ErrL1ChainIDNotPositive
=
errors
.
New
(
"L1 chain ID must be non-zero and positive"
)
ErrL2ChainIDNotPositive
=
errors
.
New
(
"L2 chain ID must be non-zero and positive"
)
)
type
Genesis
struct
{
type
Genesis
struct
{
// The L1 block that the rollup starts *after* (no derived transactions)
// The L1 block that the rollup starts *after* (no derived transactions)
L1
eth
.
BlockID
`json:"l1"`
L1
eth
.
BlockID
`json:"l1"`
...
@@ -147,52 +168,58 @@ func (cfg *Config) CheckL2GenesisBlockHash(ctx context.Context, client L2Client)
...
@@ -147,52 +168,58 @@ func (cfg *Config) CheckL2GenesisBlockHash(ctx context.Context, client L2Client)
// Check verifies that the given configuration makes sense
// Check verifies that the given configuration makes sense
func
(
cfg
*
Config
)
Check
()
error
{
func
(
cfg
*
Config
)
Check
()
error
{
if
cfg
.
BlockTime
==
0
{
if
cfg
.
BlockTime
==
0
{
return
fmt
.
Errorf
(
"block time cannot be 0, got %d"
,
cfg
.
BlockTime
)
return
ErrBlockTimeZero
}
}
if
cfg
.
ChannelTimeout
==
0
{
if
cfg
.
ChannelTimeout
==
0
{
return
fmt
.
Errorf
(
"channel timeout must be set, this should cover at least a L1 block time"
)
return
ErrMissingChannelTimeout
}
}
if
cfg
.
SeqWindowSize
<
2
{
if
cfg
.
SeqWindowSize
<
2
{
return
fmt
.
Errorf
(
"sequencing window size must at least be 2, got %d"
,
cfg
.
SeqWindowSize
)
return
ErrInvalidSeqWindowSize
}
}
if
cfg
.
Genesis
.
L1
.
Hash
==
(
common
.
Hash
{})
{
if
cfg
.
Genesis
.
L1
.
Hash
==
(
common
.
Hash
{})
{
return
errors
.
New
(
"genesis l1 hash cannot be empty"
)
return
ErrMissingGenesisL1Hash
}
}
if
cfg
.
Genesis
.
L2
.
Hash
==
(
common
.
Hash
{})
{
if
cfg
.
Genesis
.
L2
.
Hash
==
(
common
.
Hash
{})
{
return
errors
.
New
(
"genesis l2 hash cannot be empty"
)
return
ErrMissingGenesisL2Hash
}
}
if
cfg
.
Genesis
.
L2
.
Hash
==
cfg
.
Genesis
.
L1
.
Hash
{
if
cfg
.
Genesis
.
L2
.
Hash
==
cfg
.
Genesis
.
L1
.
Hash
{
return
errors
.
New
(
"achievement get! rollup inception: L1 and L2 genesis cannot be the same"
)
return
ErrGenesisHashesSame
}
}
if
cfg
.
Genesis
.
L2Time
==
0
{
if
cfg
.
Genesis
.
L2Time
==
0
{
return
errors
.
New
(
"missing L2 genesis time"
)
return
ErrMissingGenesisL2Time
}
}
if
cfg
.
Genesis
.
SystemConfig
.
BatcherAddr
==
(
common
.
Address
{})
{
if
cfg
.
Genesis
.
SystemConfig
.
BatcherAddr
==
(
common
.
Address
{})
{
return
errors
.
New
(
"missing genesis system config batcher address"
)
return
ErrMissingBatcherAddr
}
}
if
cfg
.
Genesis
.
SystemConfig
.
Overhead
==
(
eth
.
Bytes32
{})
{
if
cfg
.
Genesis
.
SystemConfig
.
Overhead
==
(
eth
.
Bytes32
{})
{
return
errors
.
New
(
"missing genesis system config overhead"
)
return
ErrMissingOverhead
}
}
if
cfg
.
Genesis
.
SystemConfig
.
Scalar
==
(
eth
.
Bytes32
{})
{
if
cfg
.
Genesis
.
SystemConfig
.
Scalar
==
(
eth
.
Bytes32
{})
{
return
errors
.
New
(
"missing genesis system config scalar"
)
return
ErrMissingScalar
}
}
if
cfg
.
Genesis
.
SystemConfig
.
GasLimit
==
0
{
if
cfg
.
Genesis
.
SystemConfig
.
GasLimit
==
0
{
return
errors
.
New
(
"missing genesis system config gas limit"
)
return
ErrMissingGasLimit
}
}
if
cfg
.
BatchInboxAddress
==
(
common
.
Address
{})
{
if
cfg
.
BatchInboxAddress
==
(
common
.
Address
{})
{
return
errors
.
New
(
"missing batch inbox address"
)
return
ErrMissingBatchInboxAddress
}
}
if
cfg
.
DepositContractAddress
==
(
common
.
Address
{})
{
if
cfg
.
DepositContractAddress
==
(
common
.
Address
{})
{
return
errors
.
New
(
"missing deposit contract address"
)
return
ErrMissingDepositContractAddress
}
}
if
cfg
.
L1ChainID
==
nil
{
if
cfg
.
L1ChainID
==
nil
{
return
errors
.
New
(
"l1 chain ID must not be nil"
)
return
ErrMissingL1ChainID
}
}
if
cfg
.
L2ChainID
==
nil
{
if
cfg
.
L2ChainID
==
nil
{
return
errors
.
New
(
"l2 chain ID must not be nil"
)
return
ErrMissingL2ChainID
}
}
if
cfg
.
L1ChainID
.
Cmp
(
cfg
.
L2ChainID
)
==
0
{
if
cfg
.
L1ChainID
.
Cmp
(
cfg
.
L2ChainID
)
==
0
{
return
errors
.
New
(
"l1 and l2 chain IDs must be different"
)
return
ErrChainIDsSame
}
if
cfg
.
L1ChainID
.
Sign
()
<
1
{
return
ErrL1ChainIDNotPositive
}
if
cfg
.
L2ChainID
.
Sign
()
<
1
{
return
ErrL2ChainIDNotPositive
}
}
return
nil
return
nil
}
}
...
...
op-node/rollup/types_test.go
View file @
338711c2
...
@@ -212,3 +212,125 @@ func TestCheckL2BlockRefByNumber(t *testing.T) {
...
@@ -212,3 +212,125 @@ func TestCheckL2BlockRefByNumber(t *testing.T) {
err
=
config
.
CheckL2GenesisBlockHash
(
context
.
TODO
(),
&
mockClient
)
err
=
config
.
CheckL2GenesisBlockHash
(
context
.
TODO
(),
&
mockClient
)
assert
.
Error
(
t
,
err
)
assert
.
Error
(
t
,
err
)
}
}
func
TestConfig_Check
(
t
*
testing
.
T
)
{
tests
:=
[]
struct
{
name
string
modifier
func
(
cfg
*
Config
)
expectedErr
error
}{
{
name
:
"BlockTimeZero"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
BlockTime
=
0
},
expectedErr
:
ErrBlockTimeZero
,
},
{
name
:
"ChannelTimeoutZero"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
ChannelTimeout
=
0
},
expectedErr
:
ErrMissingChannelTimeout
,
},
{
name
:
"SeqWindowSizeZero"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
SeqWindowSize
=
0
},
expectedErr
:
ErrInvalidSeqWindowSize
,
},
{
name
:
"SeqWindowSizeOne"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
SeqWindowSize
=
1
},
expectedErr
:
ErrInvalidSeqWindowSize
,
},
{
name
:
"NoL1Genesis"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
Genesis
.
L1
.
Hash
=
common
.
Hash
{}
},
expectedErr
:
ErrMissingGenesisL1Hash
,
},
{
name
:
"NoL2Genesis"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
Genesis
.
L2
.
Hash
=
common
.
Hash
{}
},
expectedErr
:
ErrMissingGenesisL2Hash
,
},
{
name
:
"GenesisHashesEqual"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
Genesis
.
L2
.
Hash
=
cfg
.
Genesis
.
L1
.
Hash
},
expectedErr
:
ErrGenesisHashesSame
,
},
{
name
:
"GenesisL2TimeZero"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
Genesis
.
L2Time
=
0
},
expectedErr
:
ErrMissingGenesisL2Time
,
},
{
name
:
"NoBatcherAddr"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
Genesis
.
SystemConfig
.
BatcherAddr
=
common
.
Address
{}
},
expectedErr
:
ErrMissingBatcherAddr
,
},
{
name
:
"NoOverhead"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
Genesis
.
SystemConfig
.
Overhead
=
eth
.
Bytes32
{}
},
expectedErr
:
ErrMissingOverhead
,
},
{
name
:
"NoScalar"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
Genesis
.
SystemConfig
.
Scalar
=
eth
.
Bytes32
{}
},
expectedErr
:
ErrMissingScalar
,
},
{
name
:
"NoGasLimit"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
Genesis
.
SystemConfig
.
GasLimit
=
0
},
expectedErr
:
ErrMissingGasLimit
,
},
{
name
:
"NoBatchInboxAddress"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
BatchInboxAddress
=
common
.
Address
{}
},
expectedErr
:
ErrMissingBatchInboxAddress
,
},
{
name
:
"NoDepositContractAddress"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
DepositContractAddress
=
common
.
Address
{}
},
expectedErr
:
ErrMissingDepositContractAddress
,
},
{
name
:
"NoL1ChainId"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
L1ChainID
=
nil
},
expectedErr
:
ErrMissingL1ChainID
,
},
{
name
:
"NoL2ChainId"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
L2ChainID
=
nil
},
expectedErr
:
ErrMissingL2ChainID
,
},
{
name
:
"ChainIDsEqual"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
L2ChainID
=
cfg
.
L1ChainID
},
expectedErr
:
ErrChainIDsSame
,
},
{
name
:
"L1ChainIdNegative"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
L1ChainID
=
big
.
NewInt
(
-
1
)
},
expectedErr
:
ErrL1ChainIDNotPositive
,
},
{
name
:
"L1ChainIdZero"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
L1ChainID
=
big
.
NewInt
(
0
)
},
expectedErr
:
ErrL1ChainIDNotPositive
,
},
{
name
:
"L2ChainIdNegative"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
L2ChainID
=
big
.
NewInt
(
-
1
)
},
expectedErr
:
ErrL2ChainIDNotPositive
,
},
{
name
:
"L2ChainIdZero"
,
modifier
:
func
(
cfg
*
Config
)
{
cfg
.
L2ChainID
=
big
.
NewInt
(
0
)
},
expectedErr
:
ErrL2ChainIDNotPositive
,
},
}
for
_
,
test
:=
range
tests
{
t
.
Run
(
test
.
name
,
func
(
t
*
testing
.
T
)
{
cfg
:=
randConfig
()
test
.
modifier
(
cfg
)
err
:=
cfg
.
Check
()
assert
.
Same
(
t
,
err
,
test
.
expectedErr
)
})
}
}
op-node/sources/types.go
View file @
338711c2
...
@@ -46,6 +46,7 @@ type HeaderInfo struct {
...
@@ -46,6 +46,7 @@ type HeaderInfo struct {
baseFee
*
big
.
Int
baseFee
*
big
.
Int
txHash
common
.
Hash
txHash
common
.
Hash
receiptHash
common
.
Hash
receiptHash
common
.
Hash
gasUsed
uint64
}
}
var
_
eth
.
BlockInfo
=
(
*
HeaderInfo
)(
nil
)
var
_
eth
.
BlockInfo
=
(
*
HeaderInfo
)(
nil
)
...
@@ -90,6 +91,10 @@ func (info *HeaderInfo) ReceiptHash() common.Hash {
...
@@ -90,6 +91,10 @@ func (info *HeaderInfo) ReceiptHash() common.Hash {
return
info
.
receiptHash
return
info
.
receiptHash
}
}
func
(
info
*
HeaderInfo
)
GasUsed
()
uint64
{
return
info
.
gasUsed
}
type
rpcHeader
struct
{
type
rpcHeader
struct
{
ParentHash
common
.
Hash
`json:"parentHash"`
ParentHash
common
.
Hash
`json:"parentHash"`
UncleHash
common
.
Hash
`json:"sha3Uncles"`
UncleHash
common
.
Hash
`json:"sha3Uncles"`
...
@@ -182,6 +187,7 @@ func (hdr *rpcHeader) Info(trustCache bool, mustBePostMerge bool) (*HeaderInfo,
...
@@ -182,6 +187,7 @@ func (hdr *rpcHeader) Info(trustCache bool, mustBePostMerge bool) (*HeaderInfo,
baseFee
:
(
*
big
.
Int
)(
hdr
.
BaseFee
),
baseFee
:
(
*
big
.
Int
)(
hdr
.
BaseFee
),
txHash
:
hdr
.
TxHash
,
txHash
:
hdr
.
TxHash
,
receiptHash
:
hdr
.
ReceiptHash
,
receiptHash
:
hdr
.
ReceiptHash
,
gasUsed
:
uint64
(
hdr
.
GasUsed
),
}
}
return
&
info
,
nil
return
&
info
,
nil
}
}
...
...
op-node/testutils/l1info.go
View file @
338711c2
...
@@ -21,6 +21,7 @@ type MockBlockInfo struct {
...
@@ -21,6 +21,7 @@ type MockBlockInfo struct {
InfoMixDigest
[
32
]
byte
InfoMixDigest
[
32
]
byte
InfoBaseFee
*
big
.
Int
InfoBaseFee
*
big
.
Int
InfoReceiptRoot
common
.
Hash
InfoReceiptRoot
common
.
Hash
InfoGasUsed
uint64
}
}
func
(
l
*
MockBlockInfo
)
Hash
()
common
.
Hash
{
func
(
l
*
MockBlockInfo
)
Hash
()
common
.
Hash
{
...
@@ -59,6 +60,10 @@ func (l *MockBlockInfo) ReceiptHash() common.Hash {
...
@@ -59,6 +60,10 @@ func (l *MockBlockInfo) ReceiptHash() common.Hash {
return
l
.
InfoReceiptRoot
return
l
.
InfoReceiptRoot
}
}
func
(
l
*
MockBlockInfo
)
GasUsed
()
uint64
{
return
l
.
InfoGasUsed
}
func
(
l
*
MockBlockInfo
)
ID
()
eth
.
BlockID
{
func
(
l
*
MockBlockInfo
)
ID
()
eth
.
BlockID
{
return
eth
.
BlockID
{
Hash
:
l
.
InfoHash
,
Number
:
l
.
InfoNum
}
return
eth
.
BlockID
{
Hash
:
l
.
InfoHash
,
Number
:
l
.
InfoNum
}
}
}
...
@@ -81,6 +86,7 @@ func RandomBlockInfo(rng *rand.Rand) *MockBlockInfo {
...
@@ -81,6 +86,7 @@ func RandomBlockInfo(rng *rand.Rand) *MockBlockInfo {
InfoBaseFee
:
big
.
NewInt
(
rng
.
Int63n
(
1000
_000
*
1e9
)),
// a million GWEI
InfoBaseFee
:
big
.
NewInt
(
rng
.
Int63n
(
1000
_000
*
1e9
)),
// a million GWEI
InfoReceiptRoot
:
types
.
EmptyRootHash
,
InfoReceiptRoot
:
types
.
EmptyRootHash
,
InfoRoot
:
RandomHash
(
rng
),
InfoRoot
:
RandomHash
(
rng
),
InfoGasUsed
:
rng
.
Uint64
(),
}
}
}
}
...
...
op-wheel/go.mod
View file @
338711c2
...
@@ -85,4 +85,4 @@ require (
...
@@ -85,4 +85,4 @@ require (
lukechampine.com/blake3 v1.1.7 // indirect
lukechampine.com/blake3 v1.1.7 // indirect
)
)
replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-202
21216190603-60b51d600468
replace github.com/ethereum/go-ethereum v1.10.26 => github.com/ethereum-optimism/op-geth v0.0.0-202
30214215134-401b7fd3309b
op-wheel/go.sum
View file @
338711c2
...
@@ -81,8 +81,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
...
@@ -81,8 +81,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum-optimism/op-geth v0.0.0-202
21216190603-60b51d600468 h1:7KgjBYDji5AKi42eRYI+n8Gs+ZJVilSASL3WBu82c3M
=
github.com/ethereum-optimism/op-geth v0.0.0-202
30214215134-401b7fd3309b h1:qpsJ9tFppQOwO0rHrggOrSXW5XIx4G3DBEV6jrf9gU0
=
github.com/ethereum-optimism/op-geth v0.0.0-202
21216190603-60b51d600468
/go.mod h1:p0Yox74PhYlq1HvijrCBCD9A3cI7rXco7hT6KrQr+rY=
github.com/ethereum-optimism/op-geth v0.0.0-202
30214215134-401b7fd3309b
/go.mod h1:p0Yox74PhYlq1HvijrCBCD9A3cI7rXco7hT6KrQr+rY=
github.com/ethereum-optimism/optimism/op-node v0.10.3 h1:96KbEtbfJTg5GXtNqLnrDPnXMbeynIy1G8iSc47whrA=
github.com/ethereum-optimism/optimism/op-node v0.10.3 h1:96KbEtbfJTg5GXtNqLnrDPnXMbeynIy1G8iSc47whrA=
github.com/ethereum-optimism/optimism/op-node v0.10.3/go.mod h1:fsRLXH68xaLhjfr67MPEtjCocCzSXGhZIre536QccIw=
github.com/ethereum-optimism/optimism/op-node v0.10.3/go.mod h1:fsRLXH68xaLhjfr67MPEtjCocCzSXGhZIre536QccIw=
github.com/ethereum-optimism/optimism/op-service v0.10.3 h1:gr+eVq6CzxMFqo0/9n6EoUkpumtYZEzO84gti6ekj/s=
github.com/ethereum-optimism/optimism/op-service v0.10.3 h1:gr+eVq6CzxMFqo0/9n6EoUkpumtYZEzO84gti6ekj/s=
...
...
ops/scripts/update-op-geth.py
View file @
338711c2
#!/usr/bin/env python3
#!/usr/bin/env python3
import
urllib3
import
json
import
json
import
subprocess
import
subprocess
import
os
import
os
...
@@ -11,34 +10,10 @@ GETH_VERSION='v1.10.26'
...
@@ -11,34 +10,10 @@ GETH_VERSION='v1.10.26'
def
main
():
def
main
():
for
project
in
(
'
op-service'
,
'op-node'
,
'op-proposer'
,
'op-batcher'
,
'op-bindings'
,
'op-chain-ops'
,
'op-e2e'
,
'op-wheel
'
):
for
project
in
(
'
.'
,
'op-wheel'
,
'indexer
'
):
print
(
f
'Updating {project}...'
)
print
(
f
'Updating {project}...'
)
update_mod
(
project
)
update_mod
(
project
)
# pull the replacer from one of the modules above, since
# go work edit -replace does not resolve the branch name
# into a pseudo-version.
pv
=
None
with
open
(
'./op-service/go.mod'
)
as
f
:
for
line
in
f
:
if
line
.
startswith
(
f
'replace github.com/ethereum/go-ethereum {GETH_VERSION}'
):
splits
=
line
.
split
(
' => '
)
pv
=
splits
[
1
]
.
strip
()
pv
=
pv
.
split
(
' '
)[
1
]
break
if
pv
is
None
:
raise
Exception
(
'Pseudo version not found.'
)
print
(
'Updating go.work...'
)
subprocess
.
run
([
'go'
,
'work'
,
'edit'
,
'-replace'
,
f
'github.com/ethereum/go-ethereum@{GETH_VERSION}=github.com/ethereum-optimism/op-geth@{pv}'
],
cwd
=
os
.
path
.
join
(
project
),
check
=
True
)
def
update_mod
(
project
):
def
update_mod
(
project
):
print
(
'Replacing...'
)
print
(
'Replacing...'
)
...
...
packages/contracts-bedrock/.gas-snapshot
View file @
338711c2
...
@@ -139,29 +139,30 @@ L2ERC721Bridge_Test:test_finalizeBridgeERC721_notFromRemoteMessenger_reverts() (
...
@@ -139,29 +139,30 @@ L2ERC721Bridge_Test:test_finalizeBridgeERC721_notFromRemoteMessenger_reverts() (
L2ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (gas: 16148)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (gas: 16148)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17637)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17637)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 168905)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 168905)
L2OutputOracleTest:test_computeL2Timestamp_succeeds() (gas: 37184)
L2OutputOracleTest:test_computeL2Timestamp_succeeds() (gas: 37206)
L2OutputOracleTest:test_constructor_badTimestamp_reverts() (gas: 70717)
L2OutputOracleTest:test_constructor_badTimestamp_reverts() (gas: 70767)
L2OutputOracleTest:test_constructor_succeeds() (gas: 33760)
L2OutputOracleTest:test_constructor_l2BlockTimeZero_reverts() (gas: 45786)
L2OutputOracleTest:test_deleteL2Outputs_afterLatest_reverts() (gas: 211900)
L2OutputOracleTest:test_constructor_succeeds() (gas: 33695)
L2OutputOracleTest:test_deleteL2Outputs_afterLatest_reverts() (gas: 211855)
L2OutputOracleTest:test_deleteL2Outputs_ifNotChallenger_reverts() (gas: 18883)
L2OutputOracleTest:test_deleteL2Outputs_ifNotChallenger_reverts() (gas: 18883)
L2OutputOracleTest:test_deleteL2Outputs_nonExistent_reverts() (gas: 107292)
L2OutputOracleTest:test_deleteL2Outputs_nonExistent_reverts() (gas: 107292)
L2OutputOracleTest:test_deleteOutputs_multipleOutputs_succeeds() (gas: 3021
21
)
L2OutputOracleTest:test_deleteOutputs_multipleOutputs_succeeds() (gas: 3021
43
)
L2OutputOracleTest:test_deleteOutputs_singleOutput_succeeds() (gas: 180
656
)
L2OutputOracleTest:test_deleteOutputs_singleOutput_succeeds() (gas: 180
700
)
L2OutputOracleTest:test_getL2OutputIndexAfter_multipleOutputsExist_succeeds() (gas: 267
182
)
L2OutputOracleTest:test_getL2OutputIndexAfter_multipleOutputsExist_succeeds() (gas: 267
226
)
L2OutputOracleTest:test_getL2OutputIndexAfter_noOutputsExis_reverts() (gas: 179
14
)
L2OutputOracleTest:test_getL2OutputIndexAfter_noOutputsExis_reverts() (gas: 179
36
)
L2OutputOracleTest:test_getL2OutputIndexAfter_previousBlock_succeeds() (gas: 960
86
)
L2OutputOracleTest:test_getL2OutputIndexAfter_previousBlock_succeeds() (gas: 960
42
)
L2OutputOracleTest:test_getL2OutputIndexAfter_sameBlock_succeeds() (gas: 9
5994
)
L2OutputOracleTest:test_getL2OutputIndexAfter_sameBlock_succeeds() (gas: 9
6016
)
L2OutputOracleTest:test_getL2Output_succeeds() (gas: 101
699
)
L2OutputOracleTest:test_getL2Output_succeeds() (gas: 101
721
)
L2OutputOracleTest:test_latestBlockNumber_succeeds() (gas: 969
83
)
L2OutputOracleTest:test_latestBlockNumber_succeeds() (gas: 969
60
)
L2OutputOracleTest:test_nextBlockNumber_succeeds() (gas: 174
68
)
L2OutputOracleTest:test_nextBlockNumber_succeeds() (gas: 174
90
)
L2OutputOracleTest:test_proposeL2Output_emptyOutput_reverts() (gas: 26
688
)
L2OutputOracleTest:test_proposeL2Output_emptyOutput_reverts() (gas: 26
710
)
L2OutputOracleTest:test_proposeL2Output_futureTimetamp_reverts() (gas: 286
46
)
L2OutputOracleTest:test_proposeL2Output_futureTimetamp_reverts() (gas: 286
90
)
L2OutputOracleTest:test_proposeL2Output_notProposer_reverts() (gas: 25
782
)
L2OutputOracleTest:test_proposeL2Output_notProposer_reverts() (gas: 25
826
)
L2OutputOracleTest:test_proposeL2Output_proposeAnotherOutput_succeeds() (gas: 1010
27
)
L2OutputOracleTest:test_proposeL2Output_proposeAnotherOutput_succeeds() (gas: 1010
49
)
L2OutputOracleTest:test_proposeL2Output_unexpectedBlockNumber_reverts() (gas: 28402)
L2OutputOracleTest:test_proposeL2Output_unexpectedBlockNumber_reverts() (gas: 28402)
L2OutputOracleTest:test_proposeL2Output_unmatchedBlockhash_reverts() (gas: 294
46
)
L2OutputOracleTest:test_proposeL2Output_unmatchedBlockhash_reverts() (gas: 294
02
)
L2OutputOracleTest:test_proposeL2Output_wrongFork_reverts() (gas: 29005)
L2OutputOracleTest:test_proposeL2Output_wrongFork_reverts() (gas: 29005)
L2OutputOracleTest:test_proposeWithBlockhashAndHeight_succeeds() (gas: 95
296
)
L2OutputOracleTest:test_proposeWithBlockhashAndHeight_succeeds() (gas: 95
318
)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy_succeeds() (gas: 26093)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy_succeeds() (gas: 26093)
L2OutputOracleUpgradeable_Test:test_initializeImpl_alreadyInitialized_reverts() (gas: 15149)
L2OutputOracleUpgradeable_Test:test_initializeImpl_alreadyInitialized_reverts() (gas: 15149)
L2OutputOracleUpgradeable_Test:test_initializeProxy_alreadyInitialized_reverts() (gas: 20131)
L2OutputOracleUpgradeable_Test:test_initializeProxy_alreadyInitialized_reverts() (gas: 20131)
...
...
packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol
View file @
338711c2
...
@@ -73,7 +73,7 @@ contract L2OutputOracle is Initializable, Semver {
...
@@ -73,7 +73,7 @@ contract L2OutputOracle is Initializable, Semver {
event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex);
event OutputsDeleted(uint256 indexed prevNextOutputIndex, uint256 indexed newNextOutputIndex);
/**
/**
* @custom:semver 1.
0
.0
* @custom:semver 1.
1
.0
*
*
* @param _submissionInterval Interval in blocks at which checkpoints must be submitted.
* @param _submissionInterval Interval in blocks at which checkpoints must be submitted.
* @param _l2BlockTime The time per L2 block, in seconds.
* @param _l2BlockTime The time per L2 block, in seconds.
...
@@ -89,7 +89,13 @@ contract L2OutputOracle is Initializable, Semver {
...
@@ -89,7 +89,13 @@ contract L2OutputOracle is Initializable, Semver {
uint256 _startingTimestamp,
uint256 _startingTimestamp,
address _proposer,
address _proposer,
address _challenger
address _challenger
) Semver(1, 0, 0) {
) Semver(1, 1, 0) {
require(_l2BlockTime > 0, "L2OutputOracle: L2 block time must be greater than 0");
require(
_submissionInterval > _l2BlockTime,
"L2OutputOracle: submission interval must be greater than L2 block time"
);
SUBMISSION_INTERVAL = _submissionInterval;
SUBMISSION_INTERVAL = _submissionInterval;
L2_BLOCK_TIME = _l2BlockTime;
L2_BLOCK_TIME = _l2BlockTime;
PROPOSER = _proposer;
PROPOSER = _proposer;
...
...
packages/contracts-bedrock/contracts/libraries/Predeploys.sol
View file @
338711c2
...
@@ -104,4 +104,9 @@ library Predeploys {
...
@@ -104,4 +104,9 @@ library Predeploys {
* @notice Address of the L1FeeVault predeploy.
* @notice Address of the L1FeeVault predeploy.
*/
*/
address internal constant L1_FEE_VAULT = 0x420000000000000000000000000000000000001A;
address internal constant L1_FEE_VAULT = 0x420000000000000000000000000000000000001A;
/**
* @notice Address of the GovernanceToken predeploy.
*/
address internal constant GOVERNANCE_TOKEN = 0x4200000000000000000000000000000000000042;
}
}
packages/contracts-bedrock/contracts/test/L2OutputOracle.t.sol
View file @
338711c2
...
@@ -44,6 +44,40 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
...
@@ -44,6 +44,40 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
);
);
}
}
function test_constructor_l2BlockTimeZero_reverts() external {
vm.expectRevert("L2OutputOracle: L2 block time must be greater than 0");
new L2OutputOracle(
submissionInterval,
0,
startingBlockNumber,
block.timestamp,
proposer,
owner
);
}
function testFuzz_constructor_submissionIntervalLteL2BlockTime_reverts(
uint256 _submissionInterval,
uint256 _l2BlockTime
) external {
// Bound the _l2blockTime to be in the range of [1, type(uint256).max]
_l2BlockTime = bound(_l2BlockTime, 1, type(uint256).max);
// Roll the block number to _l2blockTime (the starting L2 timestamp must be less than or equal to the current time)
vm.roll(_l2BlockTime);
// Bound _submissionInterval to be less than or equal to _l2BlockTime
_submissionInterval = bound(_submissionInterval, 0, _l2BlockTime);
vm.expectRevert("L2OutputOracle: submission interval must be greater than L2 block time");
new L2OutputOracle(
_submissionInterval,
_l2BlockTime,
startingBlockNumber,
block.timestamp,
proposer,
owner
);
}
/****************
/****************
* Getter Tests *
* Getter Tests *
****************/
****************/
...
...
packages/contracts-bedrock/deploy-config/getting-started.json
0 → 100644
View file @
338711c2
{
"numDeployConfirmations"
:
1
,
"finalSystemOwner"
:
"ADMIN"
,
"controller"
:
"ADMIN"
,
"l1StartingBlockTag"
:
"BLOCKHASH"
,
"l1ChainID"
:
5
,
"l2ChainID"
:
42069
,
"l2BlockTime"
:
2
,
"maxSequencerDrift"
:
600
,
"sequencerWindowSize"
:
3600
,
"channelTimeout"
:
300
,
"p2pSequencerAddress"
:
"SEQUENCER"
,
"batchInboxAddress"
:
"0xff00000000000000000000000000000000042069"
,
"batchSenderAddress"
:
"BATCHER"
,
"l2OutputOracleSubmissionInterval"
:
120
,
"l2OutputOracleStartingBlockNumber"
:
0
,
"l2OutputOracleStartingTimestamp"
:
"TIMESTAMP"
,
"l2OutputOracleProposer"
:
"PROPOSER"
,
"l2OutputOracleChallenger"
:
"ADMIN"
,
"finalizationPeriodSeconds"
:
12
,
"proxyAdminOwner"
:
"ADMIN"
,
"baseFeeVaultRecipient"
:
"ADMIN"
,
"l1FeeVaultRecipient"
:
"ADMIN"
,
"sequencerFeeVaultRecipient"
:
"ADMIN"
,
"gasPriceOracleOverhead"
:
2100
,
"gasPriceOracleScalar"
:
1000000
,
"governanceTokenSymbol"
:
"OP"
,
"governanceTokenName"
:
"Optimism"
,
"governanceTokenOwner"
:
"ADMIN"
,
"l2GenesisBlockGasLimit"
:
"0x17D7840"
,
"l2GenesisBlockBaseFeePerGas"
:
"0x3b9aca00"
,
"eip1559Denominator"
:
50
,
"eip1559Elasticity"
:
10
}
packages/contracts-bedrock/deploy-config/getting-started.ts
0 → 100644
View file @
338711c2
import
{
DeployConfig
}
from
'
../src/deploy-config
'
import
config
from
'
./getting-started.json
'
export
default
config
satisfies
DeployConfig
packages/contracts-bedrock/deploy/012-L2OutputOracleImpl.ts
View file @
338711c2
...
@@ -5,6 +5,19 @@ import '@nomiclabs/hardhat-ethers'
...
@@ -5,6 +5,19 @@ import '@nomiclabs/hardhat-ethers'
import
{
assertContractVariable
,
deploy
}
from
'
../src/deploy-utils
'
import
{
assertContractVariable
,
deploy
}
from
'
../src/deploy-utils
'
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
const
deployFn
:
DeployFunction
=
async
(
hre
)
=>
{
if
(
hre
.
deployConfig
.
l2BlockTime
===
0
)
{
throw
new
Error
(
'
L2OutputOracle deployment: l2BlockTime must be greater than 0
'
)
}
else
if
(
hre
.
deployConfig
.
l2OutputOracleSubmissionInterval
<=
hre
.
deployConfig
.
l2BlockTime
)
{
throw
new
Error
(
'
L2OutputOracle deployment: submissionInterval must be greater than the l2BlockTime
'
)
}
await
deploy
({
await
deploy
({
hre
,
hre
,
name
:
'
L2OutputOracle
'
,
name
:
'
L2OutputOracle
'
,
...
...
packages/contracts-bedrock/hardhat.config.ts
View file @
338711c2
...
@@ -84,6 +84,12 @@ const config: HardhatUserConfig = {
...
@@ -84,6 +84,12 @@ const config: HardhatUserConfig = {
accounts
:
[
process
.
env
.
PRIVATE_KEY_DEPLOYER
||
ethers
.
constants
.
HashZero
],
accounts
:
[
process
.
env
.
PRIVATE_KEY_DEPLOYER
||
ethers
.
constants
.
HashZero
],
live
:
true
,
live
:
true
,
},
},
'
getting-started
'
:
{
chainId
:
5
,
url
:
process
.
env
.
L1_RPC
||
''
,
accounts
:
[
process
.
env
.
PRIVATE_KEY_DEPLOYER
||
ethers
.
constants
.
HashZero
],
live
:
true
,
},
},
},
foundry
:
{
foundry
:
{
buildInfo
:
true
,
buildInfo
:
true
,
...
...
packages/contracts-bedrock/package.json
View file @
338711c2
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
"build:forge"
:
"forge build"
,
"build:forge"
:
"forge build"
,
"build:with-metadata"
:
"FOUNDRY_PROFILE=echidna yarn build:forge"
,
"build:with-metadata"
:
"FOUNDRY_PROFILE=echidna yarn build:forge"
,
"build:differential"
:
"tsc scripts/differential-testing.ts --outDir dist --moduleResolution node --esModuleInterop"
,
"build:differential"
:
"tsc scripts/differential-testing.ts --outDir dist --moduleResolution node --esModuleInterop"
,
"build:fuzz"
:
"
go build -o test-case-generator test-case-generator/cmd/fuzz.go
"
,
"build:fuzz"
:
"
(cd test-case-generator && go build ./cmd/fuzz.go)
"
,
"prebuild"
:
"yarn ts-node scripts/verify-foundry-install.ts"
,
"prebuild"
:
"yarn ts-node scripts/verify-foundry-install.ts"
,
"build"
:
"hardhat compile && yarn autogen:artifacts && yarn build:ts && yarn typechain"
,
"build"
:
"hardhat compile && yarn autogen:artifacts && yarn build:ts && yarn typechain"
,
"build:ts"
:
"tsc -p tsconfig.build.json"
,
"build:ts"
:
"tsc -p tsconfig.build.json"
,
...
...
specs/rollup-node-p2p.md
View file @
338711c2
...
@@ -211,7 +211,7 @@ GossipSub [parameters][gossip-parameters]:
...
@@ -211,7 +211,7 @@ GossipSub [parameters][gossip-parameters]:
-
`fanout_ttl`
(ttl for fanout maps for topics we are not subscribed to but have published to, in seconds): 24
-
`fanout_ttl`
(ttl for fanout maps for topics we are not subscribed to but have published to, in seconds): 24
-
`mcache_len`
(number of windows to retain full messages in cache for
`IWANT`
responses): 12
-
`mcache_len`
(number of windows to retain full messages in cache for
`IWANT`
responses): 12
-
`mcache_gossip`
(number of windows to gossip about): 3
-
`mcache_gossip`
(number of windows to gossip about): 3
-
`seen_ttl`
(number of heartbeat intervals to retain message IDs):
80 (= 40
seconds)
-
`seen_ttl`
(number of heartbeat intervals to retain message IDs):
130 (= 65
seconds)
Notable differences from L1 consensus (Eth2):
Notable differences from L1 consensus (Eth2):
...
...
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