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
2b6c0089
Commit
2b6c0089
authored
Feb 27, 2023
by
clabby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move `FINALIZATION_PERIOD_SECONDS` to `L2OutputOracle`; Need to update deployment etc.
parent
cde7b45e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
130 additions
and
131 deletions
+130
-131
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+94
-94
L2OutputOracle.sol
packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol
+9
-2
OptimismPortal.sol
packages/contracts-bedrock/contracts/L1/OptimismPortal.sol
+1
-9
FuzzOptimismPortal.sol
...ontracts-bedrock/contracts/echidna/FuzzOptimismPortal.sol
+0
-1
BenchmarkTest.t.sol
...ages/contracts-bedrock/contracts/test/BenchmarkTest.t.sol
+1
-1
CommonTest.t.sol
packages/contracts-bedrock/contracts/test/CommonTest.t.sol
+2
-3
L2OutputOracle.t.sol
...ges/contracts-bedrock/contracts/test/L2OutputOracle.t.sol
+6
-3
OptimismPortal.t.sol
...ges/contracts-bedrock/contracts/test/OptimismPortal.t.sol
+14
-15
OptimismPortal.t.sol
...ts-bedrock/contracts/test/invariants/OptimismPortal.t.sol
+3
-3
No files found.
packages/contracts-bedrock/.gas-snapshot
View file @
2b6c0089
...
...
@@ -22,23 +22,23 @@ CrossDomainOwnable3_Test:test_transferOwnershipNoLocal_succeeds() (gas: 48610)
CrossDomainOwnable3_Test:test_transferOwnership_noLocalZeroAddress_reverts() (gas: 12015)
CrossDomainOwnable3_Test:test_transferOwnership_notOwner_reverts() (gas: 13437)
CrossDomainOwnable3_Test:test_transferOwnership_zeroAddress_reverts() (gas: 12081)
CrossDomainOwnableThroughPortal_Test:test_depositTransaction_crossDomainOwner_succeeds() (gas: 72
49
4)
CrossDomainOwnableThroughPortal_Test:test_depositTransaction_crossDomainOwner_succeeds() (gas: 72
50
4)
CrossDomainOwnable_Test:test_onlyOwner_notOwner_reverts() (gas: 10597)
CrossDomainOwnable_Test:test_onlyOwner_succeeds() (gas: 34883)
DeployerWhitelist_Test:test_owner_succeeds() (gas: 7582)
DeployerWhitelist_Test:test_storageSlots_succeeds() (gas: 33395)
FeeVault_Test:test_constructor_succeeds() (gas: 10736)
FeeVault_Test:test_minWithdrawalAmount_succeeds() (gas: 10713)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 2613
4
0)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 760
6
7)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 348
29
2)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 1129
4
5)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 3483
1
4)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 1129
6
5)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 2613
5
0)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 760
7
7)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 348
30
2)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 1129
5
5)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 3483
2
4)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 1129
7
5)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 40409)
GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 885
35
)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 750
7
5)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 363
8
6)
GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 885
13
)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 750
8
5)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 363
9
6)
GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 169229)
GasPriceOracle_Test:test_baseFee_succeeds() (gas: 8325)
GasPriceOracle_Test:test_decimals_succeeds() (gas: 6167)
...
...
@@ -70,43 +70,43 @@ L1BlockTest:test_timestamp_succeeds() (gas: 7640)
L1BlockTest:test_updateValues_succeeds() (gas: 60482)
L1CrossDomainMessenger_Test:test_messageVersion_succeeds() (gas: 24715)
L1CrossDomainMessenger_Test:test_relayMessage_legacyOldReplay_reverts() (gas: 49394)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterFailureThenSuccess_reverts() (gas: 228
293
)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterFailure_succeeds() (gas: 201
787
)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterSuccess_reverts() (gas: 14
1987
)
L1CrossDomainMessenger_Test:test_relayMessage_legacy_succeeds() (gas: 74
897
)
L1CrossDomainMessenger_Test:test_relayMessage_reentrancyDiffMessage_succeeds() (gas: 7205
17
)
L1CrossDomainMessenger_Test:test_relayMessage_reentrancySameMessage_reverts() (gas: 6576
39
)
L1CrossDomainMessenger_Test:test_relayMessage_retryAfterFailure_succeeds() (gas: 195
694
)
L1CrossDomainMessenger_Test:test_relayMessage_succeeds() (gas: 718
33
)
L1CrossDomainMessenger_Test:test_relayMessage_toSystemContract_reverts() (gas: 962
77
)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterFailureThenSuccess_reverts() (gas: 228
315
)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterFailure_succeeds() (gas: 201
809
)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterSuccess_reverts() (gas: 14
2009
)
L1CrossDomainMessenger_Test:test_relayMessage_legacy_succeeds() (gas: 74
919
)
L1CrossDomainMessenger_Test:test_relayMessage_reentrancyDiffMessage_succeeds() (gas: 7205
61
)
L1CrossDomainMessenger_Test:test_relayMessage_reentrancySameMessage_reverts() (gas: 6576
61
)
L1CrossDomainMessenger_Test:test_relayMessage_retryAfterFailure_succeeds() (gas: 195
716
)
L1CrossDomainMessenger_Test:test_relayMessage_succeeds() (gas: 718
55
)
L1CrossDomainMessenger_Test:test_relayMessage_toSystemContract_reverts() (gas: 962
99
)
L1CrossDomainMessenger_Test:test_relayMessage_v2_reverts() (gas: 12365)
L1CrossDomainMessenger_Test:test_replayMessage_withValue_reverts() (gas: 53445)
L1CrossDomainMessenger_Test:test_sendMessage_succeeds() (gas: 299
69
4)
L1CrossDomainMessenger_Test:test_sendMessage_twice_succeeds() (gas: 14905
6
0)
L1CrossDomainMessenger_Test:test_xDomainMessageSender_reset_succeeds() (gas: 823
62
)
L1CrossDomainMessenger_Test:test_sendMessage_succeeds() (gas: 299
70
4)
L1CrossDomainMessenger_Test:test_sendMessage_twice_succeeds() (gas: 14905
8
0)
L1CrossDomainMessenger_Test:test_xDomainMessageSender_reset_succeeds() (gas: 823
84
)
L1CrossDomainMessenger_Test:test_xDomainSender_notSet_reverts() (gas: 24296)
L1ERC721Bridge_Test:test_bridgeERC721To_localTokenZeroAddress_reverts() (gas: 52707)
L1ERC721Bridge_Test:test_bridgeERC721To_remoteTokenZeroAddress_reverts() (gas: 27310)
L1ERC721Bridge_Test:test_bridgeERC721To_succeeds() (gas: 3547
4
0)
L1ERC721Bridge_Test:test_bridgeERC721To_succeeds() (gas: 3547
5
0)
L1ERC721Bridge_Test:test_bridgeERC721To_wrongOwner_reverts() (gas: 60934)
L1ERC721Bridge_Test:test_bridgeERC721_fromContract_reverts() (gas: 25666)
L1ERC721Bridge_Test:test_bridgeERC721_localTokenZeroAddress_reverts() (gas: 50564)
L1ERC721Bridge_Test:test_bridgeERC721_remoteTokenZeroAddress_reverts() (gas: 25124)
L1ERC721Bridge_Test:test_bridgeERC721_succeeds() (gas: 3523
2
0)
L1ERC721Bridge_Test:test_bridgeERC721_succeeds() (gas: 3523
3
0)
L1ERC721Bridge_Test:test_bridgeERC721_wrongOwner_reverts() (gas: 60830)
L1ERC721Bridge_Test:test_constructor_succeeds() (gas: 10200)
L1ERC721Bridge_Test:test_finalizeBridgeERC721_notEscrowed_reverts() (gas: 22119)
L1ERC721Bridge_Test:test_finalizeBridgeERC721_notFromRemoteMessenger_reverts() (gas: 19797)
L1ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (gas: 16049)
L1ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17615)
L1ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 3238
3
2)
L1StandardBridge_BridgeETHTo_Test:test_bridgeETHTo_succeeds() (gas: 4195
8
2)
L1StandardBridge_BridgeETH_Test:test_bridgeETH_succeeds() (gas: 4068
0
3)
L1StandardBridge_DepositERC20To_Test:test_depositERC20To_succeeds() (gas: 6248
7
9)
L1StandardBridge_DepositERC20_Test:test_depositERC20_succeeds() (gas: 6225
8
0)
L1ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 3238
4
2)
L1StandardBridge_BridgeETHTo_Test:test_bridgeETHTo_succeeds() (gas: 4195
9
2)
L1StandardBridge_BridgeETH_Test:test_bridgeETH_succeeds() (gas: 4068
1
3)
L1StandardBridge_DepositERC20To_Test:test_depositERC20To_succeeds() (gas: 6248
8
9)
L1StandardBridge_DepositERC20_Test:test_depositERC20_succeeds() (gas: 6225
9
0)
L1StandardBridge_DepositERC20_TestFail:test_depositERC20_notEoa_reverts() (gas: 22320)
L1StandardBridge_DepositETHTo_Test:test_depositETHTo_succeeds() (gas: 4196
5
9)
L1StandardBridge_DepositETH_Test:test_depositETH_succeeds() (gas: 406
89
7)
L1StandardBridge_DepositETHTo_Test:test_depositETHTo_succeeds() (gas: 4196
6
9)
L1StandardBridge_DepositETH_Test:test_depositETH_succeeds() (gas: 406
90
7)
L1StandardBridge_DepositETH_TestFail:test_depositETH_notEoa_reverts() (gas: 40780)
L1StandardBridge_FinalizeBridgeETH_Test:test_finalizeBridgeETH_succeeds() (gas: 51674)
L1StandardBridge_FinalizeBridgeETH_TestFail:test_finalizeBridgeETH_incorrectValue_reverts() (gas: 34207)
...
...
@@ -118,7 +118,7 @@ L1StandardBridge_FinalizeERC20Withdrawal_TestFail:test_finalizeERC20Withdrawal_n
L1StandardBridge_FinalizeETHWithdrawal_Test:test_finalizeETHWithdrawal_succeeds() (gas: 61722)
L1StandardBridge_Getter_Test:test_getters_succeeds() (gas: 32173)
L1StandardBridge_Initialize_Test:test_initialize_succeeds() (gas: 22050)
L1StandardBridge_Receive_Test:test_receive_succeeds() (gas: 5202
0
6)
L1StandardBridge_Receive_Test:test_receive_succeeds() (gas: 5202
1
6)
L2CrossDomainMessenger_Test:test_messageVersion_succeeds() (gas: 8411)
L2CrossDomainMessenger_Test:test_relayMessage_reentrancyDiffMessage_succeeds() (gas: 681087)
L2CrossDomainMessenger_Test:test_relayMessage_reentrancySameMessage_reverts() (gas: 626802)
...
...
@@ -145,34 +145,34 @@ L2ERC721Bridge_Test:test_finalizeBridgeERC721_notFromRemoteMessenger_reverts() (
L2ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (gas: 16104)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17659)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 168970)
L2OutputOracleTest:test_computeL2Timestamp_succeeds() (gas: 372
06
)
L2OutputOracleTest:test_constructor_badTimestamp_reverts() (gas: 70
838
)
L2OutputOracleTest:test_constructor_l2BlockTimeZero_reverts() (gas: 45
856
)
L2OutputOracleTest:test_constructor_succeeds() (gas: 33
760
)
L2OutputOracleTest:test_deleteL2Outputs_afterLatest_reverts() (gas: 2122
79
)
L2OutputOracleTest:test_deleteL2Outputs_finalized_reverts() (gas: 10774
2
)
L2OutputOracleTest:test_deleteL2Outputs_ifNotChallenger_reverts() (gas: 18
895
)
L2OutputOracleTest:test_deleteL2Outputs_nonExistent_reverts() (gas: 10733
7
)
L2OutputOracleTest:test_deleteOutputs_multipleOutputs_succeeds() (gas: 302
544
)
L2OutputOracleTest:test_deleteOutputs_singleOutput_succeeds() (gas: 181
101
)
L2OutputOracleTest:test_getL2OutputIndexAfter_multipleOutputsExist_succeeds() (gas: 267
204
)
L2OutputOracleTest:test_computeL2Timestamp_succeeds() (gas: 372
98
)
L2OutputOracleTest:test_constructor_badTimestamp_reverts() (gas: 70
950
)
L2OutputOracleTest:test_constructor_l2BlockTimeZero_reverts() (gas: 45
957
)
L2OutputOracleTest:test_constructor_succeeds() (gas: 33
827
)
L2OutputOracleTest:test_deleteL2Outputs_afterLatest_reverts() (gas: 2122
62
)
L2OutputOracleTest:test_deleteL2Outputs_finalized_reverts() (gas: 10774
4
)
L2OutputOracleTest:test_deleteL2Outputs_ifNotChallenger_reverts() (gas: 18
918
)
L2OutputOracleTest:test_deleteL2Outputs_nonExistent_reverts() (gas: 10733
9
)
L2OutputOracleTest:test_deleteOutputs_multipleOutputs_succeeds() (gas: 302
439
)
L2OutputOracleTest:test_deleteOutputs_singleOutput_succeeds() (gas: 181
038
)
L2OutputOracleTest:test_getL2OutputIndexAfter_multipleOutputsExist_succeeds() (gas: 267
120
)
L2OutputOracleTest:test_getL2OutputIndexAfter_noOutputsExis_reverts() (gas: 17959)
L2OutputOracleTest:test_getL2OutputIndexAfter_previousBlock_succeeds() (gas: 960
87
)
L2OutputOracleTest:test_getL2OutputIndexAfter_sameBlock_succeeds() (gas: 9
6016
)
L2OutputOracleTest:test_getL2Output_succeeds() (gas: 1016
99
)
L2OutputOracleTest:test_latestBlockNumber_succeeds() (gas: 969
83
)
L2OutputOracleTest:test_nextBlockNumber_succeeds() (gas: 17
512
)
L2OutputOracleTest:test_proposeL2Output_emptyOutput_reverts() (gas: 26
711
)
L2OutputOracleTest:test_proposeL2Output_futureTimetamp_reverts() (gas: 286
90
)
L2OutputOracleTest:test_proposeL2Output_notProposer_reverts() (gas: 25
804
)
L2OutputOracleTest:test_proposeL2Output_proposeAnotherOutput_succeeds() (gas: 1010
49
)
L2OutputOracleTest:test_proposeL2Output_unexpectedBlockNumber_reverts() (gas: 28
402
)
L2OutputOracleTest:test_proposeL2Output_unmatchedBlockhash_reverts() (gas: 29
402
)
L2OutputOracleTest:test_proposeL2Output_wrongFork_reverts() (gas: 2
9005
)
L2OutputOracleTest:test_proposeWithBlockhashAndHeight_succeeds() (gas: 952
74
)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy_succeeds() (gas: 26
141
)
L2OutputOracleUpgradeable_Test:test_initializeImpl_alreadyInitialized_reverts() (gas: 151
71
)
L2OutputOracleUpgradeable_Test:test_initializeProxy_alreadyInitialized_reverts() (gas: 201
97
)
L2OutputOracleTest:test_getL2OutputIndexAfter_previousBlock_succeeds() (gas: 960
66
)
L2OutputOracleTest:test_getL2OutputIndexAfter_sameBlock_succeeds() (gas: 9
5995
)
L2OutputOracleTest:test_getL2Output_succeeds() (gas: 1016
34
)
L2OutputOracleTest:test_latestBlockNumber_succeeds() (gas: 969
62
)
L2OutputOracleTest:test_nextBlockNumber_succeeds() (gas: 17
490
)
L2OutputOracleTest:test_proposeL2Output_emptyOutput_reverts() (gas: 26
690
)
L2OutputOracleTest:test_proposeL2Output_futureTimetamp_reverts() (gas: 286
69
)
L2OutputOracleTest:test_proposeL2Output_notProposer_reverts() (gas: 25
783
)
L2OutputOracleTest:test_proposeL2Output_proposeAnotherOutput_succeeds() (gas: 1010
28
)
L2OutputOracleTest:test_proposeL2Output_unexpectedBlockNumber_reverts() (gas: 28
381
)
L2OutputOracleTest:test_proposeL2Output_unmatchedBlockhash_reverts() (gas: 29
381
)
L2OutputOracleTest:test_proposeL2Output_wrongFork_reverts() (gas: 2
8984
)
L2OutputOracleTest:test_proposeWithBlockhashAndHeight_succeeds() (gas: 952
53
)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy_succeeds() (gas: 26
208
)
L2OutputOracleUpgradeable_Test:test_initializeImpl_alreadyInitialized_reverts() (gas: 151
49
)
L2OutputOracleUpgradeable_Test:test_initializeProxy_alreadyInitialized_reverts() (gas: 201
75
)
L2OutputOracleUpgradeable_Test:test_upgrading_succeeds() (gas: 180481)
L2StandardBridge_BridgeERC20To_Test:test_bridgeERC20To_succeeds() (gas: 387833)
L2StandardBridge_BridgeERC20To_Test:test_withdrawTo_withdrawingERC20_succeeds() (gas: 388064)
...
...
@@ -256,48 +256,48 @@ OptimismMintableTokenFactory_Test:test_bridge_succeeds() (gas: 7580)
OptimismMintableTokenFactory_Test:test_createStandardL2Token_remoteIsZero_succeeds() (gas: 9390)
OptimismMintableTokenFactory_Test:test_createStandardL2Token_sameTwice_succeeds() (gas: 2523203)
OptimismMintableTokenFactory_Test:test_createStandardL2Token_succeeds() (gas: 1268564)
OptimismPortalUpgradeable_Test:test_initialize_cannotInitImpl_reverts() (gas: 1
1016
)
OptimismPortalUpgradeable_Test:test_initialize_cannotInitProxy_reverts() (gas: 15
940
)
OptimismPortalUpgradeable_Test:test_params_initValuesOnProxy_succeeds() (gas: 160
56
)
OptimismPortalUpgradeable_Test:test_initialize_cannotInitImpl_reverts() (gas: 1
0971
)
OptimismPortalUpgradeable_Test:test_initialize_cannotInitProxy_reverts() (gas: 15
895
)
OptimismPortalUpgradeable_Test:test_params_initValuesOnProxy_succeeds() (gas: 160
78
)
OptimismPortalUpgradeable_Test:test_upgradeToAndCall_upgrading_succeeds() (gas: 180547)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputRootChanges_reverts() (gas: 20
1010
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputTimestampIsNotFinalized_reverts() (gas: 20
3373
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalNotProven_reverts() (gas: 417
98
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalProofNotOldEnough_reverts() (gas: 19
8396
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onInsufficientGas_reverts() (gas:
199219
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onRecentWithdrawal_reverts() (gas: 1
7913
9)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReentrancy_reverts() (gas: 2
37848
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReplay_reverts() (gas: 2
39372
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_paused_reverts() (gas: 53
621
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_provenWithdrawalHash_succeeds() (gas: 23
0921
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_targetFails_fails() (gas: 8797746687696163
739
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_timestampLessThanL2OracleStart_reverts() (gas: 19
5098
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputRootChanges_reverts() (gas: 20
4067
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputTimestampIsNotFinalized_reverts() (gas: 20
7520
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalNotProven_reverts() (gas: 417
53
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalProofNotOldEnough_reverts() (gas: 19
9464
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onInsufficientGas_reverts() (gas:
203388
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onRecentWithdrawal_reverts() (gas: 1
8022
9)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReentrancy_reverts() (gas: 2
44483
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReplay_reverts() (gas: 2
45634
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_paused_reverts() (gas: 53
555
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_provenWithdrawalHash_succeeds() (gas: 23
5047
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_targetFails_fails() (gas: 8797746687696163
866
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_timestampLessThanL2OracleStart_reverts() (gas: 19
7042
)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onInvalidOutputRootProof_reverts() (gas: 85690)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onInvalidWithdrawalProof_reverts() (gas: 137350)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onSelfCall_reverts() (gas: 529
25
)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_paused_reverts() (gas: 7369
5
)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProveChangedOutputRootAndOutputIndex_succeeds() (gas: 3468
75
)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onSelfCall_reverts() (gas: 529
47
)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_paused_reverts() (gas: 7369
6
)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProveChangedOutputRootAndOutputIndex_succeeds() (gas: 3468
53
)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProveChangedOutputRoot_succeeds() (gas: 279593)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProve_reverts() (gas: 1925
70
)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProve_reverts() (gas: 1925
48
)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_validWithdrawalProof_succeeds() (gas: 180486)
OptimismPortal_Test:test_constructor_succeeds() (gas:
20672
)
OptimismPortal_Test:test_depositTransaction_contractCreation_reverts() (gas: 143
2
0)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForContract_succeeds() (gas: 767
4
8)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForEOA_succeeds() (gas: 771
1
4)
OptimismPortal_Test:test_depositTransaction_noValueContract_succeeds() (gas: 767
6
6)
OptimismPortal_Test:test_depositTransaction_noValueEOA_succeeds() (gas: 771
1
1)
OptimismPortal_Test:test_depositTransaction_smallGasLimit_reverts() (gas: 142
6
6)
OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreation_succeeds() (gas: 837
7
2)
OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation_succeeds() (gas: 759
2
5)
OptimismPortal_Test:test_depositTransaction_withEthValueFromContract_succeeds() (gas: 834
5
2)
OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA_succeeds() (gas: 840
6
8)
OptimismPortal_Test:test_isOutputFinalized_succeeds() (gas: 1
19519
)
OptimismPortal_Test:test_pause_onlyGuardian_reverts() (gas: 22
182
)
OptimismPortal_Test:test_pause_succeeds() (gas: 421
61
)
OptimismPortal_Test:test_constructor_succeeds() (gas:
19440
)
OptimismPortal_Test:test_depositTransaction_contractCreation_reverts() (gas: 143
3
0)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForContract_succeeds() (gas: 767
5
8)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForEOA_succeeds() (gas: 771
2
4)
OptimismPortal_Test:test_depositTransaction_noValueContract_succeeds() (gas: 767
7
6)
OptimismPortal_Test:test_depositTransaction_noValueEOA_succeeds() (gas: 771
2
1)
OptimismPortal_Test:test_depositTransaction_smallGasLimit_reverts() (gas: 142
7
6)
OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreation_succeeds() (gas: 837
8
2)
OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation_succeeds() (gas: 759
3
5)
OptimismPortal_Test:test_depositTransaction_withEthValueFromContract_succeeds() (gas: 834
6
2)
OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA_succeeds() (gas: 840
7
8)
OptimismPortal_Test:test_isOutputFinalized_succeeds() (gas: 1
21711
)
OptimismPortal_Test:test_pause_onlyGuardian_reverts() (gas: 22
205
)
OptimismPortal_Test:test_pause_succeeds() (gas: 421
84
)
OptimismPortal_Test:test_receive_succeeds() (gas: 127554)
OptimismPortal_Test:test_simple_isOutputFinalized_succeeds() (gas:
24232
)
OptimismPortal_Test:test_simple_isOutputFinalized_succeeds() (gas:
32934
)
OptimismPortal_Test:test_unpause_onlyGuardian_reverts() (gas: 46151)
OptimismPortal_Test:test_unpause_succeeds() (gas: 317
80
)
OptimismPortal_Test:test_unpause_succeeds() (gas: 317
63
)
ProxyAdmin_Test:test_chugsplashChangeProxyAdmin_succeeds() (gas: 35586)
ProxyAdmin_Test:test_chugsplashGetProxyAdmin_succeeds() (gas: 15675)
ProxyAdmin_Test:test_chugsplashGetProxyImplementation_succeeds() (gas: 51084)
...
...
packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol
View file @
2b6c0089
...
...
@@ -34,6 +34,11 @@ contract L2OutputOracle is Initializable, Semver {
*/
address public immutable PROPOSER;
/**
* @notice Minimum time (in seconds) that must elapse before a withdrawal can be finalized.
*/
uint256 public immutable FINALIZATION_PERIOD_SECONDS;
/**
* @notice The number of the first L2 block recorded in this contract.
*/
...
...
@@ -88,7 +93,8 @@ contract L2OutputOracle is Initializable, Semver {
uint256 _startingBlockNumber,
uint256 _startingTimestamp,
address _proposer,
address _challenger
address _challenger,
uint256 _finalizationPeriodSeconds
) Semver(1, 1, 0) {
require(_l2BlockTime > 0, "L2OutputOracle: L2 block time must be greater than 0");
require(
...
...
@@ -100,6 +106,7 @@ contract L2OutputOracle is Initializable, Semver {
L2_BLOCK_TIME = _l2BlockTime;
PROPOSER = _proposer;
CHALLENGER = _challenger;
FINALIZATION_PERIOD_SECONDS = _finalizationPeriodSeconds;
initialize(_startingBlockNumber, _startingTimestamp);
}
...
...
@@ -145,7 +152,7 @@ contract L2OutputOracle is Initializable, Semver {
// Do not allow deleting any outputs that have already been finalized.
require(
block.timestamp - l2Outputs[_l2OutputIndex].timestamp <
7 days
,
block.timestamp - l2Outputs[_l2OutputIndex].timestamp <
FINALIZATION_PERIOD_SECONDS
,
"L2OutputOracle: cannot delete outputs that have already been finalized"
);
...
...
packages/contracts-bedrock/contracts/L1/OptimismPortal.sol
View file @
2b6c0089
...
...
@@ -48,11 +48,6 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
*/
uint256 internal constant FINALIZE_GAS_BUFFER = 20_000;
/**
* @notice Minimum time (in seconds) that must elapse before a withdrawal can be finalized.
*/
uint256 public immutable FINALIZATION_PERIOD_SECONDS;
/**
* @notice Address of the L2OutputOracle.
*/
...
...
@@ -149,18 +144,15 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
*
* @param _l2Oracle Address of the L2OutputOracle contract.
* @param _guardian Address that can pause deposits and withdrawals.
* @param _finalizationPeriodSeconds Output finalization time in seconds.
* @param _paused Sets the contract's pausability state.
*/
constructor(
L2OutputOracle _l2Oracle,
uint256 _finalizationPeriodSeconds,
address _guardian,
bool _paused
) Semver(1, 1, 0) {
L2_ORACLE = _l2Oracle;
GUARDIAN = _guardian;
FINALIZATION_PERIOD_SECONDS = _finalizationPeriodSeconds;
initialize(_paused);
}
...
...
@@ -480,6 +472,6 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
* @return Whether or not the finalization period has elapsed.
*/
function _isFinalizationPeriodElapsed(uint256 _timestamp) internal view returns (bool) {
return block.timestamp > _timestamp +
FINALIZATION_PERIOD_SECONDS
;
return block.timestamp > _timestamp +
L2_ORACLE.FINALIZATION_PERIOD_SECONDS()
;
}
}
packages/contracts-bedrock/contracts/echidna/FuzzOptimismPortal.sol
View file @
2b6c0089
...
...
@@ -12,7 +12,6 @@ contract EchidnaFuzzOptimismPortal {
portal = new OptimismPortal({
_l2Oracle: L2OutputOracle(address(0)),
_guardian: address(0),
_finalizationPeriodSeconds: 10,
_paused: false
});
}
...
...
packages/contracts-bedrock/contracts/test/BenchmarkTest.t.sol
View file @
2b6c0089
...
...
@@ -85,7 +85,7 @@ contract GasBenchMark_OptimismPortal is Portal_Initializer {
// Warp beyond the finalization period for the block we've proposed.
vm.warp(
oracle.getL2Output(_proposedOutputIndex).timestamp +
o
p
.FINALIZATION_PERIOD_SECONDS() +
o
racle
.FINALIZATION_PERIOD_SECONDS() +
1
);
// Fund the portal so that we can withdraw ETH.
...
...
packages/contracts-bedrock/contracts/test/CommonTest.t.sol
View file @
2b6c0089
...
...
@@ -134,7 +134,8 @@ contract L2OutputOracle_Initializer is CommonTest {
startingBlockNumber,
startingTimestamp,
proposer,
owner
owner,
7 days // finalization period (seconds)
);
Proxy proxy = new Proxy(multisig);
vm.prank(multisig);
...
...
@@ -170,7 +171,6 @@ contract Portal_Initializer is L2OutputOracle_Initializer {
opImpl = new OptimismPortal({
_l2Oracle: oracle,
_guardian: guardian,
_finalizationPeriodSeconds: 7 days,
_paused: true
});
Proxy proxy = new Proxy(multisig);
...
...
@@ -234,7 +234,6 @@ contract Messenger_Initializer is L2OutputOracle_Initializer {
op = new OptimismPortal({
_l2Oracle: oracle,
_guardian: guardian,
_finalizationPeriodSeconds: 7 days,
_paused: false
});
vm.label(address(op), "OptimismPortal");
...
...
packages/contracts-bedrock/contracts/test/L2OutputOracle.t.sol
View file @
2b6c0089
...
...
@@ -29,7 +29,8 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
// startingTimestamp is in the future
block.timestamp + 1,
proposer,
owner
owner,
7 days // finalization period (seconds)
);
}
...
...
@@ -41,7 +42,8 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
startingBlockNumber,
block.timestamp,
proposer,
owner
owner,
7 days // finalization period (seconds)
);
}
...
...
@@ -63,7 +65,8 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
startingBlockNumber,
block.timestamp,
proposer,
owner
owner,
7 days // finalization period (seconds)
);
}
...
...
packages/contracts-bedrock/contracts/test/OptimismPortal.t.sol
View file @
2b6c0089
...
...
@@ -15,7 +15,6 @@ contract OptimismPortal_Test is Portal_Initializer {
event Unpaused(address);
function test_constructor_succeeds() external {
assertEq(op.FINALIZATION_PERIOD_SECONDS(), 7 days);
assertEq(address(op.L2_ORACLE()), address(oracle));
assertEq(op.l2Sender(), 0x000000000000000000000000000000000000dEaD);
assertEq(op.paused(), false);
...
...
@@ -314,11 +313,11 @@ contract OptimismPortal_Test is Portal_Initializer {
);
// warp to the finalization period
vm.warp(ts + o
p
.FINALIZATION_PERIOD_SECONDS());
vm.warp(ts + o
racle
.FINALIZATION_PERIOD_SECONDS());
assertEq(op.isOutputFinalized(0), false);
// warp past the finalization period
vm.warp(ts + o
p
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.warp(ts + o
racle
.FINALIZATION_PERIOD_SECONDS() + 1);
assertEq(op.isOutputFinalized(0), true);
}
...
...
@@ -331,7 +330,7 @@ contract OptimismPortal_Test is Portal_Initializer {
oracle.proposeL2Output(keccak256(abi.encode(2)), checkpoint, 0, 0);
// warp to the final second of the finalization period
uint256 finalizationHorizon = block.timestamp + o
p
.FINALIZATION_PERIOD_SECONDS();
uint256 finalizationHorizon = block.timestamp + o
racle
.FINALIZATION_PERIOD_SECONDS();
vm.warp(finalizationHorizon);
// The checkpointed block should not be finalized until 1 second from now.
assertEq(op.isOutputFinalized(nextOutputIndex), false);
...
...
@@ -398,7 +397,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
// Warp beyond the finalization period for the block we've proposed.
vm.warp(
oracle.getL2Output(_proposedOutputIndex).timestamp +
o
p
.FINALIZATION_PERIOD_SECONDS() +
o
racle
.FINALIZATION_PERIOD_SECONDS() +
1
);
// Fund the portal so that we can withdraw ETH.
...
...
@@ -620,7 +619,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
_withdrawalProof
);
vm.warp(block.timestamp + o
p
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.warp(block.timestamp + o
racle
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.expectEmit(true, true, false, true);
emit WithdrawalFinalized(_withdrawalHash, true);
op.finalizeWithdrawalTransaction(_defaultTx);
...
...
@@ -692,7 +691,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
);
// Warp to after the finalization period
vm.warp(block.timestamp + o
p
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.warp(block.timestamp + o
racle
.FINALIZATION_PERIOD_SECONDS() + 1);
// Mock a startingTimestamp change on the L2 Oracle
vm.mockCall(
...
...
@@ -727,7 +726,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
);
// Warp to after the finalization period
vm.warp(block.timestamp + o
p
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.warp(block.timestamp + o
racle
.FINALIZATION_PERIOD_SECONDS() + 1);
// Mock an outputRoot change on the output proposal before attempting
// to finalize the withdrawal.
...
...
@@ -769,7 +768,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
);
// Warp to after the finalization period
vm.warp(block.timestamp + o
p
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.warp(block.timestamp + o
racle
.FINALIZATION_PERIOD_SECONDS() + 1);
// Mock a timestamp change on the output proposal that has not passed the
// finalization period.
...
...
@@ -808,7 +807,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
_withdrawalProof
);
vm.warp(block.timestamp + o
p
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.warp(block.timestamp + o
racle
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.expectEmit(true, true, true, true);
emit WithdrawalFinalized(_withdrawalHash, false);
op.finalizeWithdrawalTransaction(_defaultTx);
...
...
@@ -854,7 +853,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
_withdrawalProof
);
vm.warp(block.timestamp + o
p
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.warp(block.timestamp + o
racle
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.expectEmit(true, true, true, true);
emit WithdrawalFinalized(_withdrawalHash, true);
op.finalizeWithdrawalTransaction(_defaultTx);
...
...
@@ -905,7 +904,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
withdrawalProof
);
vm.warp(block.timestamp + o
p
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.warp(block.timestamp + o
racle
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.expectRevert("OptimismPortal: insufficient gas to finalize withdrawal");
op.finalizeWithdrawalTransaction{ gas: gasLimit }(insufficientGasTx);
}
...
...
@@ -937,7 +936,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
});
// Setup the Oracle to return the outputRoot we want as well as a finalized timestamp.
uint256 finalizedTimestamp = block.timestamp - o
p
.FINALIZATION_PERIOD_SECONDS() - 1;
uint256 finalizedTimestamp = block.timestamp - o
racle
.FINALIZATION_PERIOD_SECONDS() - 1;
vm.mockCall(
address(op.L2_ORACLE()),
abi.encodeWithSelector(L2OutputOracle.getL2Output.selector),
...
...
@@ -959,7 +958,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
withdrawalProof
);
vm.warp(block.timestamp + o
p
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.warp(block.timestamp + o
racle
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.expectCall(address(this), _testTx.data);
vm.expectEmit(true, true, true, true);
emit WithdrawalFinalized(withdrawalHash, true);
...
...
@@ -1025,7 +1024,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
// Ensure that the sentMessages is correct
assertEq(messagePasser.sentMessages(withdrawalHash), true);
vm.warp(block.timestamp + o
p
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.warp(block.timestamp + o
racle
.FINALIZATION_PERIOD_SECONDS() + 1);
op.proveWithdrawalTransaction(
_tx,
100, // l2BlockNumber
...
...
packages/contracts-bedrock/contracts/test/invariants/OptimismPortal.t.sol
View file @
2b6c0089
...
...
@@ -49,7 +49,7 @@ contract OptimismPortal_Invariant_Harness is Portal_Initializer {
// Warp beyond the finalization period for the block we've proposed.
vm.warp(
oracle.getL2Output(_proposedOutputIndex).timestamp +
o
p
.FINALIZATION_PERIOD_SECONDS() +
o
racle
.FINALIZATION_PERIOD_SECONDS() +
1
);
// Fund the portal so that we can withdraw ETH.
...
...
@@ -101,7 +101,7 @@ contract OptimismPortal_CannotFinalizeTwice is OptimismPortal_Invariant_Harness
);
// Warp past the finalization period.
vm.warp(block.timestamp + o
p
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.warp(block.timestamp + o
racle
.FINALIZATION_PERIOD_SECONDS() + 1);
// Finalize the withdrawal transaction.
op.finalizeWithdrawalTransaction(_defaultTx);
...
...
@@ -138,7 +138,7 @@ contract OptimismPortal_CanAlwaysFinalizeAfterWindow is OptimismPortal_Invariant
);
// Warp past the finalization period.
vm.warp(block.timestamp + o
p
.FINALIZATION_PERIOD_SECONDS() + 1);
vm.warp(block.timestamp + o
racle
.FINALIZATION_PERIOD_SECONDS() + 1);
// Set the target contract to the portal proxy
targetContract(address(op));
...
...
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