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
bb26427b
Commit
bb26427b
authored
Mar 16, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into refcell/batcher/tests
parents
f376cc3b
9a644dcf
Changes
48
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
1088 additions
and
206 deletions
+1088
-206
chilled-melons-speak.md
.changeset/chilled-melons-speak.md
+0
-5
flat-adults-hope.md
.changeset/flat-adults-hope.md
+0
-5
fluffy-geese-yell.md
.changeset/fluffy-geese-yell.md
+0
-5
long-frogs-study.md
.changeset/long-frogs-study.md
+0
-5
metal-apes-taste.md
.changeset/metal-apes-taste.md
+0
-5
metal-feet-give.md
.changeset/metal-feet-give.md
+0
-5
poor-buses-hug.md
.changeset/poor-buses-hug.md
+0
-5
quiet-crews-leave.md
.changeset/quiet-crews-leave.md
+0
-5
sixty-days-explain.md
.changeset/sixty-days-explain.md
+0
-5
slimy-mangos-brake.md
.changeset/slimy-mangos-brake.md
+0
-5
three-apes-study.md
.changeset/three-apes-study.md
+0
-5
wicked-ads-pump.md
.changeset/wicked-ads-pump.md
+0
-5
package.json
integration-tests/package.json
+2
-2
main.go
op-chain-ops/cmd/check-migration/main.go
+210
-0
main.go
op-chain-ops/cmd/op-migrate/main.go
+5
-0
cli.go
op-chain-ops/ether/cli.go
+2
-2
migrate.go
op-chain-ops/ether/migrate.go
+6
-17
precheck.go
op-chain-ops/ether/precheck.go
+244
-78
precheck_test.go
op-chain-ops/ether/precheck_test.go
+295
-0
check.go
op-chain-ops/genesis/check.go
+5
-3
db_migration.go
op-chain-ops/genesis/db_migration.go
+19
-10
README.md
op-node/cmd/batch_decoder/README.md
+10
-1
main.go
op-node/cmd/batch_decoder/main.go
+41
-0
reassemble.go
op-node/cmd/batch_decoder/reassemble/reassemble.go
+15
-10
channel_out.go
op-node/rollup/derive/channel_out.go
+55
-0
channel_out_test.go
op-node/rollup/derive/channel_out_test.go
+67
-0
types.go
op-node/rollup/types.go
+1
-1
CHANGELOG.md
packages/actor-tests/CHANGELOG.md
+10
-0
package.json
packages/actor-tests/package.json
+3
-3
CHANGELOG.md
packages/atst/CHANGELOG.md
+15
-0
package.json
packages/atst/package.json
+1
-1
CHANGELOG.md
packages/chain-mon/CHANGELOG.md
+9
-0
package.json
packages/chain-mon/package.json
+3
-3
CHANGELOG.md
packages/common-ts/CHANGELOG.md
+6
-0
package.json
packages/common-ts/package.json
+1
-1
CHANGELOG.md
packages/contracts-bedrock/CHANGELOG.md
+7
-0
package.json
packages/contracts-bedrock/package.json
+1
-1
package.json
packages/contracts-periphery/package.json
+1
-1
CHANGELOG.md
packages/data-transport-layer/CHANGELOG.md
+7
-0
package.json
packages/data-transport-layer/package.json
+2
-2
CHANGELOG.md
packages/fault-detector/CHANGELOG.md
+10
-0
package.json
packages/fault-detector/package.json
+3
-3
CHANGELOG.md
packages/message-relayer/CHANGELOG.md
+9
-0
package.json
packages/message-relayer/package.json
+3
-3
CHANGELOG.md
packages/replica-healthcheck/CHANGELOG.md
+7
-0
package.json
packages/replica-healthcheck/package.json
+2
-2
CHANGELOG.md
packages/sdk/CHANGELOG.md
+9
-0
package.json
packages/sdk/package.json
+2
-2
No files found.
.changeset/chilled-melons-speak.md
deleted
100644 → 0
View file @
f376cc3b
---
'
@eth-optimism/contracts-bedrock'
:
patch
---
Optionally print cast commands during migration
.changeset/flat-adults-hope.md
deleted
100644 → 0
View file @
f376cc3b
---
'
@eth-optimism/atst'
:
minor
---
Update readAttestations and prepareWriteAttestation to handle keys longer than 32 bytes
.changeset/fluffy-geese-yell.md
deleted
100644 → 0
View file @
f376cc3b
---
'
@eth-optimism/atst'
:
minor
---
Remove broken allowFailures as option
.changeset/long-frogs-study.md
deleted
100644 → 0
View file @
f376cc3b
---
'
@eth-optimism/common-ts'
:
patch
---
Fix BaseServiceV2 configuration for caseCase options
.changeset/metal-apes-taste.md
deleted
100644 → 0
View file @
f376cc3b
---
'
@eth-optimism/atst'
:
patch
---
Update docs
.changeset/metal-feet-give.md
deleted
100644 → 0
View file @
f376cc3b
---
'
@eth-optimism/atst'
:
minor
---
Move react api to @eth-optimism/atst/react so react isn't required to run the core sdk
.changeset/poor-buses-hug.md
deleted
100644 → 0
View file @
f376cc3b
---
'
@eth-optimism/sdk'
:
patch
---
Update migrated withdrawal gaslimit calculation
.changeset/quiet-crews-leave.md
deleted
100644 → 0
View file @
f376cc3b
---
'
@eth-optimism/atst'
:
minor
---
Fix main and module in atst package.json
.changeset/sixty-days-explain.md
deleted
100644 → 0
View file @
f376cc3b
---
'
@eth-optimism/atst'
:
patch
---
Fixed bug with atst not defaulting to currently connected chain
.changeset/slimy-mangos-brake.md
deleted
100644 → 0
View file @
f376cc3b
---
'
@eth-optimism/atst'
:
minor
---
Deprecate parseAttestationBytes and createRawKey in favor for createKey, createValue
.changeset/three-apes-study.md
deleted
100644 → 0
View file @
f376cc3b
---
'
@eth-optimism/fault-detector'
:
patch
---
Fixes a bug that would cause the fault detector to error out if no outputs had been proposed yet.
.changeset/wicked-ads-pump.md
deleted
100644 → 0
View file @
f376cc3b
---
'
@eth-optimism/contracts-bedrock'
:
patch
---
Print tenderly simulation links during deployment
integration-tests/package.json
View file @
bb26427b
...
...
@@ -30,10 +30,10 @@
"devDependencies"
:
{
"@babel/eslint-parser"
:
"^7.5.4"
,
"@eth-optimism/contracts"
:
"^0.5.40"
,
"@eth-optimism/contracts-bedrock"
:
"0.13.
0
"
,
"@eth-optimism/contracts-bedrock"
:
"0.13.
1
"
,
"@eth-optimism/contracts-periphery"
:
"^1.0.7"
,
"@eth-optimism/core-utils"
:
"0.12.0"
,
"@eth-optimism/sdk"
:
"2.0.
0
"
,
"@eth-optimism/sdk"
:
"2.0.
1
"
,
"@ethersproject/abstract-provider"
:
"^5.7.0"
,
"@ethersproject/providers"
:
"^5.7.0"
,
"@ethersproject/transactions"
:
"^5.7.0"
,
...
...
op-chain-ops/cmd/check-migration/main.go
0 → 100644
View file @
bb26427b
package
main
import
(
"context"
"fmt"
"math/big"
"os"
"strings"
"github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain"
"github.com/ethereum-optimism/optimism/op-chain-ops/db"
"github.com/mattn/go-isatty"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-bindings/hardhat"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/urfave/cli"
)
func
main
()
{
log
.
Root
()
.
SetHandler
(
log
.
StreamHandler
(
os
.
Stderr
,
log
.
TerminalFormat
(
isatty
.
IsTerminal
(
os
.
Stderr
.
Fd
()))))
app
:=
&
cli
.
App
{
Name
:
"check-migration"
,
Usage
:
"Run sanity checks on a migrated database"
,
Flags
:
[]
cli
.
Flag
{
&
cli
.
StringFlag
{
Name
:
"l1-rpc-url"
,
Value
:
"http://127.0.0.1:8545"
,
Usage
:
"RPC URL for an L1 Node"
,
Required
:
true
,
},
&
cli
.
StringFlag
{
Name
:
"ovm-addresses"
,
Usage
:
"Path to ovm-addresses.json"
,
Required
:
true
,
},
&
cli
.
StringFlag
{
Name
:
"ovm-allowances"
,
Usage
:
"Path to ovm-allowances.json"
,
Required
:
true
,
},
&
cli
.
StringFlag
{
Name
:
"ovm-messages"
,
Usage
:
"Path to ovm-messages.json"
,
Required
:
true
,
},
&
cli
.
StringFlag
{
Name
:
"witness-file"
,
Usage
:
"Path to witness file"
,
Required
:
true
,
},
&
cli
.
StringFlag
{
Name
:
"db-path"
,
Usage
:
"Path to database"
,
Required
:
true
,
},
cli
.
StringFlag
{
Name
:
"deploy-config"
,
Usage
:
"Path to hardhat deploy config file"
,
Required
:
true
,
},
cli
.
StringFlag
{
Name
:
"network"
,
Usage
:
"Name of hardhat deploy network"
,
Required
:
true
,
},
cli
.
StringFlag
{
Name
:
"hardhat-deployments"
,
Usage
:
"Comma separated list of hardhat deployment directories"
,
Required
:
true
,
},
cli
.
IntFlag
{
Name
:
"db-cache"
,
Usage
:
"LevelDB cache size in mb"
,
Value
:
1024
,
},
cli
.
IntFlag
{
Name
:
"db-handles"
,
Usage
:
"LevelDB number of handles"
,
Value
:
60
,
},
},
Action
:
func
(
ctx
*
cli
.
Context
)
error
{
deployConfig
:=
ctx
.
String
(
"deploy-config"
)
config
,
err
:=
genesis
.
NewDeployConfig
(
deployConfig
)
if
err
!=
nil
{
return
err
}
ovmAddresses
,
err
:=
crossdomain
.
NewAddresses
(
ctx
.
String
(
"ovm-addresses"
))
if
err
!=
nil
{
return
err
}
ovmAllowances
,
err
:=
crossdomain
.
NewAllowances
(
ctx
.
String
(
"ovm-allowances"
))
if
err
!=
nil
{
return
err
}
ovmMessages
,
err
:=
crossdomain
.
NewSentMessageFromJSON
(
ctx
.
String
(
"ovm-messages"
))
if
err
!=
nil
{
return
err
}
evmMessages
,
evmAddresses
,
err
:=
crossdomain
.
ReadWitnessData
(
ctx
.
String
(
"witness-file"
))
if
err
!=
nil
{
return
err
}
log
.
Info
(
"Loaded witness data"
,
"ovmAddresses"
,
len
(
ovmAddresses
),
"evmAddresses"
,
len
(
evmAddresses
),
"ovmAllowances"
,
len
(
ovmAllowances
),
"ovmMessages"
,
len
(
ovmMessages
),
"evmMessages"
,
len
(
evmMessages
),
)
migrationData
:=
crossdomain
.
MigrationData
{
OvmAddresses
:
ovmAddresses
,
EvmAddresses
:
evmAddresses
,
OvmAllowances
:
ovmAllowances
,
OvmMessages
:
ovmMessages
,
EvmMessages
:
evmMessages
,
}
network
:=
ctx
.
String
(
"network"
)
deployments
:=
strings
.
Split
(
ctx
.
String
(
"hardhat-deployments"
),
","
)
hh
,
err
:=
hardhat
.
New
(
network
,
[]
string
{},
deployments
)
if
err
!=
nil
{
return
err
}
l1RpcURL
:=
ctx
.
String
(
"l1-rpc-url"
)
l1Client
,
err
:=
ethclient
.
Dial
(
l1RpcURL
)
if
err
!=
nil
{
return
err
}
var
block
*
types
.
Block
tag
:=
config
.
L1StartingBlockTag
if
tag
.
BlockNumber
!=
nil
{
block
,
err
=
l1Client
.
BlockByNumber
(
context
.
Background
(),
big
.
NewInt
(
tag
.
BlockNumber
.
Int64
()))
}
else
if
tag
.
BlockHash
!=
nil
{
block
,
err
=
l1Client
.
BlockByHash
(
context
.
Background
(),
*
tag
.
BlockHash
)
}
else
{
return
fmt
.
Errorf
(
"invalid l1StartingBlockTag in deploy config: %v"
,
tag
)
}
if
err
!=
nil
{
return
err
}
dbCache
:=
ctx
.
Int
(
"db-cache"
)
dbHandles
:=
ctx
.
Int
(
"db-handles"
)
// Read the required deployment addresses from disk if required
if
err
:=
config
.
GetDeployedAddresses
(
hh
);
err
!=
nil
{
return
err
}
if
err
:=
config
.
Check
();
err
!=
nil
{
return
err
}
postLDB
,
err
:=
db
.
Open
(
ctx
.
String
(
"db-path"
),
dbCache
,
dbHandles
)
if
err
!=
nil
{
return
err
}
if
err
:=
genesis
.
PostCheckMigratedDB
(
postLDB
,
migrationData
,
&
config
.
L1CrossDomainMessengerProxy
,
config
.
L1ChainID
,
config
.
FinalSystemOwner
,
config
.
ProxyAdminOwner
,
&
derive
.
L1BlockInfo
{
Number
:
block
.
NumberU64
(),
Time
:
block
.
Time
(),
BaseFee
:
block
.
BaseFee
(),
BlockHash
:
block
.
Hash
(),
BatcherAddr
:
config
.
BatchSenderAddress
,
L1FeeOverhead
:
eth
.
Bytes32
(
common
.
BigToHash
(
new
(
big
.
Int
)
.
SetUint64
(
config
.
GasPriceOracleOverhead
))),
L1FeeScalar
:
eth
.
Bytes32
(
common
.
BigToHash
(
new
(
big
.
Int
)
.
SetUint64
(
config
.
GasPriceOracleScalar
))),
},
);
err
!=
nil
{
return
err
}
if
err
:=
postLDB
.
Close
();
err
!=
nil
{
return
err
}
return
nil
},
}
if
err
:=
app
.
Run
(
os
.
Args
);
err
!=
nil
{
log
.
Crit
(
"error in migration"
,
"err"
,
err
)
}
}
op-chain-ops/cmd/op-migrate/main.go
View file @
bb26427b
...
...
@@ -106,6 +106,11 @@ func main() {
Value
:
"rollup.json"
,
Required
:
true
,
},
cli
.
BoolFlag
{
Name
:
"post-check-only"
,
Usage
:
"Only perform sanity checks"
,
Required
:
false
,
},
},
Action
:
func
(
ctx
*
cli
.
Context
)
error
{
deployConfig
:=
ctx
.
String
(
"deploy-config"
)
...
...
op-chain-ops/ether/cli.go
View file @
bb26427b
...
...
@@ -25,8 +25,8 @@ func GetOVMETHTotalSupplySlot() common.Hash {
return
getOVMETHTotalSupplySlot
()
}
//
g
etOVMETHBalance gets a user's OVM ETH balance from state by querying the
//
G
etOVMETHBalance gets a user's OVM ETH balance from state by querying the
// appropriate storage slot directly.
func
g
etOVMETHBalance
(
db
*
state
.
StateDB
,
addr
common
.
Address
)
*
big
.
Int
{
func
G
etOVMETHBalance
(
db
*
state
.
StateDB
,
addr
common
.
Address
)
*
big
.
Int
{
return
db
.
GetState
(
OVMETHAddress
,
CalcOVMETHStorageKey
(
addr
))
.
Big
()
}
op-chain-ops/ether/migrate.go
View file @
bb26427b
...
...
@@ -29,7 +29,9 @@ var (
}
)
func
MigrateLegacyETH
(
db
*
state
.
StateDB
,
addresses
[]
common
.
Address
,
chainID
int
,
noCheck
bool
)
error
{
type
FilteredOVMETHAddresses
[]
common
.
Address
func
MigrateLegacyETH
(
db
*
state
.
StateDB
,
addresses
FilteredOVMETHAddresses
,
chainID
int
,
noCheck
bool
)
error
{
// Chain params to use for integrity checking.
params
:=
crossdomain
.
ParamsByChainID
[
chainID
]
if
params
==
nil
{
...
...
@@ -39,28 +41,15 @@ func MigrateLegacyETH(db *state.StateDB, addresses []common.Address, chainID int
// Log the chain params for debugging purposes.
log
.
Info
(
"Chain params"
,
"chain-id"
,
chainID
,
"supply-delta"
,
params
.
ExpectedSupplyDelta
)
// Deduplicate the list of addresses by converting to a map.
deduped
:=
make
(
map
[
common
.
Address
]
bool
)
for
_
,
addr
:=
range
addresses
{
deduped
[
addr
]
=
true
}
// Migrate the legacy ETH to ETH.
log
.
Info
(
"Migrating legacy ETH to ETH"
,
"num-accounts"
,
len
(
addresses
))
totalMigrated
:=
new
(
big
.
Int
)
logAccountProgress
:=
util
.
ProgressLogger
(
1000
,
"imported accounts"
)
for
addr
:=
range
deduped
{
// No accounts should have a balance in state. If they do, bail.
if
db
.
GetBalance
(
addr
)
.
Sign
()
>
0
{
if
noCheck
{
log
.
Error
(
"account has non-zero balance in state - should never happen"
,
"addr"
,
addr
)
}
else
{
log
.
Crit
(
"account has non-zero balance in state - should never happen"
,
"addr"
,
addr
)
}
}
for
_
,
addr
:=
range
addresses
{
// Balances are pre-checked not have any balances in state.
// Pull out the OVM ETH balance.
ovmBalance
:=
g
etOVMETHBalance
(
db
,
addr
)
ovmBalance
:=
G
etOVMETHBalance
(
db
,
addr
)
// Actually perform the migration by setting the appropriate values in state.
db
.
SetBalance
(
addr
,
ovmBalance
)
...
...
op-chain-ops/ether/precheck.go
View file @
bb26427b
This diff is collapsed.
Click to expand it.
op-chain-ops/ether/precheck_test.go
0 → 100644
View file @
bb26427b
package
ether
import
(
"bytes"
"math/big"
"math/rand"
"os"
"sort"
"testing"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-chain-ops/crossdomain"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/trie"
"github.com/stretchr/testify/require"
)
func
TestPreCheckBalances
(
t
*
testing
.
T
)
{
log
.
Root
()
.
SetHandler
(
log
.
StreamHandler
(
os
.
Stderr
,
log
.
TerminalFormat
(
true
)))
tests
:=
[]
struct
{
name
string
totalSupply
*
big
.
Int
expDiff
*
big
.
Int
stateBalances
map
[
common
.
Address
]
*
big
.
Int
stateAllowances
map
[
common
.
Address
]
common
.
Address
inputAddresses
[]
common
.
Address
inputAllowances
[]
*
crossdomain
.
Allowance
check
func
(
t
*
testing
.
T
,
addrs
FilteredOVMETHAddresses
,
err
error
)
}{
{
name
:
"everything matches"
,
totalSupply
:
big
.
NewInt
(
3
),
expDiff
:
big
.
NewInt
(
0
),
stateBalances
:
map
[
common
.
Address
]
*
big
.
Int
{
common
.
HexToAddress
(
"0x123"
)
:
big
.
NewInt
(
1
),
common
.
HexToAddress
(
"0x456"
)
:
big
.
NewInt
(
2
),
},
stateAllowances
:
map
[
common
.
Address
]
common
.
Address
{
common
.
HexToAddress
(
"0x123"
)
:
common
.
HexToAddress
(
"0x456"
),
},
inputAddresses
:
[]
common
.
Address
{
common
.
HexToAddress
(
"0x123"
),
common
.
HexToAddress
(
"0x456"
),
},
inputAllowances
:
[]
*
crossdomain
.
Allowance
{
{
From
:
common
.
HexToAddress
(
"0x123"
),
To
:
common
.
HexToAddress
(
"0x456"
),
},
},
check
:
func
(
t
*
testing
.
T
,
addrs
FilteredOVMETHAddresses
,
err
error
)
{
require
.
NoError
(
t
,
err
)
require
.
EqualValues
(
t
,
FilteredOVMETHAddresses
{
common
.
HexToAddress
(
"0x123"
),
common
.
HexToAddress
(
"0x456"
),
},
addrs
)
},
},
{
name
:
"extra input addresses"
,
totalSupply
:
big
.
NewInt
(
1
),
expDiff
:
big
.
NewInt
(
0
),
stateBalances
:
map
[
common
.
Address
]
*
big
.
Int
{
common
.
HexToAddress
(
"0x123"
)
:
big
.
NewInt
(
1
),
},
inputAddresses
:
[]
common
.
Address
{
common
.
HexToAddress
(
"0x123"
),
common
.
HexToAddress
(
"0x456"
),
},
check
:
func
(
t
*
testing
.
T
,
addrs
FilteredOVMETHAddresses
,
err
error
)
{
require
.
NoError
(
t
,
err
)
require
.
EqualValues
(
t
,
FilteredOVMETHAddresses
{
common
.
HexToAddress
(
"0x123"
),
},
addrs
)
},
},
{
name
:
"extra input allowances"
,
totalSupply
:
big
.
NewInt
(
1
),
expDiff
:
big
.
NewInt
(
0
),
stateBalances
:
map
[
common
.
Address
]
*
big
.
Int
{
common
.
HexToAddress
(
"0x123"
)
:
big
.
NewInt
(
1
),
},
stateAllowances
:
map
[
common
.
Address
]
common
.
Address
{
common
.
HexToAddress
(
"0x123"
)
:
common
.
HexToAddress
(
"0x456"
),
},
inputAddresses
:
[]
common
.
Address
{
common
.
HexToAddress
(
"0x123"
),
common
.
HexToAddress
(
"0x456"
),
},
inputAllowances
:
[]
*
crossdomain
.
Allowance
{
{
From
:
common
.
HexToAddress
(
"0x123"
),
To
:
common
.
HexToAddress
(
"0x456"
),
},
{
From
:
common
.
HexToAddress
(
"0x123"
),
To
:
common
.
HexToAddress
(
"0x789"
),
},
},
check
:
func
(
t
*
testing
.
T
,
addrs
FilteredOVMETHAddresses
,
err
error
)
{
require
.
NoError
(
t
,
err
)
require
.
EqualValues
(
t
,
FilteredOVMETHAddresses
{
common
.
HexToAddress
(
"0x123"
),
},
addrs
)
},
},
{
name
:
"missing input addresses"
,
totalSupply
:
big
.
NewInt
(
2
),
expDiff
:
big
.
NewInt
(
0
),
stateBalances
:
map
[
common
.
Address
]
*
big
.
Int
{
common
.
HexToAddress
(
"0x123"
)
:
big
.
NewInt
(
1
),
common
.
HexToAddress
(
"0x456"
)
:
big
.
NewInt
(
1
),
},
inputAddresses
:
[]
common
.
Address
{
common
.
HexToAddress
(
"0x123"
),
},
check
:
func
(
t
*
testing
.
T
,
addrs
FilteredOVMETHAddresses
,
err
error
)
{
require
.
Error
(
t
,
err
)
require
.
ErrorContains
(
t
,
err
,
"unknown storage slot"
)
},
},
{
name
:
"missing input allowances"
,
totalSupply
:
big
.
NewInt
(
2
),
expDiff
:
big
.
NewInt
(
0
),
stateBalances
:
map
[
common
.
Address
]
*
big
.
Int
{
common
.
HexToAddress
(
"0x123"
)
:
big
.
NewInt
(
1
),
},
stateAllowances
:
map
[
common
.
Address
]
common
.
Address
{
common
.
HexToAddress
(
"0x123"
)
:
common
.
HexToAddress
(
"0x456"
),
common
.
HexToAddress
(
"0x123"
)
:
common
.
HexToAddress
(
"0x789"
),
},
inputAddresses
:
[]
common
.
Address
{
common
.
HexToAddress
(
"0x123"
),
},
inputAllowances
:
[]
*
crossdomain
.
Allowance
{
{
From
:
common
.
HexToAddress
(
"0x123"
),
To
:
common
.
HexToAddress
(
"0x456"
),
},
},
check
:
func
(
t
*
testing
.
T
,
addrs
FilteredOVMETHAddresses
,
err
error
)
{
require
.
Error
(
t
,
err
)
require
.
ErrorContains
(
t
,
err
,
"unknown storage slot"
)
},
},
{
name
:
"bad supply diff"
,
totalSupply
:
big
.
NewInt
(
4
),
expDiff
:
big
.
NewInt
(
0
),
stateBalances
:
map
[
common
.
Address
]
*
big
.
Int
{
common
.
HexToAddress
(
"0x123"
)
:
big
.
NewInt
(
1
),
common
.
HexToAddress
(
"0x456"
)
:
big
.
NewInt
(
2
),
},
inputAddresses
:
[]
common
.
Address
{
common
.
HexToAddress
(
"0x123"
),
common
.
HexToAddress
(
"0x456"
),
},
check
:
func
(
t
*
testing
.
T
,
addrs
FilteredOVMETHAddresses
,
err
error
)
{
require
.
Error
(
t
,
err
)
require
.
ErrorContains
(
t
,
err
,
"supply mismatch"
)
},
},
{
name
:
"good supply diff"
,
totalSupply
:
big
.
NewInt
(
4
),
expDiff
:
big
.
NewInt
(
1
),
stateBalances
:
map
[
common
.
Address
]
*
big
.
Int
{
common
.
HexToAddress
(
"0x123"
)
:
big
.
NewInt
(
1
),
common
.
HexToAddress
(
"0x456"
)
:
big
.
NewInt
(
2
),
},
inputAddresses
:
[]
common
.
Address
{
common
.
HexToAddress
(
"0x123"
),
common
.
HexToAddress
(
"0x456"
),
},
check
:
func
(
t
*
testing
.
T
,
addrs
FilteredOVMETHAddresses
,
err
error
)
{
require
.
NoError
(
t
,
err
)
require
.
EqualValues
(
t
,
FilteredOVMETHAddresses
{
common
.
HexToAddress
(
"0x123"
),
common
.
HexToAddress
(
"0x456"
),
},
addrs
)
},
},
}
for
_
,
tt
:=
range
tests
{
t
.
Run
(
tt
.
name
,
func
(
t
*
testing
.
T
)
{
db
:=
makeLegacyETH
(
t
,
tt
.
totalSupply
,
tt
.
stateBalances
,
tt
.
stateAllowances
)
factory
:=
func
()
(
*
state
.
StateDB
,
error
)
{
return
db
,
nil
}
addrs
,
err
:=
doMigration
(
factory
,
tt
.
inputAddresses
,
tt
.
inputAllowances
,
tt
.
expDiff
,
false
)
// Sort the addresses since they come in in a random order.
sort
.
Slice
(
addrs
,
func
(
i
,
j
int
)
bool
{
return
bytes
.
Compare
(
addrs
[
i
][
:
],
addrs
[
j
][
:
])
<
0
})
tt
.
check
(
t
,
addrs
,
err
)
})
}
}
func
makeLegacyETH
(
t
*
testing
.
T
,
totalSupply
*
big
.
Int
,
balances
map
[
common
.
Address
]
*
big
.
Int
,
allowances
map
[
common
.
Address
]
common
.
Address
)
*
state
.
StateDB
{
db
,
err
:=
state
.
New
(
common
.
Hash
{},
state
.
NewDatabaseWithConfig
(
rawdb
.
NewMemoryDatabase
(),
&
trie
.
Config
{
Preimages
:
true
,
Cache
:
1024
,
}),
nil
)
require
.
NoError
(
t
,
err
)
db
.
CreateAccount
(
OVMETHAddress
)
db
.
SetState
(
OVMETHAddress
,
getOVMETHTotalSupplySlot
(),
common
.
BigToHash
(
totalSupply
))
for
slot
:=
range
ignoredSlots
{
if
slot
==
getOVMETHTotalSupplySlot
()
{
continue
}
db
.
SetState
(
OVMETHAddress
,
slot
,
common
.
Hash
{
31
:
0xff
})
}
for
addr
,
balance
:=
range
balances
{
db
.
SetState
(
OVMETHAddress
,
CalcOVMETHStorageKey
(
addr
),
common
.
BigToHash
(
balance
))
}
for
from
,
to
:=
range
allowances
{
db
.
SetState
(
OVMETHAddress
,
CalcAllowanceStorageKey
(
from
,
to
),
common
.
BigToHash
(
big
.
NewInt
(
1
)))
}
root
,
err
:=
db
.
Commit
(
false
)
require
.
NoError
(
t
,
err
)
err
=
db
.
Database
()
.
TrieDB
()
.
Commit
(
root
,
true
)
require
.
NoError
(
t
,
err
)
return
db
}
// TestPreCheckBalancesRandom tests that the pre-check balances function works
// with random addresses. This test makes sure that the partition logic doesn't
// miss anything.
func
TestPreCheckBalancesRandom
(
t
*
testing
.
T
)
{
addresses
:=
make
([]
common
.
Address
,
0
)
stateBalances
:=
make
(
map
[
common
.
Address
]
*
big
.
Int
)
allowances
:=
make
([]
*
crossdomain
.
Allowance
,
0
)
stateAllowances
:=
make
(
map
[
common
.
Address
]
common
.
Address
)
totalSupply
:=
big
.
NewInt
(
0
)
for
i
:=
0
;
i
<
100
;
i
++
{
for
i
:=
0
;
i
<
rand
.
Intn
(
1000
);
i
++
{
addr
:=
randAddr
(
t
)
addresses
=
append
(
addresses
,
addr
)
stateBalances
[
addr
]
=
big
.
NewInt
(
int64
(
rand
.
Intn
(
1
_000_000
)))
totalSupply
=
new
(
big
.
Int
)
.
Add
(
totalSupply
,
stateBalances
[
addr
])
}
sort
.
Slice
(
addresses
,
func
(
i
,
j
int
)
bool
{
return
bytes
.
Compare
(
addresses
[
i
][
:
],
addresses
[
j
][
:
])
<
0
})
for
i
:=
0
;
i
<
rand
.
Intn
(
1000
);
i
++
{
addr
:=
randAddr
(
t
)
to
:=
randAddr
(
t
)
allowances
=
append
(
allowances
,
&
crossdomain
.
Allowance
{
From
:
addr
,
To
:
to
,
})
stateAllowances
[
addr
]
=
to
}
db
:=
makeLegacyETH
(
t
,
totalSupply
,
stateBalances
,
stateAllowances
)
factory
:=
func
()
(
*
state
.
StateDB
,
error
)
{
return
db
,
nil
}
outAddrs
,
err
:=
doMigration
(
factory
,
addresses
,
allowances
,
big
.
NewInt
(
0
),
false
)
require
.
NoError
(
t
,
err
)
sort
.
Slice
(
outAddrs
,
func
(
i
,
j
int
)
bool
{
return
bytes
.
Compare
(
outAddrs
[
i
][
:
],
outAddrs
[
j
][
:
])
<
0
})
require
.
EqualValues
(
t
,
addresses
,
outAddrs
)
}
}
func
randAddr
(
t
*
testing
.
T
)
common
.
Address
{
var
addr
common
.
Address
_
,
err
:=
rand
.
Read
(
addr
[
:
])
require
.
NoError
(
t
,
err
)
return
addr
}
op-chain-ops/genesis/check.go
View file @
bb26427b
...
...
@@ -7,6 +7,8 @@ import (
"fmt"
"math/big"
"github.com/ethereum-optimism/optimism/op-chain-ops/ether"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/core/state"
...
...
@@ -251,7 +253,7 @@ func PostCheckPredeploys(prevDB, currDB *state.StateDB) error {
// Balances and nonces should match legacy
oldNonce
:=
prevDB
.
GetNonce
(
addr
)
oldBalance
:=
prevDB
.
GetBalance
(
addr
)
oldBalance
:=
ether
.
GetOVMETHBalance
(
prevDB
,
addr
)
newNonce
:=
currDB
.
GetNonce
(
addr
)
newBalance
:=
currDB
.
GetBalance
(
addr
)
if
oldNonce
!=
newNonce
{
...
...
@@ -543,7 +545,7 @@ func CheckWithdrawalsAfter(db vm.StateDB, data crossdomain.MigrationData, l1Cros
// If the sender is _not_ the L2XDM, the value should not be migrated.
wd
:=
wdsByOldSlot
[
key
]
if
wd
.
XDomain
Sender
==
predeploys
.
L2CrossDomainMessengerAddr
{
if
wd
.
Message
Sender
==
predeploys
.
L2CrossDomainMessengerAddr
{
// Make sure the value is abiTrue if this withdrawal should be migrated.
if
migratedValue
!=
abiTrue
{
innerErr
=
fmt
.
Errorf
(
"expected migrated value to be true, but got %s"
,
migratedValue
)
...
...
@@ -552,7 +554,7 @@ func CheckWithdrawalsAfter(db vm.StateDB, data crossdomain.MigrationData, l1Cros
}
else
{
// Otherwise, ensure that withdrawals from senders other than the L2XDM are _not_ migrated.
if
migratedValue
!=
abiFalse
{
innerErr
=
fmt
.
Errorf
(
"a migration from a sender other than the L2XDM was migrated
"
)
innerErr
=
fmt
.
Errorf
(
"a migration from a sender other than the L2XDM was migrated
. sender: %s, migrated value: %s"
,
wd
.
MessageSender
,
migratedValue
)
return
false
}
}
...
...
op-chain-ops/genesis/db_migration.go
View file @
bb26427b
...
...
@@ -82,6 +82,7 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
)
}
dbFactory
:=
func
()
(
*
state
.
StateDB
,
error
)
{
// Set up the backing store.
underlyingDB
:=
state
.
NewDatabaseWithConfig
(
ldb
,
&
trie
.
Config
{
Preimages
:
true
,
...
...
@@ -94,6 +95,14 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
return
nil
,
fmt
.
Errorf
(
"cannot open StateDB: %w"
,
err
)
}
return
db
,
nil
}
db
,
err
:=
dbFactory
()
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"cannot create StateDB: %w"
,
err
)
}
// Before we do anything else, we need to ensure that all of the input configuration is correct
// and nothing is missing. We'll first verify the contract configuration, then we'll verify the
// witness data for the migration. We operate under the assumption that the witness data is
...
...
@@ -139,7 +148,7 @@ func MigrateDB(ldb ethdb.Database, config *DeployConfig, l1Block *types.Block, m
// Unlike with withdrawals, we do not need to filter out extra addresses because their balances
// would necessarily be zero and therefore not affect the migration.
log
.
Info
(
"Checking addresses..."
,
"no-check"
,
noCheck
)
addrs
,
err
:=
ether
.
PreCheckBalances
(
ldb
,
db
,
migrationData
.
Addresses
(),
migrationData
.
OvmAllowances
,
int
(
config
.
L1ChainID
),
noCheck
)
addrs
,
err
:=
ether
.
PreCheckBalances
(
dbFactory
,
migrationData
.
Addresses
(),
migrationData
.
OvmAllowances
,
int
(
config
.
L1ChainID
),
noCheck
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"addresses mismatch: %w"
,
err
)
}
...
...
op-node/cmd/batch_decoder/README.md
View file @
bb26427b
...
...
@@ -26,6 +26,16 @@ the transaction hash.
into channels. It then stores the channels with metadata on disk where the file name is the Channel ID.
### Force Close
`batch_decoder force-close`
will create a transaction data that can be sent from the batcher address to
the batch inbox address which will force close the given channels. This will allow future channels to
be read without waiting for the channel timeout. It uses uses the results from
`batch_decoder fetch`
to
create the close transaction because the transaction it creates for a specific channel requires information
about if the channel has been closed or not. If it has been closed already but is missing specific frames
those frames need to be generated differently than simply closing the channel.
## JQ Cheat Sheet
`jq`
is a really useful utility for manipulating JSON files.
...
...
@@ -48,7 +58,6 @@ jq "select(.is_ready == false)|[.id, .frames[0].inclusion_block, .frames[0].tran
## Roadmap
-
Parallel transaction fetching (CLI-3563)
-
Create force-close channel tx data from channel ID (CLI-3564)
-
Pull the batches out of channels & store that information inside the ChannelWithMetadata (CLI-3565)
-
Transaction Bytes used
-
Total uncompressed (different from tx bytes) + compressed bytes
...
...
op-node/cmd/batch_decoder/main.go
View file @
bb26427b
...
...
@@ -9,6 +9,7 @@ import (
"github.com/ethereum-optimism/optimism/op-node/cmd/batch_decoder/fetch"
"github.com/ethereum-optimism/optimism/op-node/cmd/batch_decoder/reassemble"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/urfave/cli"
...
...
@@ -113,6 +114,46 @@ func main() {
return
nil
},
},
{
Name
:
"force-close"
,
Usage
:
"Create the tx data which will force close a channel"
,
Flags
:
[]
cli
.
Flag
{
cli
.
StringFlag
{
Name
:
"id"
,
Required
:
true
,
Usage
:
"ID of the channel to close"
,
},
cli
.
StringFlag
{
Name
:
"inbox"
,
Value
:
"0x0000000000000000000000000000000000000000"
,
Usage
:
"(Optional) Batch Inbox Address"
,
},
cli
.
StringFlag
{
Name
:
"in"
,
Value
:
"/tmp/batch_decoder/transactions_cache"
,
Usage
:
"Cache directory for the found transactions"
,
},
},
Action
:
func
(
cliCtx
*
cli
.
Context
)
error
{
var
id
derive
.
ChannelID
if
err
:=
(
&
id
)
.
UnmarshalText
([]
byte
(
cliCtx
.
String
(
"id"
)));
err
!=
nil
{
log
.
Fatal
(
err
)
}
frames
:=
reassemble
.
LoadFrames
(
cliCtx
.
String
(
"in"
),
common
.
HexToAddress
(
cliCtx
.
String
(
"inbox"
)))
var
filteredFrames
[]
derive
.
Frame
for
_
,
frame
:=
range
frames
{
if
frame
.
Frame
.
ID
==
id
{
filteredFrames
=
append
(
filteredFrames
,
frame
.
Frame
)
}
}
data
,
err
:=
derive
.
ForceCloseTxData
(
filteredFrames
)
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
fmt
.
Printf
(
"%x
\n
"
,
data
)
return
nil
},
},
}
if
err
:=
app
.
Run
(
os
.
Args
);
err
!=
nil
{
...
...
op-node/cmd/batch_decoder/reassemble/reassemble.go
View file @
bb26427b
...
...
@@ -38,14 +38,8 @@ type Config struct {
OutDirectory
string
}
// Channels loads all transactions from the given input directory that are submitted to the
// specified batch inbox and then re-assembles all channels & writes the re-assembled channels
// to the out directory.
func
Channels
(
config
Config
)
{
if
err
:=
os
.
MkdirAll
(
config
.
OutDirectory
,
0750
);
err
!=
nil
{
log
.
Fatal
(
err
)
}
txns
:=
loadTransactions
(
config
.
InDirectory
,
config
.
BatchInbox
)
func
LoadFrames
(
directory
string
,
inbox
common
.
Address
)
[]
FrameWithMetadata
{
txns
:=
loadTransactions
(
directory
,
inbox
)
// Sort first by block number then by transaction index inside the block number range.
// This is to match the order they are processed in derivation.
sort
.
Slice
(
txns
,
func
(
i
,
j
int
)
bool
{
...
...
@@ -56,7 +50,17 @@ func Channels(config Config) {
}
})
frames
:=
transactionsToFrames
(
txns
)
return
transactionsToFrames
(
txns
)
}
// Channels loads all transactions from the given input directory that are submitted to the
// specified batch inbox and then re-assembles all channels & writes the re-assembled channels
// to the out directory.
func
Channels
(
config
Config
)
{
if
err
:=
os
.
MkdirAll
(
config
.
OutDirectory
,
0750
);
err
!=
nil
{
log
.
Fatal
(
err
)
}
frames
:=
LoadFrames
(
config
.
InDirectory
,
config
.
BatchInbox
)
framesByChannel
:=
make
(
map
[
derive
.
ChannelID
][]
FrameWithMetadata
)
for
_
,
frame
:=
range
frames
{
framesByChannel
[
frame
.
Frame
.
ID
]
=
append
(
framesByChannel
[
frame
.
Frame
.
ID
],
frame
)
...
...
@@ -143,6 +147,7 @@ func transactionsToFrames(txns []fetch.TransactionWithMetadata) []FrameWithMetad
return
out
}
// if inbox is the zero address, it will load all frames
func
loadTransactions
(
dir
string
,
inbox
common
.
Address
)
[]
fetch
.
TransactionWithMetadata
{
files
,
err
:=
os
.
ReadDir
(
dir
)
if
err
!=
nil
{
...
...
@@ -152,7 +157,7 @@ func loadTransactions(dir string, inbox common.Address) []fetch.TransactionWithM
for
_
,
file
:=
range
files
{
f
:=
path
.
Join
(
dir
,
file
.
Name
())
txm
:=
loadTransactionsFile
(
f
)
if
txm
.
InboxAddr
==
inbox
&&
txm
.
ValidSender
{
if
(
inbox
==
common
.
Address
{}
||
txm
.
InboxAddr
==
inbox
)
&&
txm
.
ValidSender
{
out
=
append
(
out
,
txm
)
}
}
...
...
op-node/rollup/derive/channel_out.go
View file @
bb26427b
...
...
@@ -213,3 +213,58 @@ func BlockToBatch(block *types.Block) (*BatchData, error) {
},
},
nil
}
// ForceCloseTxData generates the transaction data for a transaction which will force close
// a channel. It should be given every frame of that channel which has been submitted on
// chain. The frames should be given in order that they appear on L1.
func
ForceCloseTxData
(
frames
[]
Frame
)
([]
byte
,
error
)
{
if
len
(
frames
)
==
0
{
return
nil
,
errors
.
New
(
"must provide at least one frame"
)
}
frameNumbers
:=
make
(
map
[
uint16
]
struct
{})
id
:=
frames
[
0
]
.
ID
closeNumber
:=
uint16
(
0
)
closed
:=
false
for
i
,
frame
:=
range
frames
{
if
!
closed
&&
frame
.
IsLast
{
closeNumber
=
frame
.
FrameNumber
}
closed
=
closed
||
frame
.
IsLast
frameNumbers
[
frame
.
FrameNumber
]
=
struct
{}{}
if
frame
.
ID
!=
id
{
return
nil
,
fmt
.
Errorf
(
"invalid ID in list: first ID: %v, %vth ID: %v"
,
id
,
i
,
frame
.
ID
)
}
}
var
out
bytes
.
Buffer
out
.
WriteByte
(
DerivationVersion0
)
if
!
closed
{
f
:=
Frame
{
ID
:
id
,
FrameNumber
:
0
,
Data
:
nil
,
IsLast
:
true
,
}
if
err
:=
f
.
MarshalBinary
(
&
out
);
err
!=
nil
{
return
nil
,
err
}
}
else
{
for
i
:=
uint16
(
0
);
i
<=
closeNumber
;
i
++
{
if
_
,
ok
:=
frameNumbers
[
i
];
ok
{
continue
}
f
:=
Frame
{
ID
:
id
,
FrameNumber
:
i
,
Data
:
nil
,
IsLast
:
false
,
}
if
err
:=
f
.
MarshalBinary
(
&
out
);
err
!=
nil
{
return
nil
,
err
}
}
}
return
out
.
Bytes
(),
nil
}
op-node/rollup/derive/channel_out_test.go
View file @
bb26427b
...
...
@@ -5,6 +5,7 @@ import (
"math/big"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rlp"
"github.com/stretchr/testify/require"
...
...
@@ -49,3 +50,69 @@ func TestRLPByteLimit(t *testing.T) {
require
.
Equal
(
t
,
err
,
rlp
.
ErrValueTooLarge
)
require
.
Equal
(
t
,
out2
,
""
)
}
func
TestForceCloseTxData
(
t
*
testing
.
T
)
{
id
:=
[
16
]
byte
{
0xde
,
0xad
,
0xbe
,
0xef
,
0xde
,
0xad
,
0xbe
,
0xef
,
0xde
,
0xad
,
0xbe
,
0xef
,
0xde
,
0xad
,
0xbe
,
0xef
}
tests
:=
[]
struct
{
frames
[]
Frame
errors
bool
output
string
}{
{
frames
:
[]
Frame
{},
errors
:
true
,
output
:
""
,
},
{
frames
:
[]
Frame
{
Frame
{
FrameNumber
:
0
,
IsLast
:
false
},
Frame
{
ID
:
id
,
FrameNumber
:
1
,
IsLast
:
true
}},
errors
:
true
,
output
:
""
,
},
{
frames
:
[]
Frame
{
Frame
{
ID
:
id
,
FrameNumber
:
0
,
IsLast
:
false
}},
errors
:
false
,
output
:
"00deadbeefdeadbeefdeadbeefdeadbeef00000000000001"
,
},
{
frames
:
[]
Frame
{
Frame
{
ID
:
id
,
FrameNumber
:
0
,
IsLast
:
true
}},
errors
:
false
,
output
:
"00"
,
},
{
frames
:
[]
Frame
{
Frame
{
ID
:
id
,
FrameNumber
:
1
,
IsLast
:
false
}},
errors
:
false
,
output
:
"00deadbeefdeadbeefdeadbeefdeadbeef00000000000001"
,
},
{
frames
:
[]
Frame
{
Frame
{
ID
:
id
,
FrameNumber
:
1
,
IsLast
:
true
}},
errors
:
false
,
output
:
"00deadbeefdeadbeefdeadbeefdeadbeef00000000000000"
,
},
{
frames
:
[]
Frame
{
Frame
{
ID
:
id
,
FrameNumber
:
2
,
IsLast
:
true
}},
errors
:
false
,
output
:
"00deadbeefdeadbeefdeadbeefdeadbeef00000000000000deadbeefdeadbeefdeadbeefdeadbeef00010000000000"
,
},
{
frames
:
[]
Frame
{
Frame
{
ID
:
id
,
FrameNumber
:
1
,
IsLast
:
false
},
Frame
{
ID
:
id
,
FrameNumber
:
3
,
IsLast
:
true
}},
errors
:
false
,
output
:
"00deadbeefdeadbeefdeadbeefdeadbeef00000000000000deadbeefdeadbeefdeadbeefdeadbeef00020000000000"
,
},
{
frames
:
[]
Frame
{
Frame
{
ID
:
id
,
FrameNumber
:
1
,
IsLast
:
false
},
Frame
{
ID
:
id
,
FrameNumber
:
3
,
IsLast
:
true
},
Frame
{
ID
:
id
,
FrameNumber
:
5
,
IsLast
:
true
}},
errors
:
false
,
output
:
"00deadbeefdeadbeefdeadbeefdeadbeef00000000000000deadbeefdeadbeefdeadbeefdeadbeef00020000000000"
,
},
}
for
i
,
test
:=
range
tests
{
out
,
err
:=
ForceCloseTxData
(
test
.
frames
)
if
test
.
errors
{
require
.
NotNil
(
t
,
err
,
"Should error on tc %v"
,
i
)
require
.
Nil
(
t
,
out
,
"Should return no value in tc %v"
,
i
)
}
else
{
require
.
NoError
(
t
,
err
,
"Should not error on tc %v"
,
i
)
require
.
Equal
(
t
,
common
.
FromHex
(
test
.
output
),
out
,
"Should match output tc %v"
,
i
)
}
}
}
op-node/rollup/types.go
View file @
bb26427b
...
...
@@ -157,7 +157,7 @@ func (cfg *Config) CheckL2ChainID(ctx context.Context, client L2Client) error {
return
err
}
if
cfg
.
L2ChainID
.
Cmp
(
id
)
!=
0
{
return
fmt
.
Errorf
(
"incorrect L2 RPC chain id
%d, expected
%d"
,
cfg
.
L2ChainID
,
id
)
return
fmt
.
Errorf
(
"incorrect L2 RPC chain id
, expected from config %d, obtained from client
%d"
,
cfg
.
L2ChainID
,
id
)
}
return
nil
}
...
...
packages/actor-tests/CHANGELOG.md
View file @
bb26427b
# @eth-optimism/actor-tests
## 0.0.23
### Patch Changes
-
Updated dependencies
[
22c3885f5
]
-
Updated dependencies
[
66cafc00a
]
-
Updated dependencies
[
f52c07529
]
-
@eth-optimism/contracts-bedrock@0.13.1
-
@eth-optimism/sdk@2.0.1
## 0.0.22
### Patch Changes
...
...
packages/actor-tests/package.json
View file @
bb26427b
{
"name"
:
"@eth-optimism/actor-tests"
,
"version"
:
"0.0.2
2
"
,
"version"
:
"0.0.2
3
"
,
"description"
:
"A library and suite of tests to stress test Optimism Bedrock."
,
"license"
:
"MIT"
,
"author"
:
""
,
...
...
@@ -18,9 +18,9 @@
"test:coverage"
:
"yarn test"
},
"dependencies"
:
{
"@eth-optimism/contracts-bedrock"
:
"0.13.
0
"
,
"@eth-optimism/contracts-bedrock"
:
"0.13.
1
"
,
"@eth-optimism/core-utils"
:
"^0.12.0"
,
"@eth-optimism/sdk"
:
"^2.0.
0
"
,
"@eth-optimism/sdk"
:
"^2.0.
1
"
,
"@types/chai"
:
"^4.2.18"
,
"@types/chai-as-promised"
:
"^7.1.4"
,
"async-mutex"
:
"^0.3.2"
,
...
...
packages/atst/CHANGELOG.md
View file @
bb26427b
# @eth-optimism/atst
## 0.2.0
### Minor Changes
-
dcd13eec1: Update readAttestations and prepareWriteAttestation to handle keys longer than 32 bytes
-
9fd5be8e2: Remove broken allowFailures as option
-
3f4a43542: Move react api to @eth-optimism/atst/react so react isn't required to run the core sdk
-
71727eae9: Fix main and module in atst package.json
-
3d5f26c49: Deprecate parseAttestationBytes and createRawKey in favor for createKey, createValue
### Patch Changes
-
68bbe48b6: Update docs
-
6fea2f2db: Fixed bug with atst not defaulting to currently connected chain
## 0.1.0
### Minor Changes
...
...
packages/atst/package.json
View file @
bb26427b
{
"name"
:
"@eth-optimism/atst"
,
"version"
:
"0.
1
.0"
,
"version"
:
"0.
2
.0"
,
"type"
:
"module"
,
"main"
:
"dist/index.cjs"
,
"types"
:
"src/index.ts"
,
...
...
packages/chain-mon/CHANGELOG.md
View file @
bb26427b
# @eth-optimism/drippie-mon
## 0.2.1
### Patch Changes
-
Updated dependencies
[
fecd42d67
]
-
Updated dependencies
[
66cafc00a
]
-
@eth-optimism/common-ts@0.8.1
-
@eth-optimism/sdk@2.0.1
## 0.2.0
### Minor Changes
...
...
packages/chain-mon/package.json
View file @
bb26427b
{
"private"
:
true
,
"name"
:
"@eth-optimism/chain-mon"
,
"version"
:
"0.2.
0
"
,
"version"
:
"0.2.
1
"
,
"description"
:
"[Optimism] Chain monitoring services"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
@@ -32,10 +32,10 @@
"url"
:
"https://github.com/ethereum-optimism/optimism.git"
},
"dependencies"
:
{
"@eth-optimism/common-ts"
:
"0.8.
0
"
,
"@eth-optimism/common-ts"
:
"0.8.
1
"
,
"@eth-optimism/contracts-periphery"
:
"1.0.7"
,
"@eth-optimism/core-utils"
:
"0.12.0"
,
"@eth-optimism/sdk"
:
"2.0.
0
"
,
"@eth-optimism/sdk"
:
"2.0.
1
"
,
"ethers"
:
"^5.7.0"
,
"@types/dateformat"
:
"^5.0.0"
,
"chai-as-promised"
:
"^7.1.1"
,
...
...
packages/common-ts/CHANGELOG.md
View file @
bb26427b
# @eth-optimism/common-ts
## 0.8.1
### Patch Changes
-
fecd42d67: Fix BaseServiceV2 configuration for caseCase options
## 0.8.0
### Minor Changes
...
...
packages/common-ts/package.json
View file @
bb26427b
{
"name"
:
"@eth-optimism/common-ts"
,
"version"
:
"0.8.
0
"
,
"version"
:
"0.8.
1
"
,
"description"
:
"[Optimism] Advanced typescript tooling used by various services"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
packages/contracts-bedrock/CHANGELOG.md
View file @
bb26427b
# @eth-optimism/contracts-bedrock
## 0.13.1
### Patch Changes
-
22c3885f5: Optionally print cast commands during migration
-
f52c07529: Print tenderly simulation links during deployment
## 0.13.0
### Minor Changes
...
...
packages/contracts-bedrock/package.json
View file @
bb26427b
{
"name"
:
"@eth-optimism/contracts-bedrock"
,
"version"
:
"0.13.
0
"
,
"version"
:
"0.13.
1
"
,
"description"
:
"Contracts for Optimism Specs"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
packages/contracts-periphery/package.json
View file @
bb26427b
...
...
@@ -53,7 +53,7 @@
"url"
:
"https://github.com/ethereum-optimism/optimism.git"
},
"devDependencies"
:
{
"@eth-optimism/contracts-bedrock"
:
"0.13.
0
"
,
"@eth-optimism/contracts-bedrock"
:
"0.13.
1
"
,
"@eth-optimism/core-utils"
:
"^0.12.0"
,
"@eth-optimism/hardhat-deploy-config"
:
"^0.2.5"
,
"@ethersproject/hardware-wallets"
:
"^5.7.0"
,
...
...
packages/data-transport-layer/CHANGELOG.md
View file @
bb26427b
# data transport layer
## 0.5.54
### Patch Changes
-
Updated dependencies
[
fecd42d67
]
-
@eth-optimism/common-ts@0.8.1
## 0.5.53
### Patch Changes
...
...
packages/data-transport-layer/package.json
View file @
bb26427b
{
"private"
:
true
,
"name"
:
"@eth-optimism/data-transport-layer"
,
"version"
:
"0.5.5
3
"
,
"version"
:
"0.5.5
4
"
,
"description"
:
"[Optimism] Service for shuttling data from L1 into L2"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
@@ -36,7 +36,7 @@
"url"
:
"https://github.com/ethereum-optimism/optimism.git"
},
"dependencies"
:
{
"@eth-optimism/common-ts"
:
"0.8.
0
"
,
"@eth-optimism/common-ts"
:
"0.8.
1
"
,
"@eth-optimism/contracts"
:
"0.5.40"
,
"@eth-optimism/core-utils"
:
"0.12.0"
,
"@ethersproject/providers"
:
"^5.7.0"
,
...
...
packages/fault-detector/CHANGELOG.md
View file @
bb26427b
# @eth-optimism/fault-detector
## 0.6.2
### Patch Changes
-
f9b579d55: Fixes a bug that would cause the fault detector to error out if no outputs had been proposed yet.
-
Updated dependencies
[
fecd42d67
]
-
Updated dependencies
[
66cafc00a
]
-
@eth-optimism/common-ts@0.8.1
-
@eth-optimism/sdk@2.0.1
## 0.6.1
### Patch Changes
...
...
packages/fault-detector/package.json
View file @
bb26427b
{
"private"
:
true
,
"name"
:
"@eth-optimism/fault-detector"
,
"version"
:
"0.6.
1
"
,
"version"
:
"0.6.
2
"
,
"description"
:
"[Optimism] Service for detecting faulty L2 output proposals"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
@@ -47,10 +47,10 @@
"ts-node"
:
"^10.9.1"
},
"dependencies"
:
{
"@eth-optimism/common-ts"
:
"^0.8.
0
"
,
"@eth-optimism/common-ts"
:
"^0.8.
1
"
,
"@eth-optimism/contracts"
:
"^0.5.40"
,
"@eth-optimism/core-utils"
:
"^0.12.0"
,
"@eth-optimism/sdk"
:
"^2.0.
0
"
,
"@eth-optimism/sdk"
:
"^2.0.
1
"
,
"@ethersproject/abstract-provider"
:
"^5.7.0"
}
}
packages/message-relayer/CHANGELOG.md
View file @
bb26427b
# @eth-optimism/message-relayer
## 0.5.32
### Patch Changes
-
Updated dependencies
[
fecd42d67
]
-
Updated dependencies
[
66cafc00a
]
-
@eth-optimism/common-ts@0.8.1
-
@eth-optimism/sdk@2.0.1
## 0.5.31
### Patch Changes
...
...
packages/message-relayer/package.json
View file @
bb26427b
{
"private"
:
true
,
"name"
:
"@eth-optimism/message-relayer"
,
"version"
:
"0.5.3
1
"
,
"version"
:
"0.5.3
2
"
,
"description"
:
"[Optimism] Service for automatically relaying L2 to L1 transactions"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
@@ -31,9 +31,9 @@
"url"
:
"https://github.com/ethereum-optimism/optimism.git"
},
"dependencies"
:
{
"@eth-optimism/common-ts"
:
"0.8.
0
"
,
"@eth-optimism/common-ts"
:
"0.8.
1
"
,
"@eth-optimism/core-utils"
:
"0.12.0"
,
"@eth-optimism/sdk"
:
"2.0.
0
"
,
"@eth-optimism/sdk"
:
"2.0.
1
"
,
"ethers"
:
"^5.7.0"
},
"devDependencies"
:
{
...
...
packages/replica-healthcheck/CHANGELOG.md
View file @
bb26427b
# @eth-optimism/replica-healthcheck
## 1.2.3
### Patch Changes
-
Updated dependencies
[
fecd42d67
]
-
@eth-optimism/common-ts@0.8.1
## 1.2.2
### Patch Changes
...
...
packages/replica-healthcheck/package.json
View file @
bb26427b
{
"private"
:
true
,
"name"
:
"@eth-optimism/replica-healthcheck"
,
"version"
:
"1.2.
2
"
,
"version"
:
"1.2.
3
"
,
"description"
:
"[Optimism] Service for monitoring the health of replica nodes"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
@@ -32,7 +32,7 @@
"url"
:
"https://github.com/ethereum-optimism/optimism.git"
},
"dependencies"
:
{
"@eth-optimism/common-ts"
:
"0.8.
0
"
,
"@eth-optimism/common-ts"
:
"0.8.
1
"
,
"@eth-optimism/core-utils"
:
"0.12.0"
,
"@ethersproject/abstract-provider"
:
"^5.7.0"
},
...
...
packages/sdk/CHANGELOG.md
View file @
bb26427b
# @eth-optimism/sdk
## 2.0.1
### Patch Changes
-
66cafc00a: Update migrated withdrawal gaslimit calculation
-
Updated dependencies
[
22c3885f5
]
-
Updated dependencies
[
f52c07529
]
-
@eth-optimism/contracts-bedrock@0.13.1
## 2.0.0
### Major Changes
...
...
packages/sdk/package.json
View file @
bb26427b
{
"name"
:
"@eth-optimism/sdk"
,
"version"
:
"2.0.
0
"
,
"version"
:
"2.0.
1
"
,
"description"
:
"[Optimism] Tools for working with Optimism"
,
"main"
:
"dist/index"
,
"types"
:
"dist/index"
,
...
...
@@ -50,7 +50,7 @@
"dependencies"
:
{
"@eth-optimism/contracts"
:
"0.5.40"
,
"@eth-optimism/core-utils"
:
"0.12.0"
,
"@eth-optimism/contracts-bedrock"
:
"0.13.
0
"
,
"@eth-optimism/contracts-bedrock"
:
"0.13.
1
"
,
"lodash"
:
"^4.17.21"
,
"merkletreejs"
:
"^0.2.27"
,
"rlp"
:
"^2.2.7"
...
...
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