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
16481af9
Unverified
Commit
16481af9
authored
Jul 13, 2022
by
mergify[bot]
Committed by
GitHub
Jul 13, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into jg/fix_ci
parents
e8909be0
c7751192
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
338 additions
and
250 deletions
+338
-250
lazy-seahorses-hug.md
.changeset/lazy-seahorses-hug.md
+5
-0
wild-rivers-guess.md
.changeset/wild-rivers-guess.md
+5
-0
system_test.go
op-e2e/system_test.go
+13
-1
api.go
op-node/node/api.go
+8
-0
config.go
op-node/node/config.go
+4
-0
rollupclient.go
op-proposer/rollupclient/rollupclient.go
+7
-0
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+175
-175
LegacyERC20ETH.sol
...ges/contracts-bedrock/contracts/legacy/LegacyERC20ETH.sol
+16
-41
L1CrossDomainMessenger.t.sol
...racts-bedrock/contracts/test/L1CrossDomainMessenger.t.sol
+0
-1
L1StandardBridge.t.sol
...s/contracts-bedrock/contracts/test/L1StandardBridge.t.sol
+2
-1
L2OutputOracle.t.sol
...ges/contracts-bedrock/contracts/test/L2OutputOracle.t.sol
+12
-2
L2StandardBridge.t.sol
...s/contracts-bedrock/contracts/test/L2StandardBridge.t.sol
+2
-1
OptimismPortal.t.sol
...ges/contracts-bedrock/contracts/test/OptimismPortal.t.sol
+2
-2
Proxy.t.sol
packages/contracts-bedrock/contracts/test/Proxy.t.sol
+3
-3
ResourceMetering.t.sol
...s/contracts-bedrock/contracts/test/ResourceMetering.t.sol
+2
-2
SequencerFeeVault.t.sol
.../contracts-bedrock/contracts/test/SequencerFeeVault.t.sol
+2
-1
service.ts
packages/fault-detector/src/service.ts
+80
-20
No files found.
.changeset/lazy-seahorses-hug.md
0 → 100644
View file @
16481af9
---
'
@eth-optimism/contracts-bedrock'
:
patch
---
Cleans up various compiler warnings
.changeset/wild-rivers-guess.md
0 → 100644
View file @
16481af9
---
'
@eth-optimism/fault-detector'
:
patch
---
Properly handle connection failures for L2 node
op-e2e/system_test.go
View file @
16481af9
...
@@ -165,7 +165,7 @@ func TestL2OutputSubmitter(t *testing.T) {
...
@@ -165,7 +165,7 @@ func TestL2OutputSubmitter(t *testing.T) {
l1Client
:=
sys
.
Clients
[
"l1"
]
l1Client
:=
sys
.
Clients
[
"l1"
]
rollupRPCClient
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
fmt
.
Sprintf
(
"http://%s:%d"
,
cfg
.
Nodes
[
"sequencer"
]
.
RPC
.
ListenAddr
,
cfg
.
Nodes
[
"sequencer"
]
.
RPC
.
ListenPort
))
rollupRPCClient
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
cfg
.
Nodes
[
"sequencer"
]
.
RPC
.
HttpEndpoint
(
))
require
.
Nil
(
t
,
err
)
require
.
Nil
(
t
,
err
)
rollupClient
:=
rollupclient
.
NewRollupClient
(
rollupRPCClient
)
rollupClient
:=
rollupclient
.
NewRollupClient
(
rollupRPCClient
)
...
@@ -326,6 +326,18 @@ func TestSystemE2E(t *testing.T) {
...
@@ -326,6 +326,18 @@ func TestSystemE2E(t *testing.T) {
require
.
Equal
(
t
,
verifBlock
.
NumberU64
(),
seqBlock
.
NumberU64
(),
"Verifier and sequencer blocks not the same after including a batch tx"
)
require
.
Equal
(
t
,
verifBlock
.
NumberU64
(),
seqBlock
.
NumberU64
(),
"Verifier and sequencer blocks not the same after including a batch tx"
)
require
.
Equal
(
t
,
verifBlock
.
ParentHash
(),
seqBlock
.
ParentHash
(),
"Verifier and sequencer blocks parent hashes not the same after including a batch tx"
)
require
.
Equal
(
t
,
verifBlock
.
ParentHash
(),
seqBlock
.
ParentHash
(),
"Verifier and sequencer blocks parent hashes not the same after including a batch tx"
)
require
.
Equal
(
t
,
verifBlock
.
Hash
(),
seqBlock
.
Hash
(),
"Verifier and sequencer blocks not the same after including a batch tx"
)
require
.
Equal
(
t
,
verifBlock
.
Hash
(),
seqBlock
.
Hash
(),
"Verifier and sequencer blocks not the same after including a batch tx"
)
rollupRPCClient
,
err
:=
rpc
.
DialContext
(
context
.
Background
(),
cfg
.
Nodes
[
"sequencer"
]
.
RPC
.
HttpEndpoint
())
require
.
Nil
(
t
,
err
)
rollupClient
:=
rollupclient
.
NewRollupClient
(
rollupRPCClient
)
// basic check that sync status works
seqStatus
,
err
:=
rollupClient
.
SyncStatus
(
context
.
Background
())
require
.
Nil
(
t
,
err
)
require
.
LessOrEqual
(
t
,
seqBlock
.
NumberU64
(),
seqStatus
.
UnsafeL2
.
Number
)
// basic check that version endpoint works
seqVersion
,
err
:=
rollupClient
.
Version
(
context
.
Background
())
require
.
Nil
(
t
,
err
)
require
.
NotEqual
(
t
,
""
,
seqVersion
)
}
}
// TestConfirmationDepth runs the rollup with both sequencer and verifier not immediately processing the tip of the chain.
// TestConfirmationDepth runs the rollup with both sequencer and verifier not immediately processing the tip of the chain.
...
...
op-node/node/api.go
View file @
16481af9
...
@@ -87,9 +87,17 @@ func (n *nodeAPI) OutputAtBlock(ctx context.Context, number rpc.BlockNumber) ([]
...
@@ -87,9 +87,17 @@ func (n *nodeAPI) OutputAtBlock(ctx context.Context, number rpc.BlockNumber) ([]
}
}
func
(
n
*
nodeAPI
)
SyncStatus
(
ctx
context
.
Context
)
(
*
driver
.
SyncStatus
,
error
)
{
func
(
n
*
nodeAPI
)
SyncStatus
(
ctx
context
.
Context
)
(
*
driver
.
SyncStatus
,
error
)
{
recordDur
:=
n
.
m
.
RecordRPCServerRequest
(
"optimism_syncStatus"
)
defer
recordDur
()
return
n
.
dr
.
SyncStatus
(
ctx
)
return
n
.
dr
.
SyncStatus
(
ctx
)
}
}
func
(
n
*
nodeAPI
)
RollupConfig
(
_
context
.
Context
)
(
*
rollup
.
Config
,
error
)
{
recordDur
:=
n
.
m
.
RecordRPCServerRequest
(
"optimism_rollupConfig"
)
defer
recordDur
()
return
n
.
config
,
nil
}
func
(
n
*
nodeAPI
)
Version
(
ctx
context
.
Context
)
(
string
,
error
)
{
func
(
n
*
nodeAPI
)
Version
(
ctx
context
.
Context
)
(
string
,
error
)
{
recordDur
:=
n
.
m
.
RecordRPCServerRequest
(
"optimism_version"
)
recordDur
:=
n
.
m
.
RecordRPCServerRequest
(
"optimism_version"
)
defer
recordDur
()
defer
recordDur
()
...
...
op-node/node/config.go
View file @
16481af9
...
@@ -37,6 +37,10 @@ type RPCConfig struct {
...
@@ -37,6 +37,10 @@ type RPCConfig struct {
ListenPort
int
ListenPort
int
}
}
func
(
cfg
*
RPCConfig
)
HttpEndpoint
()
string
{
return
fmt
.
Sprintf
(
"http://%s:%d"
,
cfg
.
ListenAddr
,
cfg
.
ListenPort
)
}
type
MetricsConfig
struct
{
type
MetricsConfig
struct
{
Enabled
bool
Enabled
bool
ListenAddr
string
ListenAddr
string
...
...
op-proposer/rollupclient/rollupclient.go
View file @
16481af9
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"math/big"
"math/big"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rpc"
...
@@ -30,6 +31,12 @@ func (r *RollupClient) SyncStatus(ctx context.Context) (*driver.SyncStatus, erro
...
@@ -30,6 +31,12 @@ func (r *RollupClient) SyncStatus(ctx context.Context) (*driver.SyncStatus, erro
return
output
,
err
return
output
,
err
}
}
func
(
r
*
RollupClient
)
RollupConfig
(
ctx
context
.
Context
)
(
*
rollup
.
Config
,
error
)
{
var
output
*
rollup
.
Config
err
:=
r
.
rpc
.
CallContext
(
ctx
,
&
output
,
"optimism_rollupConfig"
)
return
output
,
err
}
func
(
r
*
RollupClient
)
Version
(
ctx
context
.
Context
)
(
string
,
error
)
{
func
(
r
*
RollupClient
)
Version
(
ctx
context
.
Context
)
(
string
,
error
)
{
var
output
string
var
output
string
err
:=
r
.
rpc
.
CallContext
(
ctx
,
&
output
,
"optimism_version"
)
err
:=
r
.
rpc
.
CallContext
(
ctx
,
&
output
,
"optimism_version"
)
...
...
packages/contracts-bedrock/.gas-snapshot
View file @
16481af9
GasBenchMark_L1CrossDomainMessenger:test_L1MessengerSendMessage_benchmark_0() (gas: 158650)
GasBenchMark_L1CrossDomainMessenger:test_L1MessengerSendMessage_benchmark_0() (gas: 158650)
GasBenchMark_L1CrossDomainMessenger:test_L1MessengerSendMessage_benchmark_1() (gas: 750
81
)
GasBenchMark_L1CrossDomainMessenger:test_L1MessengerSendMessage_benchmark_1() (gas: 750
59
)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 249871)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 249871)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 116125)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 116125)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 249893)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 249893)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 1161
22
)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 1161
00
)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 45
368
)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 45
413
)
GasBenchMark_L2OutputOracle:test_appendL2Output_benchmark() (gas: 686
28
)
GasBenchMark_L2OutputOracle:test_appendL2Output_benchmark() (gas: 686
73
)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 75069)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 75069)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 353
28
)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 353
73
)
DeployerWhitelist_Test:test_owner() (gas: 76
80
)
DeployerWhitelist_Test:test_owner() (gas: 76
58
)
DeployerWhitelist_Test:test_storageSlots() (gas: 33
516
)
DeployerWhitelist_Test:test_storageSlots() (gas: 33
494
)
Encoding_Test:test_encodeDepositTransaction() (gas: 64
567
)
Encoding_Test:test_encodeDepositTransaction() (gas: 64
610
)
GasPriceOracle_Test:test_baseFee() (gas: 83
92
)
GasPriceOracle_Test:test_baseFee() (gas: 83
70
)
GasPriceOracle_Test:test_gasPrice() (gas: 8381)
GasPriceOracle_Test:test_gasPrice() (gas: 8381)
GasPriceOracle_Test:test_l1BaseFee() (gas: 10582)
GasPriceOracle_Test:test_l1BaseFee() (gas: 10582)
GasPriceOracle_Test:test_onlyOwnerSetDecimals() (gas: 105
75
)
GasPriceOracle_Test:test_onlyOwnerSetDecimals() (gas: 105
53
)
GasPriceOracle_Test:test_onlyOwnerSetOverhead() (gas: 10599)
GasPriceOracle_Test:test_onlyOwnerSetOverhead() (gas: 10599)
GasPriceOracle_Test:test_onlyOwnerSetScalar() (gas: 10640)
GasPriceOracle_Test:test_onlyOwnerSetScalar() (gas: 10640)
GasPriceOracle_Test:test_owner() (gas: 9
762
)
GasPriceOracle_Test:test_owner() (gas: 9
806
)
GasPriceOracle_Test:test_setDecimals() (gas: 36798)
GasPriceOracle_Test:test_setDecimals() (gas: 36798)
GasPriceOracle_Test:test_setGasPriceReverts() (gas: 11740)
GasPriceOracle_Test:test_setGasPriceReverts() (gas: 11740)
GasPriceOracle_Test:test_setL1BaseFeeReverts() (gas: 117
39
)
GasPriceOracle_Test:test_setL1BaseFeeReverts() (gas: 117
17
)
GasPriceOracle_Test:test_setOverhead() (gas: 36767)
GasPriceOracle_Test:test_setOverhead() (gas: 36767)
GasPriceOracle_Test:test_setScalar() (gas: 36818)
GasPriceOracle_Test:test_setScalar() (gas: 36818)
GasPriceOracle_Test:test_storageLayout() (gas: 86683)
GasPriceOracle_Test:test_storageLayout() (gas: 86683)
Hashing_Test:test_hashDepositSource() (gas: 673)
Hashing_Test:test_hashDepositSource() (gas: 673)
Hashing_Test:test_hashDepositTransaction() (gas: 391
51
)
Hashing_Test:test_hashDepositTransaction() (gas: 391
29
)
L1BlockTest:test_basefee() (gas: 75
53
)
L1BlockTest:test_basefee() (gas: 75
31
)
L1BlockTest:test_hash() (gas: 7575)
L1BlockTest:test_hash() (gas: 7575)
L1BlockTest:test_number() (gas: 76
52
)
L1BlockTest:test_number() (gas: 76
30
)
L1BlockTest:test_sequenceNumber() (gas: 76
30
)
L1BlockTest:test_sequenceNumber() (gas: 76
95
)
L1BlockTest:test_timestamp() (gas: 76
84
)
L1BlockTest:test_timestamp() (gas: 76
62
)
L1BlockTest:test_updateValues() (gas: 282
38
)
L1BlockTest:test_updateValues() (gas: 282
16
)
L1BlockNumberTest:test_fallback() (gas: 18774)
L1BlockNumberTest:test_fallback() (gas: 18774)
L1BlockNumberTest:test_getL1BlockNumber() (gas: 106
12
)
L1BlockNumberTest:test_getL1BlockNumber() (gas: 106
57
)
L1BlockNumberTest:test_receive() (gas: 25437)
L1BlockNumberTest:test_receive() (gas: 25437)
L1CrossDomainMessenger_Test:testCannot_L1MessengerPause() (gas: 24
452
)
L1CrossDomainMessenger_Test:testCannot_L1MessengerPause() (gas: 24
517
)
L1CrossDomainMessenger_Test:testCannot_L1MessengerUnpause() (gas: 24509)
L1CrossDomainMessenger_Test:testCannot_L1MessengerUnpause() (gas: 24509)
L1CrossDomainMessenger_Test:test_L1MessengerMessageVersion() (gas: 24
693
)
L1CrossDomainMessenger_Test:test_L1MessengerMessageVersion() (gas: 24
716
)
L1CrossDomainMessenger_Test:test_L1MessengerPause() (gas: 4
8017
)
L1CrossDomainMessenger_Test:test_L1MessengerPause() (gas: 4
7995
)
L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageSucceeds() (gas: 777
95
)
L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageSucceeds() (gas: 777
73
)
L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageToSystemContract() (gas: 678
44
)
L1CrossDomainMessenger_Test:test_L1MessengerRelayMessageToSystemContract() (gas: 678
22
)
L1CrossDomainMessenger_Test:test_L1MessengerRelayShouldRevertIfPaused() (gas: 604
94
)
L1CrossDomainMessenger_Test:test_L1MessengerRelayShouldRevertIfPaused() (gas: 604
72
)
L1CrossDomainMessenger_Test:test_L1MessengerReplayMessageWithValue() (gas: 38149)
L1CrossDomainMessenger_Test:test_L1MessengerReplayMessageWithValue() (gas: 38149)
L1CrossDomainMessenger_Test:test_L1MessengerSendMessage() (gas: 196
900
)
L1CrossDomainMessenger_Test:test_L1MessengerSendMessage() (gas: 196
878
)
L1CrossDomainMessenger_Test:test_L1MessengerTwiceSendMessage() (gas: 12736
48
)
L1CrossDomainMessenger_Test:test_L1MessengerTwiceSendMessage() (gas: 12736
26
)
L1CrossDomainMessenger_Test:test_L1MessengerUnpause() (gas: 40890)
L1CrossDomainMessenger_Test:test_L1MessengerUnpause() (gas: 40890)
L1CrossDomainMessenger_Test:test_L1MessengerXDomainSenderReverts() (gas: 24272)
L1CrossDomainMessenger_Test:test_L1MessengerXDomainSenderReverts() (gas: 24272)
L1CrossDomainMessenger_Test:test_L1MessengerxDomainMessageSenderResets() (gas: 86
723
)
L1CrossDomainMessenger_Test:test_L1MessengerxDomainMessageSenderResets() (gas: 86
214
)
L1StandardBridge_Test:test_depositERC20() (gas: 4750
30
)
L1StandardBridge_Test:test_depositERC20() (gas: 4750
08
)
L1StandardBridge_Test:test_depositERC20To() (gas: 477
211
)
L1StandardBridge_Test:test_depositERC20To() (gas: 477
189
)
L1StandardBridge_Test:test_depositETH() (gas: 268
876
)
L1StandardBridge_Test:test_depositETH() (gas: 268
941
)
L1StandardBridge_Test:test_depositETHTo() (gas: 226763)
L1StandardBridge_Test:test_depositETHTo() (gas: 226763)
L1StandardBridge_Test:test_finalizeERC20Withdrawal() (gas: 490759)
L1StandardBridge_Test:test_finalizeERC20Withdrawal() (gas: 490759)
L1StandardBridge_Test:test_finalizeETHWithdrawal() (gas: 644
31
)
L1StandardBridge_Test:test_finalizeETHWithdrawal() (gas: 644
09
)
L1StandardBridge_Test:test_initialize() (gas: 263
58
)
L1StandardBridge_Test:test_initialize() (gas: 263
36
)
L1StandardBridge_Test:test_onlyEOADepositERC20() (gas: 223
19
)
L1StandardBridge_Test:test_onlyEOADepositERC20() (gas: 223
63
)
L1StandardBridge_Test:test_onlyEOADepositETH() (gas: 408
16
)
L1StandardBridge_Test:test_onlyEOADepositETH() (gas: 408
82
)
L1StandardBridge_Test:test_onlyL2BridgeFinalizeERC20Withdrawal() (gas: 362
93
)
L1StandardBridge_Test:test_onlyL2BridgeFinalizeERC20Withdrawal() (gas: 362
71
)
L1StandardBridge_Test:test_onlyPortalFinalizeERC20Withdrawal() (gas: 356
22
)
L1StandardBridge_Test:test_onlyPortalFinalizeERC20Withdrawal() (gas: 356
00
)
L1StandardBridge_Test:test_receive() (gas: 413
52
1)
L1StandardBridge_Test:test_receive() (gas: 413
60
1)
L2CrossDomainMessenger_Test:testCannot_L2MessengerPause() (gas: 108
43
)
L2CrossDomainMessenger_Test:testCannot_L2MessengerPause() (gas: 108
21
)
L2CrossDomainMessenger_Test:test_L2MessengerMessageVersion() (gas: 84
67
)
L2CrossDomainMessenger_Test:test_L2MessengerMessageVersion() (gas: 84
45
)
L2CrossDomainMessenger_Test:test_L2MessengerPause() (gas: 318
37
)
L2CrossDomainMessenger_Test:test_L2MessengerPause() (gas: 318
15
)
L2CrossDomainMessenger_Test:test_L2MessengerRelayMessageSucceeds() (gas: 573
54
)
L2CrossDomainMessenger_Test:test_L2MessengerRelayMessageSucceeds() (gas: 573
32
)
L2CrossDomainMessenger_Test:test_L2MessengerRelayMessageToSystemContract() (gas: 36
092
)
L2CrossDomainMessenger_Test:test_L2MessengerRelayMessageToSystemContract() (gas: 36
159
)
L2CrossDomainMessenger_Test:test_L2MessengerRelayShouldRevertIfPaused() (gas: 41
599
)
L2CrossDomainMessenger_Test:test_L2MessengerRelayShouldRevertIfPaused() (gas: 41
664
)
L2CrossDomainMessenger_Test:test_L2MessengerSendMessage() (gas: 119627)
L2CrossDomainMessenger_Test:test_L2MessengerSendMessage() (gas: 119627)
L2CrossDomainMessenger_Test:test_L2MessengerTwiceSendMessage() (gas: 133248)
L2CrossDomainMessenger_Test:test_L2MessengerTwiceSendMessage() (gas: 133248)
L2CrossDomainMessenger_Test:test_L2MessengerXDomainSenderReverts() (gas: 10
621
)
L2CrossDomainMessenger_Test:test_L2MessengerXDomainSenderReverts() (gas: 10
599
)
L2CrossDomainMessenger_Test:test_L2MessengerxDomainMessageSenderResets() (gas: 548
00
)
L2CrossDomainMessenger_Test:test_L2MessengerxDomainMessageSenderResets() (gas: 548
44
)
L2OutputOracleTest:testCannot_AppendWithUnmatchedBlockhash() (gas: 26
788
)
L2OutputOracleTest:testCannot_AppendWithUnmatchedBlockhash() (gas: 26
811
)
L2OutputOracleTest:testCannot_appendEmptyOutput() (gas: 24
108
)
L2OutputOracleTest:testCannot_appendEmptyOutput() (gas: 24
086
)
L2OutputOracleTest:testCannot_appendFutureTimetamp() (gas: 260
32
)
L2OutputOracleTest:testCannot_appendFutureTimetamp() (gas: 260
75
)
L2OutputOracleTest:testCannot_appendOnWrongFork() (gas: 263
37
)
L2OutputOracleTest:testCannot_appendOnWrongFork() (gas: 263
60
)
L2OutputOracleTest:testCannot_appendOutputIfNotSequencer() (gas: 234
99
)
L2OutputOracleTest:testCannot_appendOutputIfNotSequencer() (gas: 234
77
)
L2OutputOracleTest:testCannot_appendUnexpectedBlockNumber() (gas: 259
40
)
L2OutputOracleTest:testCannot_appendUnexpectedBlockNumber() (gas: 259
84
)
L2OutputOracleTest:testCannot_deleteL2Output_ifNotOwner() (gas: 24
800
)
L2OutputOracleTest:testCannot_deleteL2Output_ifNotOwner() (gas: 24
778
)
L2OutputOracleTest:testCannot_deleteL2Output_withWrongRoot() (gas: 910
70
)
L2OutputOracleTest:testCannot_deleteL2Output_withWrongRoot() (gas: 910
48
)
L2OutputOracleTest:testCannot_deleteL2Output_withWrongTime() (gas: 870
19
)
L2OutputOracleTest:testCannot_deleteL2Output_withWrongTime() (gas: 870
63
)
L2OutputOracleTest:test_appendWithBlockhashAndHeight() (gas: 750
06
)
L2OutputOracleTest:test_appendWithBlockhashAndHeight() (gas: 750
48
)
L2OutputOracleTest:test_appendingAnotherOutput() (gas: 76
795
)
L2OutputOracleTest:test_appendingAnotherOutput() (gas: 76
839
)
L2OutputOracleTest:test_changeSequencer() (gas: 559
85
)
L2OutputOracleTest:test_changeSequencer() (gas: 559
63
)
L2OutputOracleTest:test_computeL2Timestamp() (gas: 30200)
L2OutputOracleTest:test_computeL2Timestamp() (gas: 30200)
L2OutputOracleTest:test_constructor() (gas: 48
815
)
L2OutputOracleTest:test_constructor() (gas: 48
793
)
L2OutputOracleTest:test_deleteL2Output() (gas: 764
56
)
L2OutputOracleTest:test_deleteL2Output() (gas: 764
38
)
L2OutputOracleTest:test_getL2Output() (gas: 82869)
L2OutputOracleTest:test_getL2Output() (gas: 82869)
L2OutputOracleTest:test_latestBlockNumber() (gas: 761
98
)
L2OutputOracleTest:test_latestBlockNumber() (gas: 761
76
)
L2OutputOracleTest:test_nextBlockNumber() (gas: 15122)
L2OutputOracleTest:test_nextBlockNumber() (gas: 15122)
L2OutputOracleTest:test_updateOwner() (gas: 346
25
)
L2OutputOracleTest:test_updateOwner() (gas: 346
03
)
L2OutputOracleUpgradeable_Test:test_cannotInitImpl() (gas:
8476
)
L2OutputOracleUpgradeable_Test:test_cannotInitImpl() (gas:
19451
)
L2OutputOracleUpgradeable_Test:test_cannotInitProxy() (gas:
13431
)
L2OutputOracleUpgradeable_Test:test_cannotInitProxy() (gas:
24516
)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy() (gas: 38865)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy() (gas: 38865)
L2OutputOracleUpgradeable_Test:test_upgrading() (gas: 230843)
L2OutputOracleUpgradeable_Test:test_upgrading() (gas: 230843)
L2StandardBridge_Test:test_ERC20BridgeFailed_whenLocalTokenIsBridge() (gas: 133200)
L2StandardBridge_Test:test_ERC20BridgeFailed_whenLocalTokenIsBridge() (gas: 133200)
L2StandardBridge_Test:test_cannotWithdrawEthWithoutSendingIt() (gas: 21656)
L2StandardBridge_Test:test_cannotWithdrawEthWithoutSendingIt() (gas: 21656)
L2StandardBridge_Test:test_finalizeDeposit() (gas: 932
25
)
L2StandardBridge_Test:test_finalizeDeposit() (gas: 932
03
)
L2StandardBridge_Test:test_finalizeDeposit_failsToCompleteOutboundTransfer() (gas: 1402
32
)
L2StandardBridge_Test:test_finalizeDeposit_failsToCompleteOutboundTransfer() (gas: 1402
10
)
L2StandardBridge_Test:test_initialize() (gas: 148
24
)
L2StandardBridge_Test:test_initialize() (gas: 148
02
)
L2StandardBridge_Test:test_receive() (gas: 136
52
5)
L2StandardBridge_Test:test_receive() (gas: 136
60
5)
L2StandardBridge_Test:test_withdraw() (gas: 3528
31
)
L2StandardBridge_Test:test_withdraw() (gas: 3528
13
)
L2StandardBridge_Test:test_withdrawTo() (gas: 353
516
)
L2StandardBridge_Test:test_withdrawTo() (gas: 353
498
)
L2StandardBridge_Test:test_withdraw_onlyEOA() (gas: 252006)
L2StandardBridge_Test:test_withdraw_onlyEOA() (gas: 252006)
L2ToL1MessagePasserTest:test_burn() (gas: 1120
59
)
L2ToL1MessagePasserTest:test_burn() (gas: 1120
37
)
L2ToL1MessagePasserTest:test_initiateWithdrawal_fromContract() (gas: 678
47
)
L2ToL1MessagePasserTest:test_initiateWithdrawal_fromContract() (gas: 678
92
)
L2ToL1MessagePasserTest:test_initiateWithdrawal_fromEOA() (gas: 74831)
L2ToL1MessagePasserTest:test_initiateWithdrawal_fromEOA() (gas: 74831)
LegacyERC20ETH_Test:test_approve() (gas: 107
31
)
LegacyERC20ETH_Test:test_approve() (gas: 107
96
)
LegacyERC20ETH_Test:test_burn() (gas: 106
15
)
LegacyERC20ETH_Test:test_burn() (gas: 106
81
)
LegacyERC20ETH_Test:test_crossDomain() (gas: 105
99
)
LegacyERC20ETH_Test:test_crossDomain() (gas: 105
77
)
LegacyERC20ETH_Test:test_decreaseAllowance() (gas: 10731)
LegacyERC20ETH_Test:test_decreaseAllowance() (gas: 10731)
LegacyERC20ETH_Test:test_increaseAllowance() (gas: 107
63
)
LegacyERC20ETH_Test:test_increaseAllowance() (gas: 107
41
)
LegacyERC20ETH_Test:test_metadata() (gas: 15
608
)
LegacyERC20ETH_Test:test_metadata() (gas: 15
586
)
LegacyERC20ETH_Test:test_mint() (gas: 10627)
LegacyERC20ETH_Test:test_mint() (gas: 10627)
LegacyERC20ETH_Test:test_transfer() (gas: 10
762
)
LegacyERC20ETH_Test:test_transfer() (gas: 10
829
)
LegacyERC20ETH_Test:test_transferFrom() (gas: 13008)
LegacyERC20ETH_Test:test_transferFrom() (gas: 13008)
OptimismMintableERC20_Test:test_bridge() (gas: 98
50
)
OptimismMintableERC20_Test:test_bridge() (gas: 98
28
)
OptimismMintableERC20_Test:test_burn() (gas: 52
773
)
OptimismMintableERC20_Test:test_burn() (gas: 52
826
)
OptimismMintableERC20_Test:test_burnRevertsFromNotBridge() (gas: 132
41
)
OptimismMintableERC20_Test:test_burnRevertsFromNotBridge() (gas: 132
19
)
OptimismMintableERC20_Test:test_erc165_supportsInterface() (gas: 7828)
OptimismMintableERC20_Test:test_erc165_supportsInterface() (gas: 7828)
OptimismMintableERC20_Test:test_l1Token() (gas: 9
757
)
OptimismMintableERC20_Test:test_l1Token() (gas: 9
824
)
OptimismMintableERC20_Test:test_l2Bridge() (gas: 97
68
)
OptimismMintableERC20_Test:test_l2Bridge() (gas: 97
46
)
OptimismMintableERC20_Test:test_mint() (gas: 65754)
OptimismMintableERC20_Test:test_mint() (gas: 65754)
OptimismMintableERC20_Test:test_mintRevertsFromNotBridge() (gas: 13243)
OptimismMintableERC20_Test:test_mintRevertsFromNotBridge() (gas: 13243)
OptimismMintableERC20_Test:test_remoteToken() (gas: 97
62
)
OptimismMintableERC20_Test:test_remoteToken() (gas: 97
40
)
OptimismMintableTokenFactory_Test:test_bridge() (gas: 7
598
)
OptimismMintableTokenFactory_Test:test_bridge() (gas: 7
663
)
OptimismMintableTokenFactory_Test:test_createStandardL2Token() (gas: 1113150)
OptimismMintableTokenFactory_Test:test_createStandardL2Token() (gas: 1113150)
OptimismMintableTokenFactory_Test:test_createStandardL2TokenSameTwice() (gas: 2209211)
OptimismMintableTokenFactory_Test:test_createStandardL2TokenSameTwice() (gas: 2209211)
OptimismMintableTokenFactory_Test:test_createStandardL2TokenShouldRevertIfRemoteIsZero() (gas: 9399)
OptimismMintableTokenFactory_Test:test_createStandardL2TokenShouldRevertIfRemoteIsZero() (gas: 9399)
OptimismPortalUpgradeable_Test:test_cannotInitImpl() (gas: 10
933
)
OptimismPortalUpgradeable_Test:test_cannotInitImpl() (gas: 10
686
)
OptimismPortalUpgradeable_Test:test_cannotInitProxy() (gas: 15
909
)
OptimismPortalUpgradeable_Test:test_cannotInitProxy() (gas: 15
728
)
OptimismPortalUpgradeable_Test:test_initValuesOnProxy() (gas: 15990)
OptimismPortalUpgradeable_Test:test_initValuesOnProxy() (gas: 15990)
OptimismPortalUpgradeable_Test:test_upgrading() (gas: 230843)
OptimismPortalUpgradeable_Test:test_upgrading() (gas: 230843)
OptimismPortal_Test:test_OptimismPortalConstructor() (gas: 173
41
)
OptimismPortal_Test:test_OptimismPortalConstructor() (gas: 173
19
)
OptimismPortal_Test:test_OptimismPortalContractCreationReverts() (gas: 142
15
)
OptimismPortal_Test:test_OptimismPortalContractCreationReverts() (gas: 142
38
)
OptimismPortal_Test:test_OptimismPortalReceiveEth() (gas: 1266
36
)
OptimismPortal_Test:test_OptimismPortalReceiveEth() (gas: 1266
14
)
OptimismPortal_Test:test_cannotVerifyRecentWithdrawal() (gas: 31902)
OptimismPortal_Test:test_cannotVerifyRecentWithdrawal() (gas: 31902)
OptimismPortal_Test:test_depositTransaction_NoValueContract() (gas: 75
797
)
OptimismPortal_Test:test_depositTransaction_NoValueContract() (gas: 75
820
)
OptimismPortal_Test:test_depositTransaction_NoValueEOA() (gas: 76
121
)
OptimismPortal_Test:test_depositTransaction_NoValueEOA() (gas: 76
099
)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForContract() (gas: 75825)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForContract() (gas: 75825)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForEOA() (gas: 76146)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForEOA() (gas: 76146)
OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreation() (gas: 82846)
OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreation() (gas: 82846)
OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation() (gas: 750
29
)
OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation() (gas: 750
07
)
OptimismPortal_Test:test_depositTransaction_withEthValueFromContract() (gas: 82
485
)
OptimismPortal_Test:test_depositTransaction_withEthValueFromContract() (gas: 82
550
)
OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA() (gas: 831
01
)
OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA() (gas: 831
45
)
OptimismPortal_Test:test_invalidWithdrawalProof() (gas: 45
108
)
OptimismPortal_Test:test_invalidWithdrawalProof() (gas: 45
086
)
OptimismPortal_Test:test_isOutputFinalized() (gas: 1318
42
)
OptimismPortal_Test:test_isOutputFinalized() (gas: 1318
86
)
OptimismPortal_Test:test_simple_isOutputFinalized() (gas: 2
4021
)
OptimismPortal_Test:test_simple_isOutputFinalized() (gas: 2
3999
)
Proxy_Test:test_clashingFunctionSignatures() (gas: 101427)
Proxy_Test:test_clashingFunctionSignatures() (gas: 101427)
Proxy_Test:test_implementationKey() (gas: 20942)
Proxy_Test:test_implementationKey() (gas: 20942)
Proxy_Test:test_implementationProxyCallIfNotAdmin() (gas: 30021)
Proxy_Test:test_implementationProxyCallIfNotAdmin() (gas: 30021)
Proxy_Test:test_implementationZeroAddress() (gas: 480
22
)
Proxy_Test:test_implementationZeroAddress() (gas: 480
00
)
Proxy_Test:test_itDelegatesToTheImplementation() (gas: 45
184
)
Proxy_Test:test_itDelegatesToTheImplementation() (gas: 45
251
)
Proxy_Test:test_ownerKey() (gas: 19
113
)
Proxy_Test:test_ownerKey() (gas: 19
091
)
Proxy_Test:test_ownerProxyCallIfNotAdmin() (gas: 347
33
)
Proxy_Test:test_ownerProxyCallIfNotAdmin() (gas: 347
11
)
Proxy_Test:test_payableUpgradeToAndCall() (gas: 538
87
)
Proxy_Test:test_payableUpgradeToAndCall() (gas: 538
65
)
Proxy_Test:test_revertUpgradeToAndCall() (gas: 104654)
Proxy_Test:test_revertUpgradeToAndCall() (gas: 104654)
Proxy_Test:test_upgradeToAndCall() (gas: 125
238
)
Proxy_Test:test_upgradeToAndCall() (gas: 125
305
)
Proxy_Test:test_zeroAddressCaller() (gas: 14
758
)
Proxy_Test:test_zeroAddressCaller() (gas: 14
825
)
ProxyAdmin_Test:test_chugsplashChangeProxyAdmin() (gas: 35647)
ProxyAdmin_Test:test_chugsplashChangeProxyAdmin() (gas: 35647)
ProxyAdmin_Test:test_chugsplashGetProxyAdmin() (gas: 15
711
)
ProxyAdmin_Test:test_chugsplashGetProxyAdmin() (gas: 15
689
)
ProxyAdmin_Test:test_chugsplashGetProxyImplementation() (gas: 511
22
)
ProxyAdmin_Test:test_chugsplashGetProxyImplementation() (gas: 511
67
)
ProxyAdmin_Test:test_chugsplashUpgrade() (gas: 489
94
)
ProxyAdmin_Test:test_chugsplashUpgrade() (gas: 489
72
)
ProxyAdmin_Test:test_chugsplashUpgradeAndCall() (gas: 823
22
)
ProxyAdmin_Test:test_chugsplashUpgradeAndCall() (gas: 823
45
)
ProxyAdmin_Test:test_delegateResolvedChangeProxyAdmin() (gas: 3
3976
)
ProxyAdmin_Test:test_delegateResolvedChangeProxyAdmin() (gas: 3
4020
)
ProxyAdmin_Test:test_delegateResolvedGetProxyAdmin() (gas: 17
685
)
ProxyAdmin_Test:test_delegateResolvedGetProxyAdmin() (gas: 17
708
)
ProxyAdmin_Test:test_delegateResolvedGetProxyImplementation() (gas: 62016)
ProxyAdmin_Test:test_delegateResolvedGetProxyImplementation() (gas: 62016)
ProxyAdmin_Test:test_delegateResolvedUpgrade() (gas: 584
22
)
ProxyAdmin_Test:test_delegateResolvedUpgrade() (gas: 584
66
)
ProxyAdmin_Test:test_delegateResolvedUpgradeAndCall() (gas: 979
48
)
ProxyAdmin_Test:test_delegateResolvedUpgradeAndCall() (gas: 979
26
)
ProxyAdmin_Test:test_erc1967ChangeProxyAdmin() (gas: 33863)
ProxyAdmin_Test:test_erc1967ChangeProxyAdmin() (gas: 33863)
ProxyAdmin_Test:test_erc1967GetProxyAdmin() (gas: 15672)
ProxyAdmin_Test:test_erc1967GetProxyAdmin() (gas: 15672)
ProxyAdmin_Test:test_erc1967GetProxyImplementation() (gas: 521
24
)
ProxyAdmin_Test:test_erc1967GetProxyImplementation() (gas: 521
02
)
ProxyAdmin_Test:test_erc1967Upgrade() (gas: 50036)
ProxyAdmin_Test:test_erc1967Upgrade() (gas: 50036)
ProxyAdmin_Test:test_erc1967UpgradeAndCall() (gas: 79019)
ProxyAdmin_Test:test_erc1967UpgradeAndCall() (gas: 79019)
ProxyAdmin_Test:test_isUpgrading() (gas: 195
30
)
ProxyAdmin_Test:test_isUpgrading() (gas: 195
75
)
ProxyAdmin_Test:test_onlyOwner() (gas: 22715)
ProxyAdmin_Test:test_onlyOwner() (gas: 22715)
ProxyAdmin_Test:test_onlyOwnerSetAddressManager() (gas: 106
22
)
ProxyAdmin_Test:test_onlyOwnerSetAddressManager() (gas: 106
00
)
ProxyAdmin_Test:test_onlyOwnerSetImplementationName() (gas: 111
35
)
ProxyAdmin_Test:test_onlyOwnerSetImplementationName() (gas: 111
13
)
ProxyAdmin_Test:test_onlyOwnerSetProxyType() (gas: 10751)
ProxyAdmin_Test:test_onlyOwnerSetProxyType() (gas: 10751)
ProxyAdmin_Test:test_owner() (gas: 9
776
)
ProxyAdmin_Test:test_owner() (gas: 9
818
)
ProxyAdmin_Test:test_proxyType() (gas: 20622)
ProxyAdmin_Test:test_proxyType() (gas: 20622)
ProxyAdmin_Test:test_setImplementationName() (gas: 3
8957
)
ProxyAdmin_Test:test_setImplementationName() (gas: 3
9002
)
RLPReader_Test:testReadBool() (gas: 1109)
RLPReader_Test:testReadBool() (gas: 1109)
RLPReader_Test:test_readAddress() (gas: 1347)
RLPReader_Test:test_readAddress() (gas: 1347)
RLPReader_Test:test_readAddressSmall() (gas: 614)
RLPReader_Test:test_readAddressSmall() (gas: 614)
RLPReader_Test:test_readAddressTooLarge() (gas: 3646)
RLPReader_Test:test_readAddressTooLarge() (gas: 3646)
RLPReader_Test:test_readAddressTooShort() (gas: 36
25
)
RLPReader_Test:test_readAddressTooShort() (gas: 36
03
)
RLPReader_Test:test_readBoolInvalidValue() (gas: 36
99
)
RLPReader_Test:test_readBoolInvalidValue() (gas: 36
77
)
RLPReader_Test:test_readBoolLargeInput() (gas: 35
72
)
RLPReader_Test:test_readBoolLargeInput() (gas: 35
50
)
RLPReader_Test:test_readBytes32_revertOnList() (gas:
4020
)
RLPReader_Test:test_readBytes32_revertOnList() (gas:
3998
)
RLPReader_Test:test_readBytes32_revertOnTooLong() (gas: 3
610
)
RLPReader_Test:test_readBytes32_revertOnTooLong() (gas: 3
588
)
RLPReader_Test:test_readBytes_bytestring00() (gas: 18
45
)
RLPReader_Test:test_readBytes_bytestring00() (gas: 18
23
)
RLPReader_Test:test_readBytes_bytestring01() (gas: 1846)
RLPReader_Test:test_readBytes_bytestring01() (gas: 1846)
RLPReader_Test:test_readBytes_bytestring7f() (gas: 1
779
)
RLPReader_Test:test_readBytes_bytestring7f() (gas: 1
844
)
RLPReader_Test:test_readBytes_invalidListLength() (gas: 38
34
)
RLPReader_Test:test_readBytes_invalidListLength() (gas: 38
12
)
RLPReader_Test:test_readBytes_invalidStringLength() (gas: 37
90
)
RLPReader_Test:test_readBytes_invalidStringLength() (gas: 37
68
)
RLPReader_Test:test_readBytes_revertListItem() (gas: 39
44
)
RLPReader_Test:test_readBytes_revertListItem() (gas: 39
22
)
RLPReader_Test:test_readList_dictTest1() (gas: 23791)
RLPReader_Test:test_readList_dictTest1() (gas: 23791)
RLPReader_Test:test_readList_empty() (gas: 4472)
RLPReader_Test:test_readList_empty() (gas: 4472)
RLPReader_Test:test_readList_incorrectLengthInArray() (gas: 4210)
RLPReader_Test:test_readList_incorrectLengthInArray() (gas: 4210)
RLPReader_Test:test_readList_int32Overflow() (gas: 3955)
RLPReader_Test:test_readList_int32Overflow() (gas: 3955)
RLPReader_Test:test_readList_int32Overflow2() (gas:
3998
)
RLPReader_Test:test_readList_int32Overflow2() (gas:
4021
)
RLPReader_Test:test_readList_invalidShortList() (gas: 3
788
)
RLPReader_Test:test_readList_invalidShortList() (gas: 3
855
)
RLPReader_Test:test_readList_invalidValue() (gas: 3787)
RLPReader_Test:test_readList_invalidValue() (gas: 3787)
RLPReader_Test:test_readList_leadingZerosInLongLengthArray1() (gas: 4
215
)
RLPReader_Test:test_readList_leadingZerosInLongLengthArray1() (gas: 4
193
)
RLPReader_Test:test_readList_leadingZerosInLongLengthArray2() (gas: 41
99
)
RLPReader_Test:test_readList_leadingZerosInLongLengthArray2() (gas: 41
77
)
RLPReader_Test:test_readList_leadingZerosInLongLengthList1() (gas: 385
82
)
RLPReader_Test:test_readList_leadingZerosInLongLengthList1() (gas: 385
60
)
RLPReader_Test:test_readList_listOfLists() (gas: 96
41
)
RLPReader_Test:test_readList_listOfLists() (gas: 96
19
)
RLPReader_Test:test_readList_listOfLists2() (gas: 124
56
)
RLPReader_Test:test_readList_listOfLists2() (gas: 124
79
)
RLPReader_Test:test_readList_longList1() (gas: 29013)
RLPReader_Test:test_readList_longList1() (gas: 29013)
RLPReader_Test:test_readList_longList2() (gas: 202
917
)
RLPReader_Test:test_readList_longList2() (gas: 202
895
)
RLPReader_Test:test_readList_longStringLength() (gas: 3
787
)
RLPReader_Test:test_readList_longStringLength() (gas: 3
853
)
RLPReader_Test:test_readList_multiList() (gas: 1
1961
)
RLPReader_Test:test_readList_multiList() (gas: 1
2025
)
RLPReader_Test:test_readList_nonOptimalLongLengthArray1() (gas: 42
22
)
RLPReader_Test:test_readList_nonOptimalLongLengthArray1() (gas: 42
00
)
RLPReader_Test:test_readList_nonOptimalLongLengthArray2() (gas: 4223)
RLPReader_Test:test_readList_nonOptimalLongLengthArray2() (gas: 4223)
RLPReader_Test:test_readList_notLongEnough() (gas: 38
63
)
RLPReader_Test:test_readList_notLongEnough() (gas: 38
41
)
RLPReader_Test:test_readList_shortListMax1() (gas: 40
596
)
RLPReader_Test:test_readList_shortListMax1() (gas: 40
662
)
RLPReader_Test:test_readList_stringList() (gas: 16
818
)
RLPReader_Test:test_readList_stringList() (gas: 16
796
)
RLPReader_Test:test_readString_emptyString() (gas: 1719)
RLPReader_Test:test_readString_emptyString() (gas: 1719)
RLPReader_Test:test_readString_longString() (gas: 30
98
)
RLPReader_Test:test_readString_longString() (gas: 30
76
)
RLPReader_Test:test_readString_longString2() (gas: 185
46
)
RLPReader_Test:test_readString_longString2() (gas: 185
24
)
RLPReader_Test:test_readString_shortString() (gas: 2
302
)
RLPReader_Test:test_readString_shortString() (gas: 2
280
)
RLPReader_Test:test_readString_shortString2() (gas: 2775)
RLPReader_Test:test_readString_shortString2() (gas: 2775)
RLPReader_Test:test_readUint256_mediumInt1() (gas: 12
57
)
RLPReader_Test:test_readUint256_mediumInt1() (gas: 12
35
)
RLPReader_Test:test_readUint256_mediumInt2() (gas: 1237)
RLPReader_Test:test_readUint256_mediumInt2() (gas: 1237)
RLPReader_Test:test_readUint256_mediumInt3() (gas: 1238)
RLPReader_Test:test_readUint256_mediumInt3() (gas: 1238)
RLPReader_Test:test_readUint256_smallInt() (gas: 1
106
)
RLPReader_Test:test_readUint256_smallInt() (gas: 1
084
)
RLPReader_Test:test_readUint256_smallInt2() (gas: 1151)
RLPReader_Test:test_readUint256_smallInt2() (gas: 1151)
RLPReader_Test:test_readUint256_smallInt3() (gas: 11
04
)
RLPReader_Test:test_readUint256_smallInt3() (gas: 11
27
)
RLPReader_Test:test_readUint256_smallInt4() (gas: 11
50
)
RLPReader_Test:test_readUint256_smallInt4() (gas: 11
28
)
RLPReader_Test:test_readUint256_zero() (gas: 1258)
RLPReader_Test:test_readUint256_zero() (gas: 1258)
RLPWriter_Test:test_writeList_dictTest1() (gas: 371
70
)
RLPWriter_Test:test_writeList_dictTest1() (gas: 371
48
)
RLPWriter_Test:test_writeList_empty() (gas: 17
73
)
RLPWriter_Test:test_writeList_empty() (gas: 17
51
)
RLPWriter_Test:test_writeList_listoflists() (gas: 109
91
)
RLPWriter_Test:test_writeList_listoflists() (gas: 109
69
)
RLPWriter_Test:test_writeList_listoflists2() (gas: 16779)
RLPWriter_Test:test_writeList_listoflists2() (gas: 16779)
RLPWriter_Test:test_writeList_longlist1() (gas: 40730)
RLPWriter_Test:test_writeList_longlist1() (gas: 40730)
RLPWriter_Test:test_writeList_longlist2() (gas: 2832
55
)
RLPWriter_Test:test_writeList_longlist2() (gas: 2832
78
)
RLPWriter_Test:test_writeList_multiList() (gas: 226
82
)
RLPWriter_Test:test_writeList_multiList() (gas: 226
60
)
RLPWriter_Test:test_writeList_shortListMax1() (gas: 36985)
RLPWriter_Test:test_writeList_shortListMax1() (gas: 36985)
RLPWriter_Test:test_writeList_stringList() (gas: 10786)
RLPWriter_Test:test_writeList_stringList() (gas: 10786)
RLPWriter_Test:test_writeString_bytestring00() (gas:
978
)
RLPWriter_Test:test_writeString_bytestring00() (gas:
1022
)
RLPWriter_Test:test_writeString_bytestring01() (gas:
1000
)
RLPWriter_Test:test_writeString_bytestring01() (gas:
978
)
RLPWriter_Test:test_writeString_bytestring7f() (gas: 1002)
RLPWriter_Test:test_writeString_bytestring7f() (gas: 1002)
RLPWriter_Test:test_writeString_empty() (gas: 1
659
)
RLPWriter_Test:test_writeString_empty() (gas: 1
704
)
RLPWriter_Test:test_writeString_longstring() (gas: 171
35
)
RLPWriter_Test:test_writeString_longstring() (gas: 171
80
)
RLPWriter_Test:test_writeString_longstring2() (gas: 2618
86
)
RLPWriter_Test:test_writeString_longstring2() (gas: 2618
64
)
RLPWriter_Test:test_writeString_shortstring() (gas: 2544)
RLPWriter_Test:test_writeString_shortstring() (gas: 2544)
RLPWriter_Test:test_writeString_shortstring2() (gas: 15563)
RLPWriter_Test:test_writeString_shortstring2() (gas: 15563)
RLPWriter_Test:test_writeUint_mediumint() (gas: 84
52
)
RLPWriter_Test:test_writeUint_mediumint() (gas: 84
30
)
RLPWriter_Test:test_writeUint_mediumint2() (gas: 8780)
RLPWriter_Test:test_writeUint_mediumint2() (gas: 8780)
RLPWriter_Test:test_writeUint_mediumint3() (gas: 9189)
RLPWriter_Test:test_writeUint_mediumint3() (gas: 9189)
RLPWriter_Test:test_writeUint_smallint() (gas: 7350)
RLPWriter_Test:test_writeUint_smallint() (gas: 7350)
RLPWriter_Test:test_writeUint_smallint2() (gas: 7352)
RLPWriter_Test:test_writeUint_smallint2() (gas: 7352)
RLPWriter_Test:test_writeUint_smallint3() (gas: 7372)
RLPWriter_Test:test_writeUint_smallint3() (gas: 7372)
RLPWriter_Test:test_writeUint_smallint4() (gas: 73
73
)
RLPWriter_Test:test_writeUint_smallint4() (gas: 73
51
)
RLPWriter_Test:test_writeUint_zero() (gas: 7798)
RLPWriter_Test:test_writeUint_zero() (gas: 7798)
ResourceMetering_Test:test_initialResourceParams() (gas: 89
86
)
ResourceMetering_Test:test_initialResourceParams() (gas: 89
64
)
ResourceMetering_Test:test_updateNoGasDelta() (gas: 2008317)
ResourceMetering_Test:test_updateNoGasDelta() (gas: 2008317)
ResourceMetering_Test:test_updateOneEmptyBlock() (gas: 181
26
)
ResourceMetering_Test:test_updateOneEmptyBlock() (gas: 181
71
)
ResourceMetering_Test:test_updateParamsNoChange() (gas: 13956)
ResourceMetering_Test:test_updateParamsNoChange() (gas: 13956)
ResourceMetering_Test:test_updateTenEmptyBlocks() (gas: 205
93
)
ResourceMetering_Test:test_updateTenEmptyBlocks() (gas: 205
71
)
ResourceMetering_Test:test_updateTwoEmptyBlocks() (gas: 20594)
ResourceMetering_Test:test_updateTwoEmptyBlocks() (gas: 20594)
ResourceMetering_Test:test_useMaxSucceeds() (gas: 8017
141
)
ResourceMetering_Test:test_useMaxSucceeds() (gas: 8017
087
)
ResourceMetering_Test:test_useMoreThanMaxReverts() (gas: 160
69
)
ResourceMetering_Test:test_useMoreThanMaxReverts() (gas: 160
47
)
Semver_Test:test_behindProxy() (gas: 5049
30
)
Semver_Test:test_behindProxy() (gas: 5049
08
)
Semver_Test:test_major() (gas: 54
28
)
Semver_Test:test_major() (gas: 54
06
)
Semver_Test:test_minor() (gas: 5430)
Semver_Test:test_minor() (gas: 5430)
Semver_Test:test_patch() (gas: 53
86
)
Semver_Test:test_patch() (gas: 53
64
)
SequencerFeeVault_Test:test_constructor() (gas: 76
11
)
SequencerFeeVault_Test:test_constructor() (gas: 76
56
)
SequencerFeeVault_Test:test_minWithdrawalAmount() (gas: 54
29
)
SequencerFeeVault_Test:test_minWithdrawalAmount() (gas: 54
07
)
SequencerFeeVault_Test:test_receive() (gas: 17
25
8)
SequencerFeeVault_Test:test_receive() (gas: 17
33
8)
SequencerFeeVault_Test:test_revertWithdraw() (gas: 9
267
)
SequencerFeeVault_Test:test_revertWithdraw() (gas: 9
332
)
SequencerFeeVault_Test:test_withdraw() (gas: 1473
45
)
SequencerFeeVault_Test:test_withdraw() (gas: 1473
23
)
packages/contracts-bedrock/contracts/legacy/LegacyERC20ETH.sol
View file @
16481af9
...
@@ -23,87 +23,62 @@ contract LegacyERC20ETH is OptimismMintableERC20 {
...
@@ -23,87 +23,62 @@ contract LegacyERC20ETH is OptimismMintableERC20 {
{}
{}
/**
/**
* @custom:blocked
* @notice Mints some amount of ETH.
* @notice Mints some amount of ETH.
*
* @param _to Address of the recipient.
* @param _amount Amount of ETH to mint.
*/
*/
function mint(address
_to, uint256 _amount
) public virtual override {
function mint(address
, uint256
) public virtual override {
revert("LegacyERC20ETH: mint is disabled");
revert("LegacyERC20ETH: mint is disabled");
}
}
/**
/**
* @custom:blocked
* @notice Burns some amount of ETH.
* @notice Burns some amount of ETH.
*
* @param _from Address to burn from.
* @param _amount Amount of ETH to burn.
*/
*/
function burn(address
_from, uint256 _amount
) public virtual override {
function burn(address
, uint256
) public virtual override {
revert("LegacyERC20ETH: burn is disabled");
revert("LegacyERC20ETH: burn is disabled");
}
}
/**
/**
* @custom:blocked
* @notice Transfers some amount of ETH.
* @notice Transfers some amount of ETH.
*
* @param _recipient Address to send to.
* @param _amount Amount of ETH to send.
*/
*/
function transfer(address
_recipient, uint256 _amount
) public virtual override returns (bool) {
function transfer(address
, uint256
) public virtual override returns (bool) {
revert("LegacyERC20ETH: transfer is disabled");
revert("LegacyERC20ETH: transfer is disabled");
}
}
/**
/**
* @custom:blocked
* @notice Approves a spender to spend some amount of ETH.
* @notice Approves a spender to spend some amount of ETH.
*
* @param _spender Address of the spender.
* @param _amount Amount of ETH to approve.
*/
*/
function approve(address
_spender, uint256 _amount
) public virtual override returns (bool) {
function approve(address
, uint256
) public virtual override returns (bool) {
revert("LegacyERC20ETH: approve is disabled");
revert("LegacyERC20ETH: approve is disabled");
}
}
/**
/**
* @custom:blocked
* @notice Transfers funds from some sender account.
* @notice Transfers funds from some sender account.
*
* @param _sender Address of the sender.
* @param _recipient Address of the recipient.
* @param _amount Amount of ETH to transfer.
*/
*/
function transferFrom(
function transferFrom(
address
_sender
,
address,
address
_recipient
,
address,
uint256
_amount
uint256
) public virtual override returns (bool) {
) public virtual override returns (bool) {
revert("LegacyERC20ETH: transferFrom is disabled");
revert("LegacyERC20ETH: transferFrom is disabled");
}
}
/**
/**
* @custom:blocked
* @notice Increases the allowance of a spender.
* @notice Increases the allowance of a spender.
*
* @param _spender Address of the spender.
* @param _addedValue Amount of ETH to increase the allowance by.
*/
*/
function increaseAllowance(address _spender, uint256 _addedValue)
function increaseAllowance(address, uint256) public virtual override returns (bool) {
public
virtual
override
returns (bool)
{
revert("LegacyERC20ETH: increaseAllowance is disabled");
revert("LegacyERC20ETH: increaseAllowance is disabled");
}
}
/**
/**
* @custom:blocked
* @notice Decreases the allowance of a spender.
* @notice Decreases the allowance of a spender.
*
* @param _spender Address of the spender.
* @param _subtractedValue Amount of ETH to decrease the allowance by.
*/
*/
function decreaseAllowance(address _spender, uint256 _subtractedValue)
function decreaseAllowance(address, uint256) public virtual override returns (bool) {
public
virtual
override
returns (bool)
{
revert("LegacyERC20ETH: decreaseAllowance is disabled");
revert("LegacyERC20ETH: decreaseAllowance is disabled");
}
}
}
}
packages/contracts-bedrock/contracts/test/L1CrossDomainMessenger.t.sol
View file @
16481af9
...
@@ -198,7 +198,6 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
...
@@ -198,7 +198,6 @@ contract L1CrossDomainMessenger_Test is Messenger_Initializer {
address sender = PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER;
address sender = PredeployAddresses.L2_CROSS_DOMAIN_MESSENGER;
uint256 senderSlotIndex = 51;
uint256 senderSlotIndex = 51;
bytes32 slotValue = vm.load(address(op), bytes32(senderSlotIndex));
vm.store(address(op), bytes32(senderSlotIndex), bytes32(abi.encode(sender)));
vm.store(address(op), bytes32(senderSlotIndex), bytes32(abi.encode(sender)));
vm.prank(address(op));
vm.prank(address(op));
...
...
packages/contracts-bedrock/contracts/test/L1StandardBridge.t.sol
View file @
16481af9
...
@@ -59,7 +59,8 @@ contract L1StandardBridge_Test is Bridge_Initializer {
...
@@ -59,7 +59,8 @@ contract L1StandardBridge_Test is Bridge_Initializer {
);
);
vm.prank(alice, alice);
vm.prank(alice, alice);
address(L1Bridge).call{ value: 100 }(hex"");
(bool success,) = address(L1Bridge).call{ value: 100 }(hex"");
assertEq(success, true);
assertEq(address(op).balance, 100);
assertEq(address(op).balance, 100);
}
}
...
...
packages/contracts-bedrock/contracts/test/L2OutputOracle.t.sol
View file @
16481af9
...
@@ -357,12 +357,22 @@ contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer {
...
@@ -357,12 +357,22 @@ contract L2OutputOracleUpgradeable_Test is L2OutputOracle_Initializer {
function test_cannotInitProxy() external {
function test_cannotInitProxy() external {
vm.expectRevert("Initializable: contract is already initialized");
vm.expectRevert("Initializable: contract is already initialized");
address(proxy).call(abi.encodeWithSelector(L2OutputOracle.initialize.selector));
L2OutputOracle(payable(proxy)).initialize(
genesisL2Output,
startingBlockNumber,
sequencer,
owner
);
}
}
function test_cannotInitImpl() external {
function test_cannotInitImpl() external {
vm.expectRevert("Initializable: contract is already initialized");
vm.expectRevert("Initializable: contract is already initialized");
address(oracleImpl).call(abi.encodeWithSelector(L2OutputOracle.initialize.selector));
L2OutputOracle(oracleImpl).initialize(
genesisL2Output,
startingBlockNumber,
sequencer,
owner
);
}
}
function test_upgrading() external {
function test_upgrading() external {
...
...
packages/contracts-bedrock/contracts/test/L2StandardBridge.t.sol
View file @
16481af9
...
@@ -40,7 +40,8 @@ contract L2StandardBridge_Test is Bridge_Initializer {
...
@@ -40,7 +40,8 @@ contract L2StandardBridge_Test is Bridge_Initializer {
// TODO: events from each contract
// TODO: events from each contract
vm.prank(alice, alice);
vm.prank(alice, alice);
address(L2Bridge).call{ value: 100 }(hex"");
(bool success,) = address(L2Bridge).call{ value: 100 }(hex"");
assertEq(success, true);
assertEq(address(messagePasser).balance, 100);
assertEq(address(messagePasser).balance, 100);
}
}
...
...
packages/contracts-bedrock/contracts/test/OptimismPortal.t.sol
View file @
16481af9
...
@@ -334,12 +334,12 @@ contract OptimismPortalUpgradeable_Test is Portal_Initializer {
...
@@ -334,12 +334,12 @@ contract OptimismPortalUpgradeable_Test is Portal_Initializer {
function test_cannotInitProxy() external {
function test_cannotInitProxy() external {
vm.expectRevert("Initializable: contract is already initialized");
vm.expectRevert("Initializable: contract is already initialized");
address(proxy).call(abi.encodeWithSelector(OptimismPortal.initialize.selector)
);
OptimismPortal(payable(proxy)).initialize(
);
}
}
function test_cannotInitImpl() external {
function test_cannotInitImpl() external {
vm.expectRevert("Initializable: contract is already initialized");
vm.expectRevert("Initializable: contract is already initialized");
address(opImpl).call(abi.encodeWithSelector(OptimismPortal.initialize.selector)
);
OptimismPortal(opImpl).initialize(
);
}
}
function test_upgrading() external {
function test_upgrading() external {
...
...
packages/contracts-bedrock/contracts/test/Proxy.t.sol
View file @
16481af9
...
@@ -18,7 +18,7 @@ contract SimpleStorage {
...
@@ -18,7 +18,7 @@ contract SimpleStorage {
}
}
contract Clasher {
contract Clasher {
function upgradeTo(address
_implementation) external view
{
function upgradeTo(address
) external pure
{
revert("upgradeTo");
revert("upgradeTo");
}
}
}
}
...
@@ -150,8 +150,8 @@ contract Proxy_Test is Test {
...
@@ -150,8 +150,8 @@ contract Proxy_Test is Test {
function test_upgradeToAndCall() external {
function test_upgradeToAndCall() external {
{
{
// There should be nothing in the current proxy storage
// There should be nothing in the current proxy storage
uint256
resul
t = SimpleStorage(address(proxy)).get(1);
uint256
expec
t = SimpleStorage(address(proxy)).get(1);
assertEq(
resul
t, 0);
assertEq(
expec
t, 0);
}
}
// Deploy a new SimpleStorage
// Deploy a new SimpleStorage
...
...
packages/contracts-bedrock/contracts/test/ResourceMetering.t.sol
View file @
16481af9
...
@@ -92,12 +92,12 @@ contract ResourceMetering_Test is CommonTest {
...
@@ -92,12 +92,12 @@ contract ResourceMetering_Test is CommonTest {
uint64 elasticity = uint64(uint256(meter.ELASTICITY_MULTIPLIER()));
uint64 elasticity = uint64(uint256(meter.ELASTICITY_MULTIPLIER()));
meter.use(target * elasticity);
meter.use(target * elasticity);
(
uint128 prevBaseFee, uint64 prevBoughtGas, uint64 prevBlockNum
) = meter.params();
(
, uint64 prevBoughtGas,
) = meter.params();
assertEq(prevBoughtGas, target * elasticity);
assertEq(prevBoughtGas, target * elasticity);
vm.roll(initialBlockNum + 1);
vm.roll(initialBlockNum + 1);
meter.use(0);
meter.use(0);
(uint128 postBaseFee,
uint64 postBoughtGas, uint64 postBlockNum
) = meter.params();
(uint128 postBaseFee,
,
) = meter.params();
// Base fee increases by 1/8 the difference
// Base fee increases by 1/8 the difference
assertEq(postBaseFee, 1375000000);
assertEq(postBaseFee, 1375000000);
}
}
...
...
packages/contracts-bedrock/contracts/test/SequencerFeeVault.t.sol
View file @
16481af9
...
@@ -48,8 +48,9 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
...
@@ -48,8 +48,9 @@ contract SequencerFeeVault_Test is Bridge_Initializer {
);
);
vm.prank(alice);
vm.prank(alice);
address(vault).call{ value: 100 }(hex"");
(bool success,) =
address(vault).call{ value: 100 }(hex"");
assertEq(success, true);
assertEq(
assertEq(
address(vault).balance,
address(vault).balance,
100
100
...
...
packages/fault-detector/src/service.ts
View file @
16481af9
...
@@ -2,7 +2,7 @@ import { BaseServiceV2, Gauge, validators } from '@eth-optimism/common-ts'
...
@@ -2,7 +2,7 @@ import { BaseServiceV2, Gauge, validators } from '@eth-optimism/common-ts'
import
{
getChainId
,
sleep
,
toRpcHexString
}
from
'
@eth-optimism/core-utils
'
import
{
getChainId
,
sleep
,
toRpcHexString
}
from
'
@eth-optimism/core-utils
'
import
{
CrossChainMessenger
}
from
'
@eth-optimism/sdk
'
import
{
CrossChainMessenger
}
from
'
@eth-optimism/sdk
'
import
{
Provider
}
from
'
@ethersproject/abstract-provider
'
import
{
Provider
}
from
'
@ethersproject/abstract-provider
'
import
{
Contract
,
ethers
}
from
'
ethers
'
import
{
Contract
,
ethers
,
Transaction
}
from
'
ethers
'
import
dateformat
from
'
dateformat
'
import
dateformat
from
'
dateformat
'
import
{
import
{
...
@@ -20,10 +20,12 @@ type Metrics = {
...
@@ -20,10 +20,12 @@ type Metrics = {
highestCheckedBatchIndex
:
Gauge
highestCheckedBatchIndex
:
Gauge
highestKnownBatchIndex
:
Gauge
highestKnownBatchIndex
:
Gauge
isCurrentlyMismatched
:
Gauge
isCurrentlyMismatched
:
Gauge
inUnexpectedErrorState
:
Gauge
l1NodeConnectionFailures
:
Gauge
l2NodeConnectionFailures
:
Gauge
}
}
type
State
=
{
type
State
=
{
fpw
:
number
scc
:
Contract
scc
:
Contract
messenger
:
CrossChainMessenger
messenger
:
CrossChainMessenger
highestCheckedBatchIndex
:
number
highestCheckedBatchIndex
:
number
...
@@ -68,9 +70,13 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -68,9 +70,13 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
type
:
Gauge
,
type
:
Gauge
,
desc
:
'
0 if state is ok, 1 if state is mismatched
'
,
desc
:
'
0 if state is ok, 1 if state is mismatched
'
,
},
},
inUnexpectedErrorState
:
{
l1NodeConnectionFailures
:
{
type
:
Gauge
,
type
:
Gauge
,
desc
:
'
0 if service is ok, 1 service is in unexpected error state
'
,
desc
:
'
Number of times L1 node connection has failed
'
,
},
l2NodeConnectionFailures
:
{
type
:
Gauge
,
desc
:
'
Number of times L2 node connection has failed
'
,
},
},
},
},
})
})
...
@@ -86,6 +92,7 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -86,6 +92,7 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
// We use this a lot, a bit cleaner to pull out to the top level of the state object.
// We use this a lot, a bit cleaner to pull out to the top level of the state object.
this
.
state
.
scc
=
this
.
state
.
messenger
.
contracts
.
l1
.
StateCommitmentChain
this
.
state
.
scc
=
this
.
state
.
messenger
.
contracts
.
l1
.
StateCommitmentChain
this
.
state
.
fpw
=
(
await
this
.
state
.
scc
.
FRAUD_PROOF_WINDOW
()).
toNumber
()
// Figure out where to start syncing from.
// Figure out where to start syncing from.
if
(
this
.
options
.
startBatchIndex
===
-
1
)
{
if
(
this
.
options
.
startBatchIndex
===
-
1
)
{
...
@@ -102,17 +109,30 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -102,17 +109,30 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
}
}
async
main
():
Promise
<
void
>
{
async
main
():
Promise
<
void
>
{
const
latestBatchIndex
=
await
this
.
state
.
scc
.
getTotalBatches
()
let
latestBatchIndex
:
number
if
(
this
.
state
.
highestCheckedBatchIndex
>=
latestBatchIndex
.
toNumber
())
{
try
{
latestBatchIndex
=
(
await
this
.
state
.
scc
.
getTotalBatches
()).
toNumber
()
}
catch
(
err
)
{
this
.
logger
.
error
(
`got error when connecting to node`
,
{
error
:
err
,
node
:
'
l1
'
,
section
:
'
getTotalBatches
'
,
})
this
.
metrics
.
l1NodeConnectionFailures
.
inc
()
await
sleep
(
15000
)
await
sleep
(
15000
)
return
return
}
}
this
.
metrics
.
highestKnownBatchIndex
.
set
(
latestBatchIndex
.
toNumber
())
if
(
this
.
state
.
highestCheckedBatchIndex
>=
latestBatchIndex
)
{
await
sleep
(
15000
)
return
}
else
{
this
.
metrics
.
highestKnownBatchIndex
.
set
(
latestBatchIndex
)
}
this
.
logger
.
info
(
`checking batch`
,
{
this
.
logger
.
info
(
`checking batch`
,
{
batchIndex
:
this
.
state
.
highestCheckedBatchIndex
,
batchIndex
:
this
.
state
.
highestCheckedBatchIndex
,
latestIndex
:
latestBatchIndex
.
toNumber
()
,
latestIndex
:
latestBatchIndex
,
})
})
let
event
:
ethers
.
Event
let
event
:
ethers
.
Event
...
@@ -122,13 +142,30 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -122,13 +142,30 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
this
.
state
.
highestCheckedBatchIndex
this
.
state
.
highestCheckedBatchIndex
)
)
}
catch
(
err
)
{
}
catch
(
err
)
{
this
.
logger
.
error
(
`got unexpected error while searching for batch`
,
{
this
.
logger
.
error
(
`got error when connecting to node`
,
{
batchIndex
:
this
.
state
.
highestCheckedBatchIndex
,
error
:
err
,
error
:
err
,
node
:
'
l1
'
,
section
:
'
findEventForStateBatch
'
,
})
})
this
.
metrics
.
l1NodeConnectionFailures
.
inc
()
await
sleep
(
15000
)
return
}
let
batchTransaction
:
Transaction
try
{
batchTransaction
=
await
event
.
getTransaction
()
}
catch
(
err
)
{
this
.
logger
.
error
(
`got error when connecting to node`
,
{
error
:
err
,
node
:
'
l1
'
,
section
:
'
getTransaction
'
,
})
this
.
metrics
.
l1NodeConnectionFailures
.
inc
()
await
sleep
(
15000
)
return
}
}
const
batchTransaction
=
await
event
.
getTransaction
()
const
[
stateRoots
]
=
this
.
state
.
scc
.
interface
.
decodeFunctionData
(
const
[
stateRoots
]
=
this
.
state
.
scc
.
interface
.
decodeFunctionData
(
'
appendStateBatch
'
,
'
appendStateBatch
'
,
batchTransaction
.
data
batchTransaction
.
data
...
@@ -138,7 +175,20 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -138,7 +175,20 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
const
batchSize
=
event
.
args
.
_batchSize
.
toNumber
()
const
batchSize
=
event
.
args
.
_batchSize
.
toNumber
()
const
batchEnd
=
batchStart
+
batchSize
const
batchEnd
=
batchStart
+
batchSize
const
latestBlock
=
await
this
.
options
.
l2RpcProvider
.
getBlockNumber
()
let
latestBlock
:
number
try
{
latestBlock
=
await
this
.
options
.
l2RpcProvider
.
getBlockNumber
()
}
catch
(
err
)
{
this
.
logger
.
error
(
`got error when connecting to node`
,
{
error
:
err
,
node
:
'
l2
'
,
section
:
'
getBlockNumber
'
,
})
this
.
metrics
.
l2NodeConnectionFailures
.
inc
()
await
sleep
(
15000
)
return
}
if
(
latestBlock
<
batchEnd
)
{
if
(
latestBlock
<
batchEnd
)
{
this
.
logger
.
info
(
`node is behind, waiting for sync`
,
{
this
.
logger
.
info
(
`node is behind, waiting for sync`
,
{
batchEnd
,
batchEnd
,
...
@@ -151,21 +201,32 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -151,21 +201,32 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
// multiple requests of maximum 1000 blocks in the case that batchSize > 1000.
// multiple requests of maximum 1000 blocks in the case that batchSize > 1000.
let
blocks
:
any
[]
=
[]
let
blocks
:
any
[]
=
[]
for
(
let
i
=
0
;
i
<
batchSize
;
i
+=
1000
)
{
for
(
let
i
=
0
;
i
<
batchSize
;
i
+=
1000
)
{
const
provider
=
this
.
options
let
newBlocks
:
any
[]
.
l2RpcProvider
as
ethers
.
providers
.
JsonRpcProvider
try
{
blocks
=
blocks
.
concat
(
newBlocks
=
await
(
await
provider
.
send
(
'
eth_getBlockRange
'
,
[
this
.
options
.
l2RpcProvider
as
ethers
.
providers
.
JsonRpcProvider
).
send
(
'
eth_getBlockRange
'
,
[
toRpcHexString
(
batchStart
+
i
),
toRpcHexString
(
batchStart
+
i
),
toRpcHexString
(
batchStart
+
i
+
Math
.
min
(
batchSize
-
i
,
1000
)
-
1
),
toRpcHexString
(
batchStart
+
i
+
Math
.
min
(
batchSize
-
i
,
1000
)
-
1
),
false
,
false
,
])
])
)
}
catch
(
err
)
{
this
.
logger
.
error
(
`got error when connecting to node`
,
{
error
:
err
,
node
:
'
l2
'
,
section
:
'
getBlockRange
'
,
})
this
.
metrics
.
l2NodeConnectionFailures
.
inc
()
await
sleep
(
15000
)
return
}
blocks
=
blocks
.
concat
(
newBlocks
)
}
}
for
(
const
[
i
,
stateRoot
]
of
stateRoots
.
entries
())
{
for
(
const
[
i
,
stateRoot
]
of
stateRoots
.
entries
())
{
if
(
blocks
[
i
].
stateRoot
!==
stateRoot
)
{
if
(
blocks
[
i
].
stateRoot
!==
stateRoot
)
{
this
.
metrics
.
isCurrentlyMismatched
.
set
(
1
)
this
.
metrics
.
isCurrentlyMismatched
.
set
(
1
)
const
fpw
=
await
this
.
state
.
scc
.
FRAUD_PROOF_WINDOW
()
this
.
logger
.
error
(
`state root mismatch`
,
{
this
.
logger
.
error
(
`state root mismatch`
,
{
blockNumber
:
blocks
[
i
].
number
,
blockNumber
:
blocks
[
i
].
number
,
expectedStateRoot
:
blocks
[
i
].
stateRoot
,
expectedStateRoot
:
blocks
[
i
].
stateRoot
,
...
@@ -173,7 +234,7 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -173,7 +234,7 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
finalizationTime
:
dateformat
(
finalizationTime
:
dateformat
(
new
Date
(
new
Date
(
(
ethers
.
BigNumber
.
from
(
blocks
[
i
].
timestamp
).
toNumber
()
+
(
ethers
.
BigNumber
.
from
(
blocks
[
i
].
timestamp
).
toNumber
()
+
fpw
.
toNumber
()
)
*
this
.
state
.
fpw
)
*
1000
1000
),
),
'
mmmm dS, yyyy, h:MM:ss TT
'
'
mmmm dS, yyyy, h:MM:ss TT
'
...
@@ -190,7 +251,6 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
...
@@ -190,7 +251,6 @@ export class FaultDetector extends BaseServiceV2<Options, Metrics, State> {
// If we got through the above without throwing an error, we should be fine to reset.
// If we got through the above without throwing an error, we should be fine to reset.
this
.
metrics
.
isCurrentlyMismatched
.
set
(
0
)
this
.
metrics
.
isCurrentlyMismatched
.
set
(
0
)
this
.
metrics
.
inUnexpectedErrorState
.
set
(
0
)
}
}
}
}
...
...
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