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
bc4a1550
Unverified
Commit
bc4a1550
authored
Sep 09, 2022
by
Mark Tyneway
Committed by
GitHub
Sep 09, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into fix/l2-geth-estimate-gas-blocktag
parents
c3e66e57
df53a157
Changes
46
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
408 additions
and
139 deletions
+408
-139
fifty-badgers-behave.md
.changeset/fifty-badgers-behave.md
+5
-0
mighty-eagles-remember.md
.changeset/mighty-eagles-remember.md
+5
-0
go.work
go.work
+1
-1
db.go
indexer/db/db.go
+2
-2
go.mod
op-batcher/go.mod
+5
-5
go.sum
op-batcher/go.sum
+10
-10
go.mod
op-bindings/go.mod
+2
-2
go.sum
op-bindings/go.sum
+2
-2
config.go
op-chain-ops/genesis/config.go
+5
-0
genesis.go
op-chain-ops/genesis/genesis.go
+14
-3
layer_two.go
op-chain-ops/genesis/layer_two.go
+3
-1
layer_two_test.go
op-chain-ops/genesis/layer_two_test.go
+21
-0
test-deploy-config-devnet-l1.json
...in-ops/genesis/testdata/test-deploy-config-devnet-l1.json
+2
-1
test-deploy-config-full.json
op-chain-ops/genesis/testdata/test-deploy-config-full.json
+4
-1
go.mod
op-chain-ops/go.mod
+1
-1
go.sum
op-chain-ops/go.sum
+2
-2
go.mod
op-e2e/go.mod
+6
-6
go.sum
op-e2e/go.sum
+12
-12
setup.go
op-e2e/setup.go
+4
-2
go.mod
op-node/go.mod
+3
-3
go.sum
op-node/go.sum
+6
-6
go.mod
op-proposer/go.mod
+4
-4
go.sum
op-proposer/go.sum
+8
-8
go.mod
op-service/go.mod
+1
-1
go.sum
op-service/go.sum
+2
-2
devnetL1.json
packages/contracts-bedrock/deploy-config/devnetL1.json
+2
-1
L1ERC721Bridge.sol
packages/contracts-periphery/contracts/L1/L1ERC721Bridge.sol
+1
-1
L2ERC721Bridge.sol
packages/contracts-periphery/contracts/L2/L2ERC721Bridge.sol
+1
-1
.gitignore
packages/contracts/.gitignore
+5
-0
package.json
packages/contracts/package.json
+3
-7
package.json
packages/core-utils/package.json
+10
-2
bn.ts
packages/core-utils/src/common/bn.ts
+6
-5
hex-strings.ts
packages/core-utils/src/common/hex-strings.ts
+5
-4
test-utils.ts
packages/core-utils/src/common/test-utils.ts
+1
-1
fallback-provider.ts
packages/core-utils/src/external/ethers/fallback-provider.ts
+9
-6
alias.ts
packages/core-utils/src/optimism/alias.ts
+6
-5
batch-encoding.ts
packages/core-utils/src/optimism/batch-encoding.ts
+6
-6
deposit-transaction.ts
packages/core-utils/src/optimism/deposit-transaction.ts
+19
-16
encoding.ts
packages/core-utils/src/optimism/encoding.ts
+3
-2
fees.ts
packages/core-utils/src/optimism/fees.ts
+1
-1
hashing.ts
packages/core-utils/src/optimism/hashing.ts
+3
-2
op-provider.ts
packages/core-utils/src/optimism/op-provider.ts
+1
-1
fees.spec.ts
packages/core-utils/test/fees.spec.ts
+1
-1
hex-utils.spec.ts
packages/core-utils/test/hex-utils.spec.ts
+1
-1
errors.go
proxyd/errors.go
+1
-1
yarn.lock
yarn.lock
+193
-0
No files found.
.changeset/fifty-badgers-behave.md
0 → 100644
View file @
bc4a1550
---
'
@eth-optimism/contracts-periphery'
:
patch
---
Fixes import paths in the contracts-periphery package
.changeset/mighty-eagles-remember.md
0 → 100644
View file @
bc4a1550
---
'
@eth-optimism/core-utils'
:
minor
---
Removes ethers as a dependency in favor of individual ethers sub-packages
go.work
View file @
bc4a1550
...
@@ -19,7 +19,7 @@ use (
...
@@ -19,7 +19,7 @@ use (
./teleportr
./teleportr
)
)
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
// For local debugging:
// For local debugging:
//replace github.com/ethereum/go-ethereum v1.10.23 => ../go-ethereum
//replace github.com/ethereum/go-ethereum v1.10.23 => ../go-ethereum
indexer/db/db.go
View file @
bc4a1550
...
@@ -658,7 +658,7 @@ WHERE address = $1
...
@@ -658,7 +658,7 @@ WHERE address = $1
func
(
d
*
Database
)
GetAirdrop
(
address
common
.
Address
)
(
*
Airdrop
,
error
)
{
func
(
d
*
Database
)
GetAirdrop
(
address
common
.
Address
)
(
*
Airdrop
,
error
)
{
row
:=
d
.
db
.
QueryRow
(
getAirdropQuery
,
strings
.
ToLower
(
address
.
String
()))
row
:=
d
.
db
.
QueryRow
(
getAirdropQuery
,
strings
.
ToLower
(
address
.
String
()))
if
row
.
Err
()
!=
nil
{
if
row
.
Err
()
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"error getting airdrop: %
v
"
,
row
.
Err
())
return
nil
,
fmt
.
Errorf
(
"error getting airdrop: %
w
"
,
row
.
Err
())
}
}
airdrop
:=
new
(
Airdrop
)
airdrop
:=
new
(
Airdrop
)
...
@@ -677,7 +677,7 @@ func (d *Database) GetAirdrop(address common.Address) (*Airdrop, error) {
...
@@ -677,7 +677,7 @@ func (d *Database) GetAirdrop(address common.Address) (*Airdrop, error) {
return
nil
,
nil
return
nil
,
nil
}
}
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"error scanning airdrop: %
v
"
,
err
)
return
nil
,
fmt
.
Errorf
(
"error scanning airdrop: %
w
"
,
err
)
}
}
return
airdrop
,
nil
return
airdrop
,
nil
}
}
op-batcher/go.mod
View file @
bc4a1550
...
@@ -3,9 +3,9 @@ module github.com/ethereum-optimism/optimism/op-batcher
...
@@ -3,9 +3,9 @@ module github.com/ethereum-optimism/optimism/op-batcher
go 1.18
go 1.18
require (
require (
github.com/ethereum-optimism/optimism/op-node v0.8.
3
github.com/ethereum-optimism/optimism/op-node v0.8.
6
github.com/ethereum-optimism/optimism/op-proposer v0.8.
3
github.com/ethereum-optimism/optimism/op-proposer v0.8.
6
github.com/ethereum-optimism/optimism/op-service v0.8.
3
github.com/ethereum-optimism/optimism/op-service v0.8.
6
github.com/ethereum/go-ethereum v1.10.23
github.com/ethereum/go-ethereum v1.10.23
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
github.com/urfave/cli v1.22.9
github.com/urfave/cli v1.22.9
...
@@ -22,7 +22,7 @@ require (
...
@@ -22,7 +22,7 @@ require (
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3
// indirect
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6
// indirect
github.com/fjl/memsize v0.0.1 // indirect
github.com/fjl/memsize v0.0.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/go-stack/stack v1.8.1 // indirect
...
@@ -70,4 +70,4 @@ require (
...
@@ -70,4 +70,4 @@ require (
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
)
)
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
op-batcher/go.sum
View file @
bc4a1550
...
@@ -147,16 +147,16 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
...
@@ -147,16 +147,16 @@ 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-2022090
7143004-2aacc679d638 h1:LcvgHjeooGBobfEIEYikMzx1MoIAjRqa/ZDdkrhV3Hw
=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1 h1:W/ZU6BZH7ilTrpdoJOF9N4OReqXbpeRtUB6klIpEdMA
=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3 h1:6v3n0fZhxcqVF9mu8l2Axqi4/XcMqpthtl3mEkqhi04
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6 h1:jJYhmygt7hqGzYa+8sme9SdnKt1c3Y6EbWgIrRONoxw
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3/go.mod h1:XZRKu/LTd03m50duwMFEqCWe6qkjgLBZUoZG3CR2Kg0
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6/go.mod h1:gUX5317IAvRMjB4GftayM87JVln3DTqukfirwJpEWnE
=
github.com/ethereum-optimism/optimism/op-node v0.8.
3 h1:Snuick9EtalM6Cbs8rVUcoCDPFpu6Xxr7kre+RbLbY0
=
github.com/ethereum-optimism/optimism/op-node v0.8.
6 h1:xNwN+Q/Rt17vSKawhBeG9qTcqcyh8JU8PGjK1iuGkF4
=
github.com/ethereum-optimism/optimism/op-node v0.8.
3/go.mod h1:CPa18cq3E41eqwpsohX/QkupY11D3CYsNqbKZD6H860
=
github.com/ethereum-optimism/optimism/op-node v0.8.
6/go.mod h1:gkyzgVHV3+tIhLZ8GhT+bL9GrrmouQCW4mKYukS0SHg
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
3 h1:e0Dv4/lGXWW2hMLYmL7nQNIv7Um0SlnMicz5VAJwMKc
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
6 h1:iy8XAtkvrURBy3TT2Lf540cbWztxit7K4+BghZ4IsMI
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
3/go.mod h1:JIC833mF7Fl8pNe5yNbbPsUKx6o3793OC7dxWhY6Mbs
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
6/go.mod h1:tuCLnXcO4MrtVyis1Yfo7wtL8EQta1u6zFdzHHj+RAc
=
github.com/ethereum-optimism/optimism/op-service v0.8.
3 h1:eNiNir1/a5nVzs08tuq6+A3d0doB15qPO17YozKZhzQ
=
github.com/ethereum-optimism/optimism/op-service v0.8.
6 h1:ruZp/BxL8TGn1y9EJmygypPTeVAFlAA0A/h8LsCoV+M
=
github.com/ethereum-optimism/optimism/op-service v0.8.
3/go.mod h1:TGUsHYIx5jwCZgvj1taNtTEhJsJNIwRvZ0noDXTdb4c
=
github.com/ethereum-optimism/optimism/op-service v0.8.
6/go.mod h1:gm8YNzERrL/CHBPWx3+01mR/NOVpLLw4GEUSnnTdyFU
=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
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.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
...
...
op-bindings/go.mod
View file @
bc4a1550
...
@@ -40,6 +40,6 @@ require (
...
@@ -40,6 +40,6 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
)
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
// github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
// github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
op-bindings/go.sum
View file @
bc4a1550
...
@@ -28,8 +28,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1
...
@@ -28,8 +28,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw=
github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638 h1:LcvgHjeooGBobfEIEYikMzx1MoIAjRqa/ZDdkrhV3Hw
=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1 h1:W/ZU6BZH7ilTrpdoJOF9N4OReqXbpeRtUB6klIpEdMA
=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
...
...
op-chain-ops/genesis/config.go
View file @
bc4a1550
...
@@ -69,6 +69,11 @@ type DeployConfig struct {
...
@@ -69,6 +69,11 @@ type DeployConfig struct {
GasPriceOracleDecimals
uint
`json:"gasPriceOracleDecimals"`
GasPriceOracleDecimals
uint
`json:"gasPriceOracleDecimals"`
DeploymentWaitConfirmations
int
`json:"deploymentWaitConfirmations"`
DeploymentWaitConfirmations
int
`json:"deploymentWaitConfirmations"`
EIP1559Elasticity
uint64
`json:"eip1559Elasticity"`
EIP1559Denominator
uint64
`json:"eip1559Denominator"`
FundDevAccounts
bool
`json:"fundDevAccounts"`
}
}
// NewDeployConfig reads a config file given a path on the filesystem.
// NewDeployConfig reads a config file given a path on the filesystem.
...
...
op-chain-ops/genesis/genesis.go
View file @
bc4a1550
...
@@ -20,6 +20,15 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
...
@@ -20,6 +20,15 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
return
nil
,
errors
.
New
(
"must define L2 ChainID"
)
return
nil
,
errors
.
New
(
"must define L2 ChainID"
)
}
}
eip1559Denom
:=
config
.
EIP1559Denominator
if
eip1559Denom
==
0
{
eip1559Denom
=
50
}
eip1559Elasticity
:=
config
.
EIP1559Elasticity
if
eip1559Elasticity
==
0
{
eip1559Elasticity
=
10
}
optimismChainConfig
:=
params
.
ChainConfig
{
optimismChainConfig
:=
params
.
ChainConfig
{
ChainID
:
new
(
big
.
Int
)
.
SetUint64
(
config
.
L2ChainID
),
ChainID
:
new
(
big
.
Int
)
.
SetUint64
(
config
.
L2ChainID
),
HomesteadBlock
:
big
.
NewInt
(
0
),
HomesteadBlock
:
big
.
NewInt
(
0
),
...
@@ -44,8 +53,10 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
...
@@ -44,8 +53,10 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
TerminalTotalDifficulty
:
big
.
NewInt
(
0
),
TerminalTotalDifficulty
:
big
.
NewInt
(
0
),
TerminalTotalDifficultyPassed
:
true
,
TerminalTotalDifficultyPassed
:
true
,
Optimism
:
&
params
.
OptimismConfig
{
Optimism
:
&
params
.
OptimismConfig
{
BaseFeeRecipient
:
config
.
OptimismBaseFeeRecipient
,
BaseFeeRecipient
:
config
.
OptimismBaseFeeRecipient
,
L1FeeRecipient
:
config
.
OptimismL2FeeRecipient
,
L1FeeRecipient
:
config
.
OptimismL2FeeRecipient
,
EIP1559Denominator
:
eip1559Denom
,
EIP1559Elasticity
:
eip1559Elasticity
,
},
},
}
}
...
@@ -63,7 +74,7 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
...
@@ -63,7 +74,7 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
}
}
difficulty
:=
config
.
L2GenesisBlockDifficulty
difficulty
:=
config
.
L2GenesisBlockDifficulty
if
difficulty
==
nil
{
if
difficulty
==
nil
{
difficulty
=
newHexBig
(
1
)
difficulty
=
newHexBig
(
0
)
}
}
return
&
core
.
Genesis
{
return
&
core
.
Genesis
{
...
...
op-chain-ops/genesis/layer_two.go
View file @
bc4a1550
...
@@ -24,7 +24,9 @@ func BuildL2DeveloperGenesis(config *DeployConfig, l1StartBlock *types.Block, l2
...
@@ -24,7 +24,9 @@ func BuildL2DeveloperGenesis(config *DeployConfig, l1StartBlock *types.Block, l2
db
:=
state
.
NewMemoryStateDB
(
genspec
)
db
:=
state
.
NewMemoryStateDB
(
genspec
)
FundDevAccounts
(
db
)
if
config
.
FundDevAccounts
{
FundDevAccounts
(
db
)
}
SetPrecompileBalances
(
db
)
SetPrecompileBalances
(
db
)
return
BuildL2Genesis
(
db
,
config
,
l1StartBlock
,
l2Addrs
)
return
BuildL2Genesis
(
db
,
config
,
l1StartBlock
,
l2Addrs
)
...
...
op-chain-ops/genesis/layer_two_test.go
View file @
bc4a1550
...
@@ -77,9 +77,30 @@ func TestBuildL2DeveloperGenesis(t *testing.T) {
...
@@ -77,9 +77,30 @@ func TestBuildL2DeveloperGenesis(t *testing.T) {
require
.
Equal
(
t
,
adminSlot
,
proxyAdmin
.
Address
.
Hash
())
require
.
Equal
(
t
,
adminSlot
,
proxyAdmin
.
Address
.
Hash
())
require
.
Equal
(
t
,
account
.
Code
,
depB
)
require
.
Equal
(
t
,
account
.
Code
,
depB
)
}
}
require
.
Equal
(
t
,
2337
,
len
(
gen
.
Alloc
))
if
writeFile
{
if
writeFile
{
file
,
_
:=
json
.
MarshalIndent
(
gen
,
""
,
" "
)
file
,
_
:=
json
.
MarshalIndent
(
gen
,
""
,
" "
)
_
=
os
.
WriteFile
(
"genesis.json"
,
file
,
0644
)
_
=
os
.
WriteFile
(
"genesis.json"
,
file
,
0644
)
}
}
}
}
func
TestBuildL2DeveloperGenesisDevAccountsFunding
(
t
*
testing
.
T
)
{
config
,
err
:=
genesis
.
NewDeployConfig
(
"./testdata/test-deploy-config-devnet-l1.json"
)
require
.
Nil
(
t
,
err
)
config
.
FundDevAccounts
=
false
backend
:=
backends
.
NewSimulatedBackend
(
core
.
GenesisAlloc
{
crypto
.
PubkeyToAddress
(
testKey
.
PublicKey
)
:
{
Balance
:
big
.
NewInt
(
10000000000000000
)},
},
15000000
,
)
block
,
err
:=
backend
.
BlockByNumber
(
context
.
Background
(),
common
.
Big0
)
require
.
NoError
(
t
,
err
)
gen
,
err
:=
genesis
.
BuildL2DeveloperGenesis
(
config
,
block
,
&
genesis
.
L2Addresses
{
ProxyAdmin
:
common
.
Address
{},
})
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
2316
,
len
(
gen
.
Alloc
))
}
op-chain-ops/genesis/testdata/test-deploy-config-devnet-l1.json
View file @
bc4a1550
...
@@ -23,5 +23,6 @@
...
@@ -23,5 +23,6 @@
"optimismBaseFeeRecipient"
:
"0xBcd4042DE499D14e55001CcbB24a551F3b954096"
,
"optimismBaseFeeRecipient"
:
"0xBcd4042DE499D14e55001CcbB24a551F3b954096"
,
"optimismL1FeeRecipient"
:
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788"
,
"optimismL1FeeRecipient"
:
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788"
,
"deploymentWaitConfirmations"
:
1
"deploymentWaitConfirmations"
:
1
,
"fundDevAccounts"
:
true
}
}
op-chain-ops/genesis/testdata/test-deploy-config-full.json
View file @
bc4a1550
...
@@ -45,5 +45,8 @@
...
@@ -45,5 +45,8 @@
"gasPriceOracleOverhead"
:
2100
,
"gasPriceOracleOverhead"
:
2100
,
"gasPriceOracleScalar"
:
1000000
,
"gasPriceOracleScalar"
:
1000000
,
"gasPriceOracleDecimals"
:
6
,
"gasPriceOracleDecimals"
:
6
,
"deploymentWaitConfirmations"
:
1
"deploymentWaitConfirmations"
:
1
,
"eip1559Denominator"
:
8
,
"eip1559Elasticity"
:
2
,
"fundDevAccounts"
:
true
}
}
\ No newline at end of file
op-chain-ops/go.mod
View file @
bc4a1550
...
@@ -4,7 +4,7 @@ go 1.18
...
@@ -4,7 +4,7 @@ go 1.18
require (
require (
github.com/ethereum-optimism/optimism/l2geth v0.0.0-20220820030939-de38b6f6f77e
github.com/ethereum-optimism/optimism/l2geth v0.0.0-20220820030939-de38b6f6f77e
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6
github.com/ethereum/go-ethereum v1.10.23
github.com/ethereum/go-ethereum v1.10.23
github.com/mattn/go-isatty v0.0.14
github.com/mattn/go-isatty v0.0.14
github.com/stretchr/testify v1.8.0
github.com/stretchr/testify v1.8.0
...
...
op-chain-ops/go.sum
View file @
bc4a1550
...
@@ -174,8 +174,8 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
...
@@ -174,8 +174,8 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
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/optimism/l2geth v0.0.0-20220820030939-de38b6f6f77e h1:LUfy9ofKcen9Cm1T9JyGNnrPLR2AmyelFbohS6bs4X8=
github.com/ethereum-optimism/optimism/l2geth v0.0.0-20220820030939-de38b6f6f77e h1:LUfy9ofKcen9Cm1T9JyGNnrPLR2AmyelFbohS6bs4X8=
github.com/ethereum-optimism/optimism/l2geth v0.0.0-20220820030939-de38b6f6f77e/go.mod h1:Oj5A6Qs/Ao1SP17i3uKroyhz49q/ehagSXRAlvwaI5Y=
github.com/ethereum-optimism/optimism/l2geth v0.0.0-20220820030939-de38b6f6f77e/go.mod h1:Oj5A6Qs/Ao1SP17i3uKroyhz49q/ehagSXRAlvwaI5Y=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3 h1:6v3n0fZhxcqVF9mu8l2Axqi4/XcMqpthtl3mEkqhi04
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6 h1:jJYhmygt7hqGzYa+8sme9SdnKt1c3Y6EbWgIrRONoxw
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3/go.mod h1:XZRKu/LTd03m50duwMFEqCWe6qkjgLBZUoZG3CR2Kg0
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6/go.mod h1:gUX5317IAvRMjB4GftayM87JVln3DTqukfirwJpEWnE
=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/ethereum/go-ethereum v1.10.16/go.mod h1:Anj6cxczl+AHy63o4X9O8yWNHuN5wMpfb8MAnHkWn7Y=
github.com/ethereum/go-ethereum v1.10.16/go.mod h1:Anj6cxczl+AHy63o4X9O8yWNHuN5wMpfb8MAnHkWn7Y=
github.com/ethereum/go-ethereum v1.10.23 h1:Xk8XAT4/UuqcjMLIMF+7imjkg32kfVFKoeyQDaO2yWM=
github.com/ethereum/go-ethereum v1.10.23 h1:Xk8XAT4/UuqcjMLIMF+7imjkg32kfVFKoeyQDaO2yWM=
...
...
op-e2e/go.mod
View file @
bc4a1550
...
@@ -3,11 +3,11 @@ module github.com/ethereum-optimism/optimism/op-e2e
...
@@ -3,11 +3,11 @@ module github.com/ethereum-optimism/optimism/op-e2e
go 1.18
go 1.18
require (
require (
github.com/ethereum-optimism/optimism/op-batcher v0.8.
3
github.com/ethereum-optimism/optimism/op-batcher v0.8.
6
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6
github.com/ethereum-optimism/optimism/op-node v0.8.
3
github.com/ethereum-optimism/optimism/op-node v0.8.
6
github.com/ethereum-optimism/optimism/op-proposer v0.8.
3
github.com/ethereum-optimism/optimism/op-proposer v0.8.
6
github.com/ethereum-optimism/optimism/op-service v0.8.
3
github.com/ethereum-optimism/optimism/op-service v0.8.
6
github.com/ethereum/go-ethereum v1.10.23
github.com/ethereum/go-ethereum v1.10.23
github.com/libp2p/go-libp2p v0.21.0
github.com/libp2p/go-libp2p v0.21.0
github.com/libp2p/go-libp2p-core v0.19.1
github.com/libp2p/go-libp2p-core v0.19.1
...
@@ -155,4 +155,4 @@ require (
...
@@ -155,4 +155,4 @@ require (
lukechampine.com/blake3 v1.1.7 // indirect
lukechampine.com/blake3 v1.1.7 // indirect
)
)
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
op-e2e/go.sum
View file @
bc4a1550
...
@@ -239,18 +239,18 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
...
@@ -239,18 +239,18 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
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-2022090
7143004-2aacc679d638 h1:LcvgHjeooGBobfEIEYikMzx1MoIAjRqa/ZDdkrhV3Hw
=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1 h1:W/ZU6BZH7ilTrpdoJOF9N4OReqXbpeRtUB6klIpEdMA
=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/optimism/op-batcher v0.8.
3 h1:lvfftznzMtFpemnq1p+qpciAPhYDHhUqmGbIjmgHToA
=
github.com/ethereum-optimism/optimism/op-batcher v0.8.
6 h1:phRqDO8qUIzJzRYt4+ZivSQx4gENeVcTiHY7wj4TnN4
=
github.com/ethereum-optimism/optimism/op-batcher v0.8.
3/go.mod h1:Pu/fg1usqSGim0lA+/QbZdL21dAH0ng1YQoFEw8DTY0
=
github.com/ethereum-optimism/optimism/op-batcher v0.8.
6/go.mod h1:Ghz9Ilox6Ca5TjJAroZVheCleE5a/Ek4qjlW1yULb+A
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3 h1:6v3n0fZhxcqVF9mu8l2Axqi4/XcMqpthtl3mEkqhi04
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6 h1:jJYhmygt7hqGzYa+8sme9SdnKt1c3Y6EbWgIrRONoxw
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3/go.mod h1:XZRKu/LTd03m50duwMFEqCWe6qkjgLBZUoZG3CR2Kg0
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6/go.mod h1:gUX5317IAvRMjB4GftayM87JVln3DTqukfirwJpEWnE
=
github.com/ethereum-optimism/optimism/op-node v0.8.
3 h1:Snuick9EtalM6Cbs8rVUcoCDPFpu6Xxr7kre+RbLbY0
=
github.com/ethereum-optimism/optimism/op-node v0.8.
6 h1:xNwN+Q/Rt17vSKawhBeG9qTcqcyh8JU8PGjK1iuGkF4
=
github.com/ethereum-optimism/optimism/op-node v0.8.
3/go.mod h1:CPa18cq3E41eqwpsohX/QkupY11D3CYsNqbKZD6H860
=
github.com/ethereum-optimism/optimism/op-node v0.8.
6/go.mod h1:gkyzgVHV3+tIhLZ8GhT+bL9GrrmouQCW4mKYukS0SHg
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
3 h1:e0Dv4/lGXWW2hMLYmL7nQNIv7Um0SlnMicz5VAJwMKc
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
6 h1:iy8XAtkvrURBy3TT2Lf540cbWztxit7K4+BghZ4IsMI
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
3/go.mod h1:JIC833mF7Fl8pNe5yNbbPsUKx6o3793OC7dxWhY6Mbs
=
github.com/ethereum-optimism/optimism/op-proposer v0.8.
6/go.mod h1:tuCLnXcO4MrtVyis1Yfo7wtL8EQta1u6zFdzHHj+RAc
=
github.com/ethereum-optimism/optimism/op-service v0.8.
3 h1:eNiNir1/a5nVzs08tuq6+A3d0doB15qPO17YozKZhzQ
=
github.com/ethereum-optimism/optimism/op-service v0.8.
6 h1:ruZp/BxL8TGn1y9EJmygypPTeVAFlAA0A/h8LsCoV+M
=
github.com/ethereum-optimism/optimism/op-service v0.8.
3/go.mod h1:TGUsHYIx5jwCZgvj1taNtTEhJsJNIwRvZ0noDXTdb4c
=
github.com/ethereum-optimism/optimism/op-service v0.8.
6/go.mod h1:gm8YNzERrL/CHBPWx3+01mR/NOVpLLw4GEUSnnTdyFU
=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
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.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
...
...
op-e2e/setup.go
View file @
bc4a1550
...
@@ -281,8 +281,10 @@ func (cfg SystemConfig) start() (*System, error) {
...
@@ -281,8 +281,10 @@ func (cfg SystemConfig) start() (*System, error) {
MergeNetsplitBlock
:
common
.
Big0
,
MergeNetsplitBlock
:
common
.
Big0
,
TerminalTotalDifficulty
:
common
.
Big0
,
TerminalTotalDifficulty
:
common
.
Big0
,
Optimism
:
&
params
.
OptimismConfig
{
Optimism
:
&
params
.
OptimismConfig
{
BaseFeeRecipient
:
cfg
.
BaseFeeRecipient
,
BaseFeeRecipient
:
cfg
.
BaseFeeRecipient
,
L1FeeRecipient
:
cfg
.
L1FeeRecipient
,
L1FeeRecipient
:
cfg
.
L1FeeRecipient
,
EIP1559Elasticity
:
2
,
EIP1559Denominator
:
8
,
},
},
},
},
Alloc
:
l2Alloc
,
Alloc
:
l2Alloc
,
...
...
op-node/go.mod
View file @
bc4a1550
...
@@ -5,8 +5,8 @@ go 1.18
...
@@ -5,8 +5,8 @@ go 1.18
require (
require (
github.com/btcsuite/btcd/btcec/v2 v2.2.0
github.com/btcsuite/btcd/btcec/v2 v2.2.0
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
3
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
6
github.com/ethereum/go-ethereum v1.10.23
github.com/ethereum/go-ethereum v1.10.23
github.com/golang/snappy v0.0.4
github.com/golang/snappy v0.0.4
github.com/google/go-cmp v0.5.8
github.com/google/go-cmp v0.5.8
...
@@ -159,4 +159,4 @@ require (
...
@@ -159,4 +159,4 @@ require (
lukechampine.com/blake3 v1.1.7 // indirect
lukechampine.com/blake3 v1.1.7 // indirect
)
)
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
op-node/go.sum
View file @
bc4a1550
...
@@ -188,12 +188,12 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
...
@@ -188,12 +188,12 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
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-2022090
7143004-2aacc679d638 h1:LcvgHjeooGBobfEIEYikMzx1MoIAjRqa/ZDdkrhV3Hw
=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1 h1:W/ZU6BZH7ilTrpdoJOF9N4OReqXbpeRtUB6klIpEdMA
=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3 h1:6v3n0fZhxcqVF9mu8l2Axqi4/XcMqpthtl3mEkqhi04
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6 h1:jJYhmygt7hqGzYa+8sme9SdnKt1c3Y6EbWgIrRONoxw
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3/go.mod h1:XZRKu/LTd03m50duwMFEqCWe6qkjgLBZUoZG3CR2Kg0
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6/go.mod h1:gUX5317IAvRMjB4GftayM87JVln3DTqukfirwJpEWnE
=
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
3 h1:X36b6y9fPGiJx2ugs+1RR8OKA9mYljsNTReTLNPa+Tg
=
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
6 h1:tNGW3gztoIx2t+z64wAkDIvsUpvc468Y8IG9K4/hAKk
=
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
3/go.mod h1:ik59PuWUSXYfrb/cLJ3pRxZijVoy/QabRN5TgGIMEkQ
=
github.com/ethereum-optimism/optimism/op-chain-ops v0.8.
6/go.mod h1:RZ0R4dy/F/bMbKlDef7k1oSiD4BEx9GmwXYtnmx7mEk
=
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=
...
...
op-proposer/go.mod
View file @
bc4a1550
...
@@ -3,9 +3,9 @@ module github.com/ethereum-optimism/optimism/op-proposer
...
@@ -3,9 +3,9 @@ module github.com/ethereum-optimism/optimism/op-proposer
go 1.18
go 1.18
require (
require (
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6
github.com/ethereum-optimism/optimism/op-node v0.8.
3
github.com/ethereum-optimism/optimism/op-node v0.8.
6
github.com/ethereum-optimism/optimism/op-service v0.8.
3
github.com/ethereum-optimism/optimism/op-service v0.8.
6
github.com/ethereum/go-ethereum v1.10.23
github.com/ethereum/go-ethereum v1.10.23
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
github.com/miguelmota/go-ethereum-hdwallet v0.1.1
github.com/stretchr/testify v1.8.0
github.com/stretchr/testify v1.8.0
...
@@ -76,4 +76,4 @@ require (
...
@@ -76,4 +76,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
)
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
op-proposer/go.sum
View file @
bc4a1550
...
@@ -148,14 +148,14 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
...
@@ -148,14 +148,14 @@ 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-2022090
7143004-2aacc679d638 h1:LcvgHjeooGBobfEIEYikMzx1MoIAjRqa/ZDdkrhV3Hw
=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1 h1:W/ZU6BZH7ilTrpdoJOF9N4OReqXbpeRtUB6klIpEdMA
=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3 h1:6v3n0fZhxcqVF9mu8l2Axqi4/XcMqpthtl3mEkqhi04
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6 h1:jJYhmygt7hqGzYa+8sme9SdnKt1c3Y6EbWgIrRONoxw
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
3/go.mod h1:XZRKu/LTd03m50duwMFEqCWe6qkjgLBZUoZG3CR2Kg0
=
github.com/ethereum-optimism/optimism/op-bindings v0.8.
6/go.mod h1:gUX5317IAvRMjB4GftayM87JVln3DTqukfirwJpEWnE
=
github.com/ethereum-optimism/optimism/op-node v0.8.
3 h1:Snuick9EtalM6Cbs8rVUcoCDPFpu6Xxr7kre+RbLbY0
=
github.com/ethereum-optimism/optimism/op-node v0.8.
6 h1:xNwN+Q/Rt17vSKawhBeG9qTcqcyh8JU8PGjK1iuGkF4
=
github.com/ethereum-optimism/optimism/op-node v0.8.
3/go.mod h1:CPa18cq3E41eqwpsohX/QkupY11D3CYsNqbKZD6H860
=
github.com/ethereum-optimism/optimism/op-node v0.8.
6/go.mod h1:gkyzgVHV3+tIhLZ8GhT+bL9GrrmouQCW4mKYukS0SHg
=
github.com/ethereum-optimism/optimism/op-service v0.8.
3 h1:eNiNir1/a5nVzs08tuq6+A3d0doB15qPO17YozKZhzQ
=
github.com/ethereum-optimism/optimism/op-service v0.8.
6 h1:ruZp/BxL8TGn1y9EJmygypPTeVAFlAA0A/h8LsCoV+M
=
github.com/ethereum-optimism/optimism/op-service v0.8.
3/go.mod h1:TGUsHYIx5jwCZgvj1taNtTEhJsJNIwRvZ0noDXTdb4c
=
github.com/ethereum-optimism/optimism/op-service v0.8.
6/go.mod h1:gm8YNzERrL/CHBPWx3+01mR/NOVpLLw4GEUSnnTdyFU
=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
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.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
...
...
op-service/go.mod
View file @
bc4a1550
...
@@ -65,4 +65,4 @@ require (
...
@@ -65,4 +65,4 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
)
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
replace github.com/ethereum/go-ethereum v1.10.23 => github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
op-service/go.sum
View file @
bc4a1550
...
@@ -108,8 +108,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
...
@@ -108,8 +108,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-2022090
7143004-2aacc679d638 h1:LcvgHjeooGBobfEIEYikMzx1MoIAjRqa/ZDdkrhV3Hw
=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1 h1:W/ZU6BZH7ilTrpdoJOF9N4OReqXbpeRtUB6klIpEdMA
=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
7143004-2aacc679d638
/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
github.com/ethereum-optimism/op-geth v0.0.0-2022090
9213840-e6575c0168f1
/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo=
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=
...
...
packages/contracts-bedrock/deploy-config/devnetL1.json
View file @
bc4a1550
...
@@ -23,5 +23,6 @@
...
@@ -23,5 +23,6 @@
"optimismBaseFeeRecipient"
:
"0xBcd4042DE499D14e55001CcbB24a551F3b954096"
,
"optimismBaseFeeRecipient"
:
"0xBcd4042DE499D14e55001CcbB24a551F3b954096"
,
"optimismL1FeeRecipient"
:
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788"
,
"optimismL1FeeRecipient"
:
"0x71bE63f3384f5fb98995898A86B02Fb2426c5788"
,
"deploymentWaitConfirmations"
:
1
"deploymentWaitConfirmations"
:
1
,
"fundDevAccounts"
:
true
}
}
packages/contracts-periphery/contracts/L1/L1ERC721Bridge.sol
View file @
bc4a1550
...
@@ -3,7 +3,7 @@ pragma solidity 0.8.15;
...
@@ -3,7 +3,7 @@ pragma solidity 0.8.15;
import {
import {
CrossDomainEnabled
CrossDomainEnabled
} from "@eth-optimism/contracts/
contracts/
libraries/bridge/CrossDomainEnabled.sol";
} from "@eth-optimism/contracts/libraries/bridge/CrossDomainEnabled.sol";
import {
import {
OwnableUpgradeable
OwnableUpgradeable
} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
...
...
packages/contracts-periphery/contracts/L2/L2ERC721Bridge.sol
View file @
bc4a1550
...
@@ -3,7 +3,7 @@ pragma solidity 0.8.15;
...
@@ -3,7 +3,7 @@ pragma solidity 0.8.15;
import {
import {
CrossDomainEnabled
CrossDomainEnabled
} from "@eth-optimism/contracts/
contracts/
libraries/bridge/CrossDomainEnabled.sol";
} from "@eth-optimism/contracts/libraries/bridge/CrossDomainEnabled.sol";
import {
import {
OwnableUpgradeable
OwnableUpgradeable
} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
...
...
packages/contracts/.gitignore
View file @
bc4a1550
src/contract-artifacts.ts
src/contract-artifacts.ts
src/contract-deployed-artifacts.ts
src/contract-deployed-artifacts.ts
/chugsplash
/L1
/L2
/libraries
/standards
packages/contracts/package.json
View file @
bc4a1550
...
@@ -20,11 +20,12 @@
...
@@ -20,11 +20,12 @@
"standards"
"standards"
],
],
"scripts"
:
{
"scripts"
:
{
"build"
:
"yarn build:contracts && yarn autogen:artifacts && yarn build:typescript"
,
"build"
:
"yarn build:contracts && yarn
copy:contracts && yarn
autogen:artifacts && yarn build:typescript"
,
"build:typescript"
:
"tsc -p ./tsconfig.json"
,
"build:typescript"
:
"tsc -p ./tsconfig.json"
,
"build:contracts"
:
"hardhat compile --show-stack-traces"
,
"build:contracts"
:
"hardhat compile --show-stack-traces"
,
"autogen:markdown"
:
"ts-node scripts/generate-markdown.ts"
,
"autogen:markdown"
:
"ts-node scripts/generate-markdown.ts"
,
"autogen:artifacts"
:
"ts-node scripts/generate-artifacts.ts && ts-node scripts/generate-deployed-artifacts.ts"
,
"autogen:artifacts"
:
"ts-node scripts/generate-artifacts.ts && ts-node scripts/generate-deployed-artifacts.ts"
,
"copy:contracts"
:
"yarn copyfiles -u 1 -e
\"
**/test-*/**/*
\"
\"
contracts/**/*
\"
./"
,
"test"
:
"yarn test:contracts"
,
"test"
:
"yarn test:contracts"
,
"test:contracts"
:
"hardhat test --show-stack-traces"
,
"test:contracts"
:
"hardhat test --show-stack-traces"
,
"test:coverage"
:
"NODE_OPTIONS=--max_old_space_size=8192 hardhat coverage && istanbul check-coverage --statements 90 --branches 84 --functions 88 --lines 90"
,
"test:coverage"
:
"NODE_OPTIONS=--max_old_space_size=8192 hardhat coverage && istanbul check-coverage --statements 90 --branches 84 --functions 88 --lines 90"
,
...
@@ -38,11 +39,7 @@
...
@@ -38,11 +39,7 @@
"lint:contracts:fix"
:
"yarn prettier --write 'contracts/**/*.sol'"
,
"lint:contracts:fix"
:
"yarn prettier --write 'contracts/**/*.sol'"
,
"lint:fix"
:
"yarn lint:contracts:fix && yarn lint:ts:fix"
,
"lint:fix"
:
"yarn lint:contracts:fix && yarn lint:ts:fix"
,
"lint"
:
"yarn lint:fix && yarn lint:check"
,
"lint"
:
"yarn lint:fix && yarn lint:check"
,
"clean"
:
"rm -rf ./dist ./artifacts ./cache ./coverage ./tsconfig.tsbuildinfo"
,
"clean"
:
"rm -rf ./dist ./artifacts ./cache ./coverage ./tsconfig.tsbuildinfo ./chugsplash ./L1 ./L2 ./libraries ./standards"
,
"prepublishOnly"
:
"yarn copyfiles -u 1 -e
\"
**/test-*/**/*
\"
\"
contracts/**/*
\"
./"
,
"postpublish"
:
"rimraf chugsplash L1 L2 libraries standards"
,
"prepack"
:
"yarn prepublishOnly"
,
"postpack"
:
"yarn postpublish"
,
"pre-commit"
:
"lint-staged"
,
"pre-commit"
:
"lint-staged"
,
"validateDocs"
:
"hardhat validateOutput"
"validateDocs"
:
"hardhat validateOutput"
},
},
...
@@ -107,7 +104,6 @@
...
@@ -107,7 +104,6 @@
"prettier"
:
"^2.3.1"
,
"prettier"
:
"^2.3.1"
,
"prettier-plugin-solidity"
:
"^1.0.0-beta.18"
,
"prettier-plugin-solidity"
:
"^1.0.0-beta.18"
,
"random-bytes-seed"
:
"^1.0.3"
,
"random-bytes-seed"
:
"^1.0.3"
,
"rimraf"
:
"^3.0.2"
,
"rlp"
:
"^2.2.6"
,
"rlp"
:
"^2.2.6"
,
"solhint"
:
"^3.3.6"
,
"solhint"
:
"^3.3.6"
,
"solhint-plugin-prettier"
:
"^0.0.5"
,
"solhint-plugin-prettier"
:
"^0.0.5"
,
...
...
packages/core-utils/package.json
View file @
bc4a1550
...
@@ -32,14 +32,22 @@
...
@@ -32,14 +32,22 @@
"url"
:
"https://github.com/ethereum-optimism/optimism.git"
"url"
:
"https://github.com/ethereum-optimism/optimism.git"
},
},
"dependencies"
:
{
"dependencies"
:
{
"@ethersproject/abi"
:
"^5.6.3"
,
"@ethersproject/abstract-provider"
:
"^5.6.1"
,
"@ethersproject/abstract-provider"
:
"^5.6.1"
,
"@ethersproject/address"
:
"^5.6.1"
,
"@ethersproject/bignumber"
:
"^5.6.1"
,
"@ethersproject/bytes"
:
"^5.6.1"
,
"@ethersproject/contracts"
:
"^5.6.2"
,
"@ethersproject/constants"
:
"^5.6.1"
,
"@ethersproject/hash"
:
"^5.6.1"
,
"@ethersproject/keccak256"
:
"^5.6.1"
,
"@ethersproject/providers"
:
"^5.6.8"
,
"@ethersproject/providers"
:
"^5.6.8"
,
"@ethersproject/rlp"
:
"^5.6.1"
,
"@ethersproject/transactions"
:
"^5.6.2"
,
"@ethersproject/transactions"
:
"^5.6.2"
,
"@ethersproject/properties"
:
"^5.6.0"
,
"@ethersproject/properties"
:
"^5.6.0"
,
"@ethersproject/web"
:
"^5.6.1"
,
"@ethersproject/web"
:
"^5.6.1"
,
"bufio"
:
"^1.0.7"
,
"bufio"
:
"^1.0.7"
,
"chai"
:
"^4.3.4"
,
"chai"
:
"^4.3.4"
"ethers"
:
"^5.6.8"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"mocha"
:
"^10.0.0"
"mocha"
:
"^10.0.0"
...
...
packages/core-utils/src/common/bn.ts
View file @
bc4a1550
import
{
ethers
}
from
'
ethers
'
import
{
BigNumber
}
from
'
@ethersproject/bignumber
'
import
{
getAddress
}
from
'
@ethersproject/address
'
import
{
remove0x
,
add0x
}
from
'
./hex-strings
'
import
{
remove0x
,
add0x
}
from
'
./hex-strings
'
...
@@ -8,15 +9,15 @@ import { remove0x, add0x } from './hex-strings'
...
@@ -8,15 +9,15 @@ import { remove0x, add0x } from './hex-strings'
* @param bn BigNumber to convert to an address.
* @param bn BigNumber to convert to an address.
* @return BigNumber converted to an address, represented as a hex string.
* @return BigNumber converted to an address, represented as a hex string.
*/
*/
export
const
bnToAddress
=
(
bn
:
ethers
.
BigNumber
|
number
):
string
=>
{
export
const
bnToAddress
=
(
bn
:
BigNumber
|
number
):
string
=>
{
// Coerce numbers into a BigNumber.
// Coerce numbers into a BigNumber.
bn
=
ethers
.
BigNumber
.
from
(
bn
)
bn
=
BigNumber
.
from
(
bn
)
// Negative numbers are converted to addresses by adding MAX_ADDRESS + 1.
// Negative numbers are converted to addresses by adding MAX_ADDRESS + 1.
// TODO: Explain this in more detail, it's basically just matching the behavior of doing
// TODO: Explain this in more detail, it's basically just matching the behavior of doing
// addr(uint256(addr) - some_number) in Solidity where some_number > uint256(addr).
// addr(uint256(addr) - some_number) in Solidity where some_number > uint256(addr).
if
(
bn
.
isNegative
())
{
if
(
bn
.
isNegative
())
{
bn
=
ethers
.
BigNumber
.
from
(
'
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
'
)
bn
=
BigNumber
.
from
(
'
0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
'
)
.
add
(
bn
)
.
add
(
bn
)
.
add
(
1
)
.
add
(
1
)
}
}
...
@@ -32,7 +33,7 @@ export const bnToAddress = (bn: ethers.BigNumber | number): string => {
...
@@ -32,7 +33,7 @@ export const bnToAddress = (bn: ethers.BigNumber | number): string => {
// Add 0x again
// Add 0x again
addr
=
add0x
(
addr
)
addr
=
add0x
(
addr
)
// Convert into a checksummed address
// Convert into a checksummed address
addr
=
ethers
.
utils
.
getAddress
(
addr
)
addr
=
getAddress
(
addr
)
return
addr
return
addr
}
}
packages/core-utils/src/common/hex-strings.ts
View file @
bc4a1550
/* Imports: External */
/* Imports: External */
import
{
BigNumber
,
ethers
}
from
'
ethers
'
import
{
BigNumber
}
from
'
@ethersproject/bignumber
'
import
{
isHexString
,
hexZeroPad
}
from
'
@ethersproject/bytes
'
/**
/**
* Removes "0x" from start of a string if it exists.
* Removes "0x" from start of a string if it exists.
...
@@ -112,11 +113,11 @@ export const encodeHex = (val: any, len: number): string =>
...
@@ -112,11 +113,11 @@ export const encodeHex = (val: any, len: number): string =>
* @return True if equal
* @return True if equal
*/
*/
export
const
hexStringEquals
=
(
stringA
:
string
,
stringB
:
string
):
boolean
=>
{
export
const
hexStringEquals
=
(
stringA
:
string
,
stringB
:
string
):
boolean
=>
{
if
(
!
ethers
.
utils
.
isHexString
(
stringA
))
{
if
(
!
isHexString
(
stringA
))
{
throw
new
Error
(
`input is not a hex string:
${
stringA
}
`
)
throw
new
Error
(
`input is not a hex string:
${
stringA
}
`
)
}
}
if
(
!
ethers
.
utils
.
isHexString
(
stringB
))
{
if
(
!
isHexString
(
stringB
))
{
throw
new
Error
(
`input is not a hex string:
${
stringB
}
`
)
throw
new
Error
(
`input is not a hex string:
${
stringB
}
`
)
}
}
...
@@ -130,5 +131,5 @@ export const hexStringEquals = (stringA: string, stringB: string): boolean => {
...
@@ -130,5 +131,5 @@ export const hexStringEquals = (stringA: string, stringB: string): boolean => {
* @return Number cast as a hex string.
* @return Number cast as a hex string.
*/
*/
export
const
bytes32ify
=
(
value
:
number
|
BigNumber
):
string
=>
{
export
const
bytes32ify
=
(
value
:
number
|
BigNumber
):
string
=>
{
return
ethers
.
utils
.
hexZeroPad
(
BigNumber
.
from
(
value
).
toHexString
(),
32
)
return
hexZeroPad
(
BigNumber
.
from
(
value
).
toHexString
(),
32
)
}
}
packages/core-utils/src/common/test-utils.ts
View file @
bc4a1550
import
{
expect
}
from
'
chai
'
import
{
expect
}
from
'
chai
'
import
{
BigNumber
}
from
'
ethers
'
import
{
BigNumber
}
from
'
@ethersproject/bignumber
'
import
{
sleep
}
from
'
./misc
'
import
{
sleep
}
from
'
./misc
'
...
...
packages/core-utils/src/external/ethers/fallback-provider.ts
View file @
bc4a1550
...
@@ -2,9 +2,12 @@
...
@@ -2,9 +2,12 @@
* Provider Utilities
* Provider Utilities
*/
*/
import
{
ethers
}
from
'
ethers
'
import
{
import
{
Provider
}
from
'
@ethersproject/providers
'
Provider
,
import
{
ConnectionInfo
}
from
'
ethers/lib/utils
'
StaticJsonRpcProvider
,
FallbackProvider
as
EthersFallbackProvider
,
}
from
'
@ethersproject/providers
'
import
{
ConnectionInfo
}
from
'
@ethersproject/web
'
export
interface
HttpHeaders
{
export
interface
HttpHeaders
{
[
key
:
string
]:
string
[
key
:
string
]:
string
...
@@ -44,11 +47,11 @@ export const FallbackProvider = (
...
@@ -44,11 +47,11 @@ export const FallbackProvider = (
}
}
configs
.
push
({
configs
.
push
({
priority
:
i
,
priority
:
i
,
provider
:
new
ethers
.
providers
.
StaticJsonRpcProvider
(
connectionInfo
),
provider
:
new
StaticJsonRpcProvider
(
connectionInfo
),
})
})
}
}
return
new
ethers
.
providers
.
FallbackProvider
(
configs
)
return
new
Ethers
FallbackProvider
(
configs
)
}
}
return
new
ethers
.
providers
.
FallbackProvider
(
config
)
return
new
Ethers
FallbackProvider
(
config
)
}
}
packages/core-utils/src/optimism/alias.ts
View file @
bc4a1550
import
{
ethers
}
from
'
ethers
'
import
{
isAddress
}
from
'
@ethersproject/address
'
import
{
BigNumber
}
from
'
@ethersproject/bignumber
'
import
{
bnToAddress
}
from
'
../common
'
import
{
bnToAddress
}
from
'
../common
'
...
@@ -18,11 +19,11 @@ export const L1_TO_L2_ALIAS_OFFSET =
...
@@ -18,11 +19,11 @@ export const L1_TO_L2_ALIAS_OFFSET =
* @returns Address with the scheme applied.
* @returns Address with the scheme applied.
*/
*/
export
const
applyL1ToL2Alias
=
(
address
:
string
):
string
=>
{
export
const
applyL1ToL2Alias
=
(
address
:
string
):
string
=>
{
if
(
!
ethers
.
utils
.
isAddress
(
address
))
{
if
(
!
isAddress
(
address
))
{
throw
new
Error
(
`not a valid address:
${
address
}
`
)
throw
new
Error
(
`not a valid address:
${
address
}
`
)
}
}
return
bnToAddress
(
ethers
.
BigNumber
.
from
(
address
).
add
(
L1_TO_L2_ALIAS_OFFSET
))
return
bnToAddress
(
BigNumber
.
from
(
address
).
add
(
L1_TO_L2_ALIAS_OFFSET
))
}
}
/**
/**
...
@@ -32,9 +33,9 @@ export const applyL1ToL2Alias = (address: string): string => {
...
@@ -32,9 +33,9 @@ export const applyL1ToL2Alias = (address: string): string => {
* @returns Alias with the scheme reversed.
* @returns Alias with the scheme reversed.
*/
*/
export
const
undoL1ToL2Alias
=
(
address
:
string
):
string
=>
{
export
const
undoL1ToL2Alias
=
(
address
:
string
):
string
=>
{
if
(
!
ethers
.
utils
.
isAddress
(
address
))
{
if
(
!
isAddress
(
address
))
{
throw
new
Error
(
`not a valid address:
${
address
}
`
)
throw
new
Error
(
`not a valid address:
${
address
}
`
)
}
}
return
bnToAddress
(
ethers
.
BigNumber
.
from
(
address
).
sub
(
L1_TO_L2_ALIAS_OFFSET
))
return
bnToAddress
(
BigNumber
.
from
(
address
).
sub
(
L1_TO_L2_ALIAS_OFFSET
))
}
}
packages/core-utils/src/optimism/batch-encoding.ts
View file @
bc4a1550
import
zlib
from
'
zlib
'
import
zlib
from
'
zlib
'
import
{
parse
,
serialize
}
from
'
@ethersproject/transactions
'
import
{
parse
,
serialize
,
Transaction
}
from
'
@ethersproject/transactions
'
import
{
ethers
}
from
'
ethers
'
import
{
Struct
,
BufferWriter
,
BufferReader
}
from
'
bufio
'
import
{
Struct
,
BufferWriter
,
BufferReader
}
from
'
bufio
'
import
{
id
}
from
'
@ethersproject/hash
'
import
{
remove0x
}
from
'
../common
'
import
{
remove0x
}
from
'
../common
'
...
@@ -28,7 +28,7 @@ export interface AppendSequencerBatchParams {
...
@@ -28,7 +28,7 @@ export interface AppendSequencerBatchParams {
const
APPEND_SEQUENCER_BATCH_METHOD_ID
=
'
appendSequencerBatch()
'
const
APPEND_SEQUENCER_BATCH_METHOD_ID
=
'
appendSequencerBatch()
'
const
FOUR_BYTE_APPEND_SEQUENCER_BATCH
=
Buffer
.
from
(
const
FOUR_BYTE_APPEND_SEQUENCER_BATCH
=
Buffer
.
from
(
ethers
.
utils
.
id
(
APPEND_SEQUENCER_BATCH_METHOD_ID
).
slice
(
2
,
10
),
id
(
APPEND_SEQUENCER_BATCH_METHOD_ID
).
slice
(
2
,
10
),
'
hex
'
'
hex
'
)
)
...
@@ -166,9 +166,9 @@ export class BatchedTx extends Struct {
...
@@ -166,9 +166,9 @@ export class BatchedTx extends Struct {
public
txSize
:
number
public
txSize
:
number
// rlp encoded transaction
// rlp encoded transaction
public
raw
:
Buffer
public
raw
:
Buffer
public
tx
:
ethers
.
Transaction
public
tx
:
Transaction
constructor
(
tx
?:
ethers
.
Transaction
)
{
constructor
(
tx
?:
Transaction
)
{
super
()
super
()
this
.
tx
=
tx
this
.
tx
=
tx
}
}
...
@@ -210,7 +210,7 @@ export class BatchedTx extends Struct {
...
@@ -210,7 +210,7 @@ export class BatchedTx extends Struct {
return
this
return
this
}
}
toTransaction
():
ethers
.
Transaction
{
toTransaction
():
Transaction
{
if
(
this
.
tx
)
{
if
(
this
.
tx
)
{
return
this
.
tx
return
this
.
tx
}
}
...
...
packages/core-utils/src/optimism/deposit-transaction.ts
View file @
bc4a1550
import
{
getAddress
}
from
'
@ethersproject/address
'
import
{
ContractReceipt
,
Event
}
from
'
@ethersproject/contracts
'
import
{
BigNumber
,
BigNumberish
}
from
'
@ethersproject/bignumber
'
import
{
keccak256
}
from
'
@ethersproject/keccak256
'
import
{
Zero
}
from
'
@ethersproject/constants
'
import
*
as
RLP
from
'
@ethersproject/rlp
'
import
{
import
{
BigNumber
,
arrayify
,
BigNumberish
,
BytesLike
,
BytesLike
,
ContractReceipt
,
hexDataSlice
,
ethers
,
stripZeros
,
Event
,
hexConcat
,
utils
,
zeroPad
,
}
from
'
ethers
'
}
from
'
@ethersproject/bytes
'
const
{
hexDataSlice
,
stripZeros
,
hexConcat
,
keccak256
,
zeroPad
}
=
utils
const
formatBoolean
=
(
value
:
boolean
):
Uint8Array
=>
{
const
formatBoolean
=
(
value
:
boolean
):
Uint8Array
=>
{
return
value
?
new
Uint8Array
([
1
])
:
new
Uint8Array
([])
return
value
?
new
Uint8Array
([
1
])
:
new
Uint8Array
([])
...
@@ -34,7 +37,7 @@ const handleBoolean = (value: string): boolean => {
...
@@ -34,7 +37,7 @@ const handleBoolean = (value: string): boolean => {
const
handleNumber
=
(
value
:
string
):
BigNumber
=>
{
const
handleNumber
=
(
value
:
string
):
BigNumber
=>
{
if
(
value
===
'
0x
'
)
{
if
(
value
===
'
0x
'
)
{
return
ethers
.
constants
.
Zero
return
Zero
}
}
return
BigNumber
.
from
(
value
)
return
BigNumber
.
from
(
value
)
}
}
...
@@ -44,7 +47,7 @@ const handleAddress = (value: string): string => {
...
@@ -44,7 +47,7 @@ const handleAddress = (value: string): string => {
// @ts-ignore
// @ts-ignore
return
null
return
null
}
}
return
utils
.
getAddress
(
value
)
return
getAddress
(
value
)
}
}
export
enum
SourceHashDomain
{
export
enum
SourceHashDomain
{
...
@@ -142,8 +145,8 @@ export class DepositTx {
...
@@ -142,8 +145,8 @@ export class DepositTx {
encode
()
{
encode
()
{
const
fields
:
any
=
[
const
fields
:
any
=
[
this
.
sourceHash
()
||
'
0x
'
,
this
.
sourceHash
()
||
'
0x
'
,
utils
.
getAddress
(
this
.
from
)
||
'
0x
'
,
getAddress
(
this
.
from
)
||
'
0x
'
,
this
.
to
!=
null
?
utils
.
getAddress
(
this
.
to
)
:
'
0x
'
,
this
.
to
!=
null
?
getAddress
(
this
.
to
)
:
'
0x
'
,
formatNumber
(
this
.
mint
||
0
,
'
mint
'
),
formatNumber
(
this
.
mint
||
0
,
'
mint
'
),
formatNumber
(
this
.
value
||
0
,
'
value
'
),
formatNumber
(
this
.
value
||
0
,
'
value
'
),
formatNumber
(
this
.
gas
||
0
,
'
gas
'
),
formatNumber
(
this
.
gas
||
0
,
'
gas
'
),
...
@@ -153,17 +156,17 @@ export class DepositTx {
...
@@ -153,17 +156,17 @@ export class DepositTx {
return
hexConcat
([
return
hexConcat
([
BigNumber
.
from
(
this
.
type
).
toHexString
(),
BigNumber
.
from
(
this
.
type
).
toHexString
(),
utils
.
RLP
.
encode
(
fields
),
RLP
.
encode
(
fields
),
])
])
}
}
decode
(
raw
:
BytesLike
,
extra
:
DepositTxExtraOpts
=
{})
{
decode
(
raw
:
BytesLike
,
extra
:
DepositTxExtraOpts
=
{})
{
const
payload
=
utils
.
arrayify
(
raw
)
const
payload
=
arrayify
(
raw
)
if
(
payload
[
0
]
!==
this
.
type
)
{
if
(
payload
[
0
]
!==
this
.
type
)
{
throw
new
Error
(
`Invalid type
${
payload
[
0
]}
`
)
throw
new
Error
(
`Invalid type
${
payload
[
0
]}
`
)
}
}
this
.
version
=
payload
[
1
]
this
.
version
=
payload
[
1
]
const
transaction
=
utils
.
RLP
.
decode
(
payload
.
slice
(
1
))
const
transaction
=
RLP
.
decode
(
payload
.
slice
(
1
))
this
.
_sourceHash
=
transaction
[
0
]
this
.
_sourceHash
=
transaction
[
0
]
this
.
from
=
handleAddress
(
transaction
[
1
])
this
.
from
=
handleAddress
(
transaction
[
1
])
this
.
to
=
handleAddress
(
transaction
[
2
])
this
.
to
=
handleAddress
(
transaction
[
2
])
...
...
packages/core-utils/src/optimism/encoding.ts
View file @
bc4a1550
import
{
ethers
,
BigNumberish
,
BigNumber
}
from
'
ethers
'
import
{
BigNumberish
,
BigNumber
}
from
'
@ethersproject/bignumber
'
import
{
Interface
}
from
'
@ethersproject/abi
'
const
iface
=
new
ethers
.
utils
.
Interface
([
const
iface
=
new
Interface
([
'
function relayMessage(address,address,bytes,uint256)
'
,
'
function relayMessage(address,address,bytes,uint256)
'
,
'
function relayMessage(uint256,address,address,uint256,uint256,bytes)
'
,
'
function relayMessage(uint256,address,address,uint256,uint256,bytes)
'
,
])
])
...
...
packages/core-utils/src/optimism/fees.ts
View file @
bc4a1550
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* Fee related serialization and deserialization
* Fee related serialization and deserialization
*/
*/
import
{
BigNumber
}
from
'
ethers
'
import
{
BigNumber
}
from
'
@ethersproject/bignumber
'
import
{
remove0x
}
from
'
../common
'
import
{
remove0x
}
from
'
../common
'
...
...
packages/core-utils/src/optimism/hashing.ts
View file @
bc4a1550
import
{
BigNumberish
,
BigNumber
,
utils
}
from
'
ethers
'
import
{
BigNumberish
,
BigNumber
}
from
'
@ethersproject/bignumber
'
const
{
keccak256
,
defaultAbiCoder
}
=
utils
import
{
keccak256
}
from
'
@ethersproject/keccak256
'
import
{
defaultAbiCoder
}
from
'
@ethersproject/abi
'
import
{
import
{
decodeVersionedNonce
,
decodeVersionedNonce
,
...
...
packages/core-utils/src/optimism/op-provider.ts
View file @
bc4a1550
import
EventEmitter
from
'
events
'
import
EventEmitter
from
'
events
'
import
{
BigNumber
}
from
'
ethers
'
import
{
BigNumber
}
from
'
@ethersproject/bignumber
'
import
{
deepCopy
}
from
'
@ethersproject/properties
'
import
{
deepCopy
}
from
'
@ethersproject/properties
'
import
{
ConnectionInfo
,
fetchJson
}
from
'
@ethersproject/web
'
import
{
ConnectionInfo
,
fetchJson
}
from
'
@ethersproject/web
'
...
...
packages/core-utils/test/fees.spec.ts
View file @
bc4a1550
import
'
./setup
'
import
'
./setup
'
import
{
BigNumber
}
from
'
ethers
'
import
{
BigNumber
}
from
'
@ethersproject/bignumber
'
import
{
zeroesAndOnes
,
calldataCost
}
from
'
../src
'
import
{
zeroesAndOnes
,
calldataCost
}
from
'
../src
'
...
...
packages/core-utils/test/hex-utils.spec.ts
View file @
bc4a1550
import
{
BigNumber
}
from
'
ethers
'
import
{
BigNumber
}
from
'
@ethersproject/bignumber
'
/* Imports: Internal */
/* Imports: Internal */
import
{
expect
}
from
'
./setup
'
import
{
expect
}
from
'
./setup
'
...
...
proxyd/errors.go
View file @
bc4a1550
...
@@ -3,5 +3,5 @@ package proxyd
...
@@ -3,5 +3,5 @@ package proxyd
import
"fmt"
import
"fmt"
func
wrapErr
(
err
error
,
msg
string
)
error
{
func
wrapErr
(
err
error
,
msg
string
)
error
{
return
fmt
.
Errorf
(
"%s %
v
"
,
msg
,
err
)
return
fmt
.
Errorf
(
"%s %
w
"
,
msg
,
err
)
}
}
yarn.lock
View file @
bc4a1550
This diff is collapsed.
Click to expand it.
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