Commit 2b6c0089 authored by clabby's avatar clabby

Move `FINALIZATION_PERIOD_SECONDS` to `L2OutputOracle`; Need to update deployment etc.

parent cde7b45e
...@@ -22,23 +22,23 @@ CrossDomainOwnable3_Test:test_transferOwnershipNoLocal_succeeds() (gas: 48610) ...@@ -22,23 +22,23 @@ CrossDomainOwnable3_Test:test_transferOwnershipNoLocal_succeeds() (gas: 48610)
CrossDomainOwnable3_Test:test_transferOwnership_noLocalZeroAddress_reverts() (gas: 12015) CrossDomainOwnable3_Test:test_transferOwnership_noLocalZeroAddress_reverts() (gas: 12015)
CrossDomainOwnable3_Test:test_transferOwnership_notOwner_reverts() (gas: 13437) CrossDomainOwnable3_Test:test_transferOwnership_notOwner_reverts() (gas: 13437)
CrossDomainOwnable3_Test:test_transferOwnership_zeroAddress_reverts() (gas: 12081) CrossDomainOwnable3_Test:test_transferOwnership_zeroAddress_reverts() (gas: 12081)
CrossDomainOwnableThroughPortal_Test:test_depositTransaction_crossDomainOwner_succeeds() (gas: 72494) CrossDomainOwnableThroughPortal_Test:test_depositTransaction_crossDomainOwner_succeeds() (gas: 72504)
CrossDomainOwnable_Test:test_onlyOwner_notOwner_reverts() (gas: 10597) CrossDomainOwnable_Test:test_onlyOwner_notOwner_reverts() (gas: 10597)
CrossDomainOwnable_Test:test_onlyOwner_succeeds() (gas: 34883) CrossDomainOwnable_Test:test_onlyOwner_succeeds() (gas: 34883)
DeployerWhitelist_Test:test_owner_succeeds() (gas: 7582) DeployerWhitelist_Test:test_owner_succeeds() (gas: 7582)
DeployerWhitelist_Test:test_storageSlots_succeeds() (gas: 33395) DeployerWhitelist_Test:test_storageSlots_succeeds() (gas: 33395)
FeeVault_Test:test_constructor_succeeds() (gas: 10736) FeeVault_Test:test_constructor_succeeds() (gas: 10736)
FeeVault_Test:test_minWithdrawalAmount_succeeds() (gas: 10713) FeeVault_Test:test_minWithdrawalAmount_succeeds() (gas: 10713)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 261340) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 261350)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 76067) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 76077)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 348292) GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 348302)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 112945) GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 112955)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 348314) GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 348324)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 112965) GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 112975)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 40409) GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 40409)
GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 88535) GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 88513)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 75075) GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 75085)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 36386) GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 36396)
GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 169229) GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 169229)
GasPriceOracle_Test:test_baseFee_succeeds() (gas: 8325) GasPriceOracle_Test:test_baseFee_succeeds() (gas: 8325)
GasPriceOracle_Test:test_decimals_succeeds() (gas: 6167) GasPriceOracle_Test:test_decimals_succeeds() (gas: 6167)
...@@ -70,43 +70,43 @@ L1BlockTest:test_timestamp_succeeds() (gas: 7640) ...@@ -70,43 +70,43 @@ L1BlockTest:test_timestamp_succeeds() (gas: 7640)
L1BlockTest:test_updateValues_succeeds() (gas: 60482) L1BlockTest:test_updateValues_succeeds() (gas: 60482)
L1CrossDomainMessenger_Test:test_messageVersion_succeeds() (gas: 24715) L1CrossDomainMessenger_Test:test_messageVersion_succeeds() (gas: 24715)
L1CrossDomainMessenger_Test:test_relayMessage_legacyOldReplay_reverts() (gas: 49394) L1CrossDomainMessenger_Test:test_relayMessage_legacyOldReplay_reverts() (gas: 49394)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterFailureThenSuccess_reverts() (gas: 228293) L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterFailureThenSuccess_reverts() (gas: 228315)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterFailure_succeeds() (gas: 201787) L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterFailure_succeeds() (gas: 201809)
L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterSuccess_reverts() (gas: 141987) L1CrossDomainMessenger_Test:test_relayMessage_legacyRetryAfterSuccess_reverts() (gas: 142009)
L1CrossDomainMessenger_Test:test_relayMessage_legacy_succeeds() (gas: 74897) L1CrossDomainMessenger_Test:test_relayMessage_legacy_succeeds() (gas: 74919)
L1CrossDomainMessenger_Test:test_relayMessage_reentrancyDiffMessage_succeeds() (gas: 720517) L1CrossDomainMessenger_Test:test_relayMessage_reentrancyDiffMessage_succeeds() (gas: 720561)
L1CrossDomainMessenger_Test:test_relayMessage_reentrancySameMessage_reverts() (gas: 657639) L1CrossDomainMessenger_Test:test_relayMessage_reentrancySameMessage_reverts() (gas: 657661)
L1CrossDomainMessenger_Test:test_relayMessage_retryAfterFailure_succeeds() (gas: 195694) L1CrossDomainMessenger_Test:test_relayMessage_retryAfterFailure_succeeds() (gas: 195716)
L1CrossDomainMessenger_Test:test_relayMessage_succeeds() (gas: 71833) L1CrossDomainMessenger_Test:test_relayMessage_succeeds() (gas: 71855)
L1CrossDomainMessenger_Test:test_relayMessage_toSystemContract_reverts() (gas: 96277) L1CrossDomainMessenger_Test:test_relayMessage_toSystemContract_reverts() (gas: 96299)
L1CrossDomainMessenger_Test:test_relayMessage_v2_reverts() (gas: 12365) L1CrossDomainMessenger_Test:test_relayMessage_v2_reverts() (gas: 12365)
L1CrossDomainMessenger_Test:test_replayMessage_withValue_reverts() (gas: 53445) L1CrossDomainMessenger_Test:test_replayMessage_withValue_reverts() (gas: 53445)
L1CrossDomainMessenger_Test:test_sendMessage_succeeds() (gas: 299694) L1CrossDomainMessenger_Test:test_sendMessage_succeeds() (gas: 299704)
L1CrossDomainMessenger_Test:test_sendMessage_twice_succeeds() (gas: 1490560) L1CrossDomainMessenger_Test:test_sendMessage_twice_succeeds() (gas: 1490580)
L1CrossDomainMessenger_Test:test_xDomainMessageSender_reset_succeeds() (gas: 82362) L1CrossDomainMessenger_Test:test_xDomainMessageSender_reset_succeeds() (gas: 82384)
L1CrossDomainMessenger_Test:test_xDomainSender_notSet_reverts() (gas: 24296) L1CrossDomainMessenger_Test:test_xDomainSender_notSet_reverts() (gas: 24296)
L1ERC721Bridge_Test:test_bridgeERC721To_localTokenZeroAddress_reverts() (gas: 52707) L1ERC721Bridge_Test:test_bridgeERC721To_localTokenZeroAddress_reverts() (gas: 52707)
L1ERC721Bridge_Test:test_bridgeERC721To_remoteTokenZeroAddress_reverts() (gas: 27310) L1ERC721Bridge_Test:test_bridgeERC721To_remoteTokenZeroAddress_reverts() (gas: 27310)
L1ERC721Bridge_Test:test_bridgeERC721To_succeeds() (gas: 354740) L1ERC721Bridge_Test:test_bridgeERC721To_succeeds() (gas: 354750)
L1ERC721Bridge_Test:test_bridgeERC721To_wrongOwner_reverts() (gas: 60934) L1ERC721Bridge_Test:test_bridgeERC721To_wrongOwner_reverts() (gas: 60934)
L1ERC721Bridge_Test:test_bridgeERC721_fromContract_reverts() (gas: 25666) L1ERC721Bridge_Test:test_bridgeERC721_fromContract_reverts() (gas: 25666)
L1ERC721Bridge_Test:test_bridgeERC721_localTokenZeroAddress_reverts() (gas: 50564) L1ERC721Bridge_Test:test_bridgeERC721_localTokenZeroAddress_reverts() (gas: 50564)
L1ERC721Bridge_Test:test_bridgeERC721_remoteTokenZeroAddress_reverts() (gas: 25124) L1ERC721Bridge_Test:test_bridgeERC721_remoteTokenZeroAddress_reverts() (gas: 25124)
L1ERC721Bridge_Test:test_bridgeERC721_succeeds() (gas: 352320) L1ERC721Bridge_Test:test_bridgeERC721_succeeds() (gas: 352330)
L1ERC721Bridge_Test:test_bridgeERC721_wrongOwner_reverts() (gas: 60830) L1ERC721Bridge_Test:test_bridgeERC721_wrongOwner_reverts() (gas: 60830)
L1ERC721Bridge_Test:test_constructor_succeeds() (gas: 10200) L1ERC721Bridge_Test:test_constructor_succeeds() (gas: 10200)
L1ERC721Bridge_Test:test_finalizeBridgeERC721_notEscrowed_reverts() (gas: 22119) L1ERC721Bridge_Test:test_finalizeBridgeERC721_notEscrowed_reverts() (gas: 22119)
L1ERC721Bridge_Test:test_finalizeBridgeERC721_notFromRemoteMessenger_reverts() (gas: 19797) L1ERC721Bridge_Test:test_finalizeBridgeERC721_notFromRemoteMessenger_reverts() (gas: 19797)
L1ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (gas: 16049) L1ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (gas: 16049)
L1ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17615) L1ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17615)
L1ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 323832) L1ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 323842)
L1StandardBridge_BridgeETHTo_Test:test_bridgeETHTo_succeeds() (gas: 419582) L1StandardBridge_BridgeETHTo_Test:test_bridgeETHTo_succeeds() (gas: 419592)
L1StandardBridge_BridgeETH_Test:test_bridgeETH_succeeds() (gas: 406803) L1StandardBridge_BridgeETH_Test:test_bridgeETH_succeeds() (gas: 406813)
L1StandardBridge_DepositERC20To_Test:test_depositERC20To_succeeds() (gas: 624879) L1StandardBridge_DepositERC20To_Test:test_depositERC20To_succeeds() (gas: 624889)
L1StandardBridge_DepositERC20_Test:test_depositERC20_succeeds() (gas: 622580) L1StandardBridge_DepositERC20_Test:test_depositERC20_succeeds() (gas: 622590)
L1StandardBridge_DepositERC20_TestFail:test_depositERC20_notEoa_reverts() (gas: 22320) L1StandardBridge_DepositERC20_TestFail:test_depositERC20_notEoa_reverts() (gas: 22320)
L1StandardBridge_DepositETHTo_Test:test_depositETHTo_succeeds() (gas: 419659) L1StandardBridge_DepositETHTo_Test:test_depositETHTo_succeeds() (gas: 419669)
L1StandardBridge_DepositETH_Test:test_depositETH_succeeds() (gas: 406897) L1StandardBridge_DepositETH_Test:test_depositETH_succeeds() (gas: 406907)
L1StandardBridge_DepositETH_TestFail:test_depositETH_notEoa_reverts() (gas: 40780) L1StandardBridge_DepositETH_TestFail:test_depositETH_notEoa_reverts() (gas: 40780)
L1StandardBridge_FinalizeBridgeETH_Test:test_finalizeBridgeETH_succeeds() (gas: 51674) L1StandardBridge_FinalizeBridgeETH_Test:test_finalizeBridgeETH_succeeds() (gas: 51674)
L1StandardBridge_FinalizeBridgeETH_TestFail:test_finalizeBridgeETH_incorrectValue_reverts() (gas: 34207) L1StandardBridge_FinalizeBridgeETH_TestFail:test_finalizeBridgeETH_incorrectValue_reverts() (gas: 34207)
...@@ -118,7 +118,7 @@ L1StandardBridge_FinalizeERC20Withdrawal_TestFail:test_finalizeERC20Withdrawal_n ...@@ -118,7 +118,7 @@ L1StandardBridge_FinalizeERC20Withdrawal_TestFail:test_finalizeERC20Withdrawal_n
L1StandardBridge_FinalizeETHWithdrawal_Test:test_finalizeETHWithdrawal_succeeds() (gas: 61722) L1StandardBridge_FinalizeETHWithdrawal_Test:test_finalizeETHWithdrawal_succeeds() (gas: 61722)
L1StandardBridge_Getter_Test:test_getters_succeeds() (gas: 32173) L1StandardBridge_Getter_Test:test_getters_succeeds() (gas: 32173)
L1StandardBridge_Initialize_Test:test_initialize_succeeds() (gas: 22050) L1StandardBridge_Initialize_Test:test_initialize_succeeds() (gas: 22050)
L1StandardBridge_Receive_Test:test_receive_succeeds() (gas: 520206) L1StandardBridge_Receive_Test:test_receive_succeeds() (gas: 520216)
L2CrossDomainMessenger_Test:test_messageVersion_succeeds() (gas: 8411) L2CrossDomainMessenger_Test:test_messageVersion_succeeds() (gas: 8411)
L2CrossDomainMessenger_Test:test_relayMessage_reentrancyDiffMessage_succeeds() (gas: 681087) L2CrossDomainMessenger_Test:test_relayMessage_reentrancyDiffMessage_succeeds() (gas: 681087)
L2CrossDomainMessenger_Test:test_relayMessage_reentrancySameMessage_reverts() (gas: 626802) L2CrossDomainMessenger_Test:test_relayMessage_reentrancySameMessage_reverts() (gas: 626802)
...@@ -145,34 +145,34 @@ L2ERC721Bridge_Test:test_finalizeBridgeERC721_notFromRemoteMessenger_reverts() ( ...@@ -145,34 +145,34 @@ L2ERC721Bridge_Test:test_finalizeBridgeERC721_notFromRemoteMessenger_reverts() (
L2ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (gas: 16104) L2ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (gas: 16104)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17659) L2ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17659)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 168970) L2ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 168970)
L2OutputOracleTest:test_computeL2Timestamp_succeeds() (gas: 37206) L2OutputOracleTest:test_computeL2Timestamp_succeeds() (gas: 37298)
L2OutputOracleTest:test_constructor_badTimestamp_reverts() (gas: 70838) L2OutputOracleTest:test_constructor_badTimestamp_reverts() (gas: 70950)
L2OutputOracleTest:test_constructor_l2BlockTimeZero_reverts() (gas: 45856) L2OutputOracleTest:test_constructor_l2BlockTimeZero_reverts() (gas: 45957)
L2OutputOracleTest:test_constructor_succeeds() (gas: 33760) L2OutputOracleTest:test_constructor_succeeds() (gas: 33827)
L2OutputOracleTest:test_deleteL2Outputs_afterLatest_reverts() (gas: 212279) L2OutputOracleTest:test_deleteL2Outputs_afterLatest_reverts() (gas: 212262)
L2OutputOracleTest:test_deleteL2Outputs_finalized_reverts() (gas: 107742) L2OutputOracleTest:test_deleteL2Outputs_finalized_reverts() (gas: 107744)
L2OutputOracleTest:test_deleteL2Outputs_ifNotChallenger_reverts() (gas: 18895) L2OutputOracleTest:test_deleteL2Outputs_ifNotChallenger_reverts() (gas: 18918)
L2OutputOracleTest:test_deleteL2Outputs_nonExistent_reverts() (gas: 107337) L2OutputOracleTest:test_deleteL2Outputs_nonExistent_reverts() (gas: 107339)
L2OutputOracleTest:test_deleteOutputs_multipleOutputs_succeeds() (gas: 302544) L2OutputOracleTest:test_deleteOutputs_multipleOutputs_succeeds() (gas: 302439)
L2OutputOracleTest:test_deleteOutputs_singleOutput_succeeds() (gas: 181101) L2OutputOracleTest:test_deleteOutputs_singleOutput_succeeds() (gas: 181038)
L2OutputOracleTest:test_getL2OutputIndexAfter_multipleOutputsExist_succeeds() (gas: 267204) L2OutputOracleTest:test_getL2OutputIndexAfter_multipleOutputsExist_succeeds() (gas: 267120)
L2OutputOracleTest:test_getL2OutputIndexAfter_noOutputsExis_reverts() (gas: 17959) L2OutputOracleTest:test_getL2OutputIndexAfter_noOutputsExis_reverts() (gas: 17959)
L2OutputOracleTest:test_getL2OutputIndexAfter_previousBlock_succeeds() (gas: 96087) L2OutputOracleTest:test_getL2OutputIndexAfter_previousBlock_succeeds() (gas: 96066)
L2OutputOracleTest:test_getL2OutputIndexAfter_sameBlock_succeeds() (gas: 96016) L2OutputOracleTest:test_getL2OutputIndexAfter_sameBlock_succeeds() (gas: 95995)
L2OutputOracleTest:test_getL2Output_succeeds() (gas: 101699) L2OutputOracleTest:test_getL2Output_succeeds() (gas: 101634)
L2OutputOracleTest:test_latestBlockNumber_succeeds() (gas: 96983) L2OutputOracleTest:test_latestBlockNumber_succeeds() (gas: 96962)
L2OutputOracleTest:test_nextBlockNumber_succeeds() (gas: 17512) L2OutputOracleTest:test_nextBlockNumber_succeeds() (gas: 17490)
L2OutputOracleTest:test_proposeL2Output_emptyOutput_reverts() (gas: 26711) L2OutputOracleTest:test_proposeL2Output_emptyOutput_reverts() (gas: 26690)
L2OutputOracleTest:test_proposeL2Output_futureTimetamp_reverts() (gas: 28690) L2OutputOracleTest:test_proposeL2Output_futureTimetamp_reverts() (gas: 28669)
L2OutputOracleTest:test_proposeL2Output_notProposer_reverts() (gas: 25804) L2OutputOracleTest:test_proposeL2Output_notProposer_reverts() (gas: 25783)
L2OutputOracleTest:test_proposeL2Output_proposeAnotherOutput_succeeds() (gas: 101049) L2OutputOracleTest:test_proposeL2Output_proposeAnotherOutput_succeeds() (gas: 101028)
L2OutputOracleTest:test_proposeL2Output_unexpectedBlockNumber_reverts() (gas: 28402) L2OutputOracleTest:test_proposeL2Output_unexpectedBlockNumber_reverts() (gas: 28381)
L2OutputOracleTest:test_proposeL2Output_unmatchedBlockhash_reverts() (gas: 29402) L2OutputOracleTest:test_proposeL2Output_unmatchedBlockhash_reverts() (gas: 29381)
L2OutputOracleTest:test_proposeL2Output_wrongFork_reverts() (gas: 29005) L2OutputOracleTest:test_proposeL2Output_wrongFork_reverts() (gas: 28984)
L2OutputOracleTest:test_proposeWithBlockhashAndHeight_succeeds() (gas: 95274) L2OutputOracleTest:test_proposeWithBlockhashAndHeight_succeeds() (gas: 95253)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy_succeeds() (gas: 26141) L2OutputOracleUpgradeable_Test:test_initValuesOnProxy_succeeds() (gas: 26208)
L2OutputOracleUpgradeable_Test:test_initializeImpl_alreadyInitialized_reverts() (gas: 15171) L2OutputOracleUpgradeable_Test:test_initializeImpl_alreadyInitialized_reverts() (gas: 15149)
L2OutputOracleUpgradeable_Test:test_initializeProxy_alreadyInitialized_reverts() (gas: 20197) L2OutputOracleUpgradeable_Test:test_initializeProxy_alreadyInitialized_reverts() (gas: 20175)
L2OutputOracleUpgradeable_Test:test_upgrading_succeeds() (gas: 180481) L2OutputOracleUpgradeable_Test:test_upgrading_succeeds() (gas: 180481)
L2StandardBridge_BridgeERC20To_Test:test_bridgeERC20To_succeeds() (gas: 387833) L2StandardBridge_BridgeERC20To_Test:test_bridgeERC20To_succeeds() (gas: 387833)
L2StandardBridge_BridgeERC20To_Test:test_withdrawTo_withdrawingERC20_succeeds() (gas: 388064) L2StandardBridge_BridgeERC20To_Test:test_withdrawTo_withdrawingERC20_succeeds() (gas: 388064)
...@@ -256,48 +256,48 @@ OptimismMintableTokenFactory_Test:test_bridge_succeeds() (gas: 7580) ...@@ -256,48 +256,48 @@ OptimismMintableTokenFactory_Test:test_bridge_succeeds() (gas: 7580)
OptimismMintableTokenFactory_Test:test_createStandardL2Token_remoteIsZero_succeeds() (gas: 9390) OptimismMintableTokenFactory_Test:test_createStandardL2Token_remoteIsZero_succeeds() (gas: 9390)
OptimismMintableTokenFactory_Test:test_createStandardL2Token_sameTwice_succeeds() (gas: 2523203) OptimismMintableTokenFactory_Test:test_createStandardL2Token_sameTwice_succeeds() (gas: 2523203)
OptimismMintableTokenFactory_Test:test_createStandardL2Token_succeeds() (gas: 1268564) OptimismMintableTokenFactory_Test:test_createStandardL2Token_succeeds() (gas: 1268564)
OptimismPortalUpgradeable_Test:test_initialize_cannotInitImpl_reverts() (gas: 11016) OptimismPortalUpgradeable_Test:test_initialize_cannotInitImpl_reverts() (gas: 10971)
OptimismPortalUpgradeable_Test:test_initialize_cannotInitProxy_reverts() (gas: 15940) OptimismPortalUpgradeable_Test:test_initialize_cannotInitProxy_reverts() (gas: 15895)
OptimismPortalUpgradeable_Test:test_params_initValuesOnProxy_succeeds() (gas: 16056) OptimismPortalUpgradeable_Test:test_params_initValuesOnProxy_succeeds() (gas: 16078)
OptimismPortalUpgradeable_Test:test_upgradeToAndCall_upgrading_succeeds() (gas: 180547) OptimismPortalUpgradeable_Test:test_upgradeToAndCall_upgrading_succeeds() (gas: 180547)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputRootChanges_reverts() (gas: 201010) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputRootChanges_reverts() (gas: 204067)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputTimestampIsNotFinalized_reverts() (gas: 203373) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputTimestampIsNotFinalized_reverts() (gas: 207520)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalNotProven_reverts() (gas: 41798) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalNotProven_reverts() (gas: 41753)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalProofNotOldEnough_reverts() (gas: 198396) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalProofNotOldEnough_reverts() (gas: 199464)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onInsufficientGas_reverts() (gas: 199219) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onInsufficientGas_reverts() (gas: 203388)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onRecentWithdrawal_reverts() (gas: 179139) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onRecentWithdrawal_reverts() (gas: 180229)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReentrancy_reverts() (gas: 237848) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReentrancy_reverts() (gas: 244483)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReplay_reverts() (gas: 239372) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReplay_reverts() (gas: 245634)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_paused_reverts() (gas: 53621) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_paused_reverts() (gas: 53555)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_provenWithdrawalHash_succeeds() (gas: 230921) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_provenWithdrawalHash_succeeds() (gas: 235047)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_targetFails_fails() (gas: 8797746687696163739) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_targetFails_fails() (gas: 8797746687696163866)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_timestampLessThanL2OracleStart_reverts() (gas: 195098) OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_timestampLessThanL2OracleStart_reverts() (gas: 197042)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onInvalidOutputRootProof_reverts() (gas: 85690) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onInvalidOutputRootProof_reverts() (gas: 85690)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onInvalidWithdrawalProof_reverts() (gas: 137350) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onInvalidWithdrawalProof_reverts() (gas: 137350)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onSelfCall_reverts() (gas: 52925) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onSelfCall_reverts() (gas: 52947)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_paused_reverts() (gas: 73695) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_paused_reverts() (gas: 73696)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProveChangedOutputRootAndOutputIndex_succeeds() (gas: 346875) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProveChangedOutputRootAndOutputIndex_succeeds() (gas: 346853)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProveChangedOutputRoot_succeeds() (gas: 279593) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProveChangedOutputRoot_succeeds() (gas: 279593)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProve_reverts() (gas: 192570) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProve_reverts() (gas: 192548)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_validWithdrawalProof_succeeds() (gas: 180486) OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_validWithdrawalProof_succeeds() (gas: 180486)
OptimismPortal_Test:test_constructor_succeeds() (gas: 20672) OptimismPortal_Test:test_constructor_succeeds() (gas: 19440)
OptimismPortal_Test:test_depositTransaction_contractCreation_reverts() (gas: 14320) OptimismPortal_Test:test_depositTransaction_contractCreation_reverts() (gas: 14330)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForContract_succeeds() (gas: 76748) OptimismPortal_Test:test_depositTransaction_createWithZeroValueForContract_succeeds() (gas: 76758)
OptimismPortal_Test:test_depositTransaction_createWithZeroValueForEOA_succeeds() (gas: 77114) OptimismPortal_Test:test_depositTransaction_createWithZeroValueForEOA_succeeds() (gas: 77124)
OptimismPortal_Test:test_depositTransaction_noValueContract_succeeds() (gas: 76766) OptimismPortal_Test:test_depositTransaction_noValueContract_succeeds() (gas: 76776)
OptimismPortal_Test:test_depositTransaction_noValueEOA_succeeds() (gas: 77111) OptimismPortal_Test:test_depositTransaction_noValueEOA_succeeds() (gas: 77121)
OptimismPortal_Test:test_depositTransaction_smallGasLimit_reverts() (gas: 14266) OptimismPortal_Test:test_depositTransaction_smallGasLimit_reverts() (gas: 14276)
OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreation_succeeds() (gas: 83772) OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreation_succeeds() (gas: 83782)
OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation_succeeds() (gas: 75925) OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation_succeeds() (gas: 75935)
OptimismPortal_Test:test_depositTransaction_withEthValueFromContract_succeeds() (gas: 83452) OptimismPortal_Test:test_depositTransaction_withEthValueFromContract_succeeds() (gas: 83462)
OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA_succeeds() (gas: 84068) OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA_succeeds() (gas: 84078)
OptimismPortal_Test:test_isOutputFinalized_succeeds() (gas: 119519) OptimismPortal_Test:test_isOutputFinalized_succeeds() (gas: 121711)
OptimismPortal_Test:test_pause_onlyGuardian_reverts() (gas: 22182) OptimismPortal_Test:test_pause_onlyGuardian_reverts() (gas: 22205)
OptimismPortal_Test:test_pause_succeeds() (gas: 42161) OptimismPortal_Test:test_pause_succeeds() (gas: 42184)
OptimismPortal_Test:test_receive_succeeds() (gas: 127554) 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_onlyGuardian_reverts() (gas: 46151)
OptimismPortal_Test:test_unpause_succeeds() (gas: 31780) OptimismPortal_Test:test_unpause_succeeds() (gas: 31763)
ProxyAdmin_Test:test_chugsplashChangeProxyAdmin_succeeds() (gas: 35586) ProxyAdmin_Test:test_chugsplashChangeProxyAdmin_succeeds() (gas: 35586)
ProxyAdmin_Test:test_chugsplashGetProxyAdmin_succeeds() (gas: 15675) ProxyAdmin_Test:test_chugsplashGetProxyAdmin_succeeds() (gas: 15675)
ProxyAdmin_Test:test_chugsplashGetProxyImplementation_succeeds() (gas: 51084) ProxyAdmin_Test:test_chugsplashGetProxyImplementation_succeeds() (gas: 51084)
......
...@@ -34,6 +34,11 @@ contract L2OutputOracle is Initializable, Semver { ...@@ -34,6 +34,11 @@ contract L2OutputOracle is Initializable, Semver {
*/ */
address public immutable PROPOSER; 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. * @notice The number of the first L2 block recorded in this contract.
*/ */
...@@ -88,7 +93,8 @@ contract L2OutputOracle is Initializable, Semver { ...@@ -88,7 +93,8 @@ contract L2OutputOracle is Initializable, Semver {
uint256 _startingBlockNumber, uint256 _startingBlockNumber,
uint256 _startingTimestamp, uint256 _startingTimestamp,
address _proposer, address _proposer,
address _challenger address _challenger,
uint256 _finalizationPeriodSeconds
) Semver(1, 1, 0) { ) Semver(1, 1, 0) {
require(_l2BlockTime > 0, "L2OutputOracle: L2 block time must be greater than 0"); require(_l2BlockTime > 0, "L2OutputOracle: L2 block time must be greater than 0");
require( require(
...@@ -100,6 +106,7 @@ contract L2OutputOracle is Initializable, Semver { ...@@ -100,6 +106,7 @@ contract L2OutputOracle is Initializable, Semver {
L2_BLOCK_TIME = _l2BlockTime; L2_BLOCK_TIME = _l2BlockTime;
PROPOSER = _proposer; PROPOSER = _proposer;
CHALLENGER = _challenger; CHALLENGER = _challenger;
FINALIZATION_PERIOD_SECONDS = _finalizationPeriodSeconds;
initialize(_startingBlockNumber, _startingTimestamp); initialize(_startingBlockNumber, _startingTimestamp);
} }
...@@ -145,7 +152,7 @@ contract L2OutputOracle is Initializable, Semver { ...@@ -145,7 +152,7 @@ contract L2OutputOracle is Initializable, Semver {
// Do not allow deleting any outputs that have already been finalized. // Do not allow deleting any outputs that have already been finalized.
require( 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" "L2OutputOracle: cannot delete outputs that have already been finalized"
); );
......
...@@ -48,11 +48,6 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -48,11 +48,6 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
*/ */
uint256 internal constant FINALIZE_GAS_BUFFER = 20_000; 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. * @notice Address of the L2OutputOracle.
*/ */
...@@ -149,18 +144,15 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -149,18 +144,15 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
* *
* @param _l2Oracle Address of the L2OutputOracle contract. * @param _l2Oracle Address of the L2OutputOracle contract.
* @param _guardian Address that can pause deposits and withdrawals. * @param _guardian Address that can pause deposits and withdrawals.
* @param _finalizationPeriodSeconds Output finalization time in seconds.
* @param _paused Sets the contract's pausability state. * @param _paused Sets the contract's pausability state.
*/ */
constructor( constructor(
L2OutputOracle _l2Oracle, L2OutputOracle _l2Oracle,
uint256 _finalizationPeriodSeconds,
address _guardian, address _guardian,
bool _paused bool _paused
) Semver(1, 1, 0) { ) Semver(1, 1, 0) {
L2_ORACLE = _l2Oracle; L2_ORACLE = _l2Oracle;
GUARDIAN = _guardian; GUARDIAN = _guardian;
FINALIZATION_PERIOD_SECONDS = _finalizationPeriodSeconds;
initialize(_paused); initialize(_paused);
} }
...@@ -480,6 +472,6 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver { ...@@ -480,6 +472,6 @@ contract OptimismPortal is Initializable, ResourceMetering, Semver {
* @return Whether or not the finalization period has elapsed. * @return Whether or not the finalization period has elapsed.
*/ */
function _isFinalizationPeriodElapsed(uint256 _timestamp) internal view returns (bool) { function _isFinalizationPeriodElapsed(uint256 _timestamp) internal view returns (bool) {
return block.timestamp > _timestamp + FINALIZATION_PERIOD_SECONDS; return block.timestamp > _timestamp + L2_ORACLE.FINALIZATION_PERIOD_SECONDS();
} }
} }
...@@ -12,7 +12,6 @@ contract EchidnaFuzzOptimismPortal { ...@@ -12,7 +12,6 @@ contract EchidnaFuzzOptimismPortal {
portal = new OptimismPortal({ portal = new OptimismPortal({
_l2Oracle: L2OutputOracle(address(0)), _l2Oracle: L2OutputOracle(address(0)),
_guardian: address(0), _guardian: address(0),
_finalizationPeriodSeconds: 10,
_paused: false _paused: false
}); });
} }
......
...@@ -85,7 +85,7 @@ contract GasBenchMark_OptimismPortal is Portal_Initializer { ...@@ -85,7 +85,7 @@ contract GasBenchMark_OptimismPortal is Portal_Initializer {
// Warp beyond the finalization period for the block we've proposed. // Warp beyond the finalization period for the block we've proposed.
vm.warp( vm.warp(
oracle.getL2Output(_proposedOutputIndex).timestamp + oracle.getL2Output(_proposedOutputIndex).timestamp +
op.FINALIZATION_PERIOD_SECONDS() + oracle.FINALIZATION_PERIOD_SECONDS() +
1 1
); );
// Fund the portal so that we can withdraw ETH. // Fund the portal so that we can withdraw ETH.
......
...@@ -134,7 +134,8 @@ contract L2OutputOracle_Initializer is CommonTest { ...@@ -134,7 +134,8 @@ contract L2OutputOracle_Initializer is CommonTest {
startingBlockNumber, startingBlockNumber,
startingTimestamp, startingTimestamp,
proposer, proposer,
owner owner,
7 days // finalization period (seconds)
); );
Proxy proxy = new Proxy(multisig); Proxy proxy = new Proxy(multisig);
vm.prank(multisig); vm.prank(multisig);
...@@ -170,7 +171,6 @@ contract Portal_Initializer is L2OutputOracle_Initializer { ...@@ -170,7 +171,6 @@ contract Portal_Initializer is L2OutputOracle_Initializer {
opImpl = new OptimismPortal({ opImpl = new OptimismPortal({
_l2Oracle: oracle, _l2Oracle: oracle,
_guardian: guardian, _guardian: guardian,
_finalizationPeriodSeconds: 7 days,
_paused: true _paused: true
}); });
Proxy proxy = new Proxy(multisig); Proxy proxy = new Proxy(multisig);
...@@ -234,7 +234,6 @@ contract Messenger_Initializer is L2OutputOracle_Initializer { ...@@ -234,7 +234,6 @@ contract Messenger_Initializer is L2OutputOracle_Initializer {
op = new OptimismPortal({ op = new OptimismPortal({
_l2Oracle: oracle, _l2Oracle: oracle,
_guardian: guardian, _guardian: guardian,
_finalizationPeriodSeconds: 7 days,
_paused: false _paused: false
}); });
vm.label(address(op), "OptimismPortal"); vm.label(address(op), "OptimismPortal");
......
...@@ -29,7 +29,8 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -29,7 +29,8 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
// startingTimestamp is in the future // startingTimestamp is in the future
block.timestamp + 1, block.timestamp + 1,
proposer, proposer,
owner owner,
7 days // finalization period (seconds)
); );
} }
...@@ -41,7 +42,8 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -41,7 +42,8 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
startingBlockNumber, startingBlockNumber,
block.timestamp, block.timestamp,
proposer, proposer,
owner owner,
7 days // finalization period (seconds)
); );
} }
...@@ -63,7 +65,8 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer { ...@@ -63,7 +65,8 @@ contract L2OutputOracleTest is L2OutputOracle_Initializer {
startingBlockNumber, startingBlockNumber,
block.timestamp, block.timestamp,
proposer, proposer,
owner owner,
7 days // finalization period (seconds)
); );
} }
......
...@@ -15,7 +15,6 @@ contract OptimismPortal_Test is Portal_Initializer { ...@@ -15,7 +15,6 @@ contract OptimismPortal_Test is Portal_Initializer {
event Unpaused(address); event Unpaused(address);
function test_constructor_succeeds() external { function test_constructor_succeeds() external {
assertEq(op.FINALIZATION_PERIOD_SECONDS(), 7 days);
assertEq(address(op.L2_ORACLE()), address(oracle)); assertEq(address(op.L2_ORACLE()), address(oracle));
assertEq(op.l2Sender(), 0x000000000000000000000000000000000000dEaD); assertEq(op.l2Sender(), 0x000000000000000000000000000000000000dEaD);
assertEq(op.paused(), false); assertEq(op.paused(), false);
...@@ -314,11 +313,11 @@ contract OptimismPortal_Test is Portal_Initializer { ...@@ -314,11 +313,11 @@ contract OptimismPortal_Test is Portal_Initializer {
); );
// warp to the finalization period // warp to the finalization period
vm.warp(ts + op.FINALIZATION_PERIOD_SECONDS()); vm.warp(ts + oracle.FINALIZATION_PERIOD_SECONDS());
assertEq(op.isOutputFinalized(0), false); assertEq(op.isOutputFinalized(0), false);
// warp past the finalization period // warp past the finalization period
vm.warp(ts + op.FINALIZATION_PERIOD_SECONDS() + 1); vm.warp(ts + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
assertEq(op.isOutputFinalized(0), true); assertEq(op.isOutputFinalized(0), true);
} }
...@@ -331,7 +330,7 @@ contract OptimismPortal_Test is Portal_Initializer { ...@@ -331,7 +330,7 @@ contract OptimismPortal_Test is Portal_Initializer {
oracle.proposeL2Output(keccak256(abi.encode(2)), checkpoint, 0, 0); oracle.proposeL2Output(keccak256(abi.encode(2)), checkpoint, 0, 0);
// warp to the final second of the finalization period // warp to the final second of the finalization period
uint256 finalizationHorizon = block.timestamp + op.FINALIZATION_PERIOD_SECONDS(); uint256 finalizationHorizon = block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS();
vm.warp(finalizationHorizon); vm.warp(finalizationHorizon);
// The checkpointed block should not be finalized until 1 second from now. // The checkpointed block should not be finalized until 1 second from now.
assertEq(op.isOutputFinalized(nextOutputIndex), false); assertEq(op.isOutputFinalized(nextOutputIndex), false);
...@@ -398,7 +397,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -398,7 +397,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
// Warp beyond the finalization period for the block we've proposed. // Warp beyond the finalization period for the block we've proposed.
vm.warp( vm.warp(
oracle.getL2Output(_proposedOutputIndex).timestamp + oracle.getL2Output(_proposedOutputIndex).timestamp +
op.FINALIZATION_PERIOD_SECONDS() + oracle.FINALIZATION_PERIOD_SECONDS() +
1 1
); );
// Fund the portal so that we can withdraw ETH. // Fund the portal so that we can withdraw ETH.
...@@ -620,7 +619,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -620,7 +619,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
_withdrawalProof _withdrawalProof
); );
vm.warp(block.timestamp + op.FINALIZATION_PERIOD_SECONDS() + 1); vm.warp(block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
vm.expectEmit(true, true, false, true); vm.expectEmit(true, true, false, true);
emit WithdrawalFinalized(_withdrawalHash, true); emit WithdrawalFinalized(_withdrawalHash, true);
op.finalizeWithdrawalTransaction(_defaultTx); op.finalizeWithdrawalTransaction(_defaultTx);
...@@ -692,7 +691,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -692,7 +691,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
); );
// Warp to after the finalization period // Warp to after the finalization period
vm.warp(block.timestamp + op.FINALIZATION_PERIOD_SECONDS() + 1); vm.warp(block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
// Mock a startingTimestamp change on the L2 Oracle // Mock a startingTimestamp change on the L2 Oracle
vm.mockCall( vm.mockCall(
...@@ -727,7 +726,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -727,7 +726,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
); );
// Warp to after the finalization period // Warp to after the finalization period
vm.warp(block.timestamp + op.FINALIZATION_PERIOD_SECONDS() + 1); vm.warp(block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
// Mock an outputRoot change on the output proposal before attempting // Mock an outputRoot change on the output proposal before attempting
// to finalize the withdrawal. // to finalize the withdrawal.
...@@ -769,7 +768,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -769,7 +768,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
); );
// Warp to after the finalization period // Warp to after the finalization period
vm.warp(block.timestamp + op.FINALIZATION_PERIOD_SECONDS() + 1); vm.warp(block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
// Mock a timestamp change on the output proposal that has not passed the // Mock a timestamp change on the output proposal that has not passed the
// finalization period. // finalization period.
...@@ -808,7 +807,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -808,7 +807,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
_withdrawalProof _withdrawalProof
); );
vm.warp(block.timestamp + op.FINALIZATION_PERIOD_SECONDS() + 1); vm.warp(block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalFinalized(_withdrawalHash, false); emit WithdrawalFinalized(_withdrawalHash, false);
op.finalizeWithdrawalTransaction(_defaultTx); op.finalizeWithdrawalTransaction(_defaultTx);
...@@ -854,7 +853,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -854,7 +853,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
_withdrawalProof _withdrawalProof
); );
vm.warp(block.timestamp + op.FINALIZATION_PERIOD_SECONDS() + 1); vm.warp(block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalFinalized(_withdrawalHash, true); emit WithdrawalFinalized(_withdrawalHash, true);
op.finalizeWithdrawalTransaction(_defaultTx); op.finalizeWithdrawalTransaction(_defaultTx);
...@@ -905,7 +904,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -905,7 +904,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
withdrawalProof withdrawalProof
); );
vm.warp(block.timestamp + op.FINALIZATION_PERIOD_SECONDS() + 1); vm.warp(block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
vm.expectRevert("OptimismPortal: insufficient gas to finalize withdrawal"); vm.expectRevert("OptimismPortal: insufficient gas to finalize withdrawal");
op.finalizeWithdrawalTransaction{ gas: gasLimit }(insufficientGasTx); op.finalizeWithdrawalTransaction{ gas: gasLimit }(insufficientGasTx);
} }
...@@ -937,7 +936,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -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. // Setup the Oracle to return the outputRoot we want as well as a finalized timestamp.
uint256 finalizedTimestamp = block.timestamp - op.FINALIZATION_PERIOD_SECONDS() - 1; uint256 finalizedTimestamp = block.timestamp - oracle.FINALIZATION_PERIOD_SECONDS() - 1;
vm.mockCall( vm.mockCall(
address(op.L2_ORACLE()), address(op.L2_ORACLE()),
abi.encodeWithSelector(L2OutputOracle.getL2Output.selector), abi.encodeWithSelector(L2OutputOracle.getL2Output.selector),
...@@ -959,7 +958,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -959,7 +958,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
withdrawalProof withdrawalProof
); );
vm.warp(block.timestamp + op.FINALIZATION_PERIOD_SECONDS() + 1); vm.warp(block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
vm.expectCall(address(this), _testTx.data); vm.expectCall(address(this), _testTx.data);
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalFinalized(withdrawalHash, true); emit WithdrawalFinalized(withdrawalHash, true);
...@@ -1025,7 +1024,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer { ...@@ -1025,7 +1024,7 @@ contract OptimismPortal_FinalizeWithdrawal_Test is Portal_Initializer {
// Ensure that the sentMessages is correct // Ensure that the sentMessages is correct
assertEq(messagePasser.sentMessages(withdrawalHash), true); assertEq(messagePasser.sentMessages(withdrawalHash), true);
vm.warp(block.timestamp + op.FINALIZATION_PERIOD_SECONDS() + 1); vm.warp(block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
op.proveWithdrawalTransaction( op.proveWithdrawalTransaction(
_tx, _tx,
100, // l2BlockNumber 100, // l2BlockNumber
......
...@@ -49,7 +49,7 @@ contract OptimismPortal_Invariant_Harness is Portal_Initializer { ...@@ -49,7 +49,7 @@ contract OptimismPortal_Invariant_Harness is Portal_Initializer {
// Warp beyond the finalization period for the block we've proposed. // Warp beyond the finalization period for the block we've proposed.
vm.warp( vm.warp(
oracle.getL2Output(_proposedOutputIndex).timestamp + oracle.getL2Output(_proposedOutputIndex).timestamp +
op.FINALIZATION_PERIOD_SECONDS() + oracle.FINALIZATION_PERIOD_SECONDS() +
1 1
); );
// Fund the portal so that we can withdraw ETH. // Fund the portal so that we can withdraw ETH.
...@@ -101,7 +101,7 @@ contract OptimismPortal_CannotFinalizeTwice is OptimismPortal_Invariant_Harness ...@@ -101,7 +101,7 @@ contract OptimismPortal_CannotFinalizeTwice is OptimismPortal_Invariant_Harness
); );
// Warp past the finalization period. // Warp past the finalization period.
vm.warp(block.timestamp + op.FINALIZATION_PERIOD_SECONDS() + 1); vm.warp(block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
// Finalize the withdrawal transaction. // Finalize the withdrawal transaction.
op.finalizeWithdrawalTransaction(_defaultTx); op.finalizeWithdrawalTransaction(_defaultTx);
...@@ -138,7 +138,7 @@ contract OptimismPortal_CanAlwaysFinalizeAfterWindow is OptimismPortal_Invariant ...@@ -138,7 +138,7 @@ contract OptimismPortal_CanAlwaysFinalizeAfterWindow is OptimismPortal_Invariant
); );
// Warp past the finalization period. // Warp past the finalization period.
vm.warp(block.timestamp + op.FINALIZATION_PERIOD_SECONDS() + 1); vm.warp(block.timestamp + oracle.FINALIZATION_PERIOD_SECONDS() + 1);
// Set the target contract to the portal proxy // Set the target contract to the portal proxy
targetContract(address(op)); targetContract(address(op));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment