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
75b89b03
Commit
75b89b03
authored
Aug 07, 2023
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts-bedrock: reduce diff
parent
2402bdef
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
76 deletions
+61
-76
l2outputoracle.go
op-bindings/bindings/l2outputoracle.go
+1
-1
l2outputoracle_more.go
op-bindings/bindings/l2outputoracle_more.go
+2
-2
.gas-snapshot
packages/contracts-bedrock/.gas-snapshot
+20
-20
.storage-layout
packages/contracts-bedrock/.storage-layout
+2
-2
semver-lock.json
packages/contracts-bedrock/semver-lock.json
+1
-1
L2OutputOracle.sol
packages/contracts-bedrock/src/L1/L2OutputOracle.sol
+35
-50
No files found.
op-bindings/bindings/l2outputoracle.go
View file @
75b89b03
This diff is collapsed.
Click to expand it.
op-bindings/bindings/l2outputoracle_more.go
View file @
75b89b03
This diff is collapsed.
Click to expand it.
packages/contracts-bedrock/.gas-snapshot
View file @
75b89b03
...
@@ -104,7 +104,7 @@ FaultDisputeGame_Test:test_gameData_succeeds() (gas: 32829)
...
@@ -104,7 +104,7 @@ FaultDisputeGame_Test:test_gameData_succeeds() (gas: 32829)
FaultDisputeGame_Test:test_gameType_succeeds() (gas: 8250)
FaultDisputeGame_Test:test_gameType_succeeds() (gas: 8250)
FaultDisputeGame_Test:test_initialize_correctData_succeeds() (gas: 57650)
FaultDisputeGame_Test:test_initialize_correctData_succeeds() (gas: 57650)
FaultDisputeGame_Test:test_initialize_firstOutput_reverts() (gas: 210554)
FaultDisputeGame_Test:test_initialize_firstOutput_reverts() (gas: 210554)
FaultDisputeGame_Test:test_initialize_l1HeadTooOld_reverts() (gas: 22833
4
)
FaultDisputeGame_Test:test_initialize_l1HeadTooOld_reverts() (gas: 22833
7
)
FaultDisputeGame_Test:test_move_clockCorrectness_succeeds() (gas: 415993)
FaultDisputeGame_Test:test_move_clockCorrectness_succeeds() (gas: 415993)
FaultDisputeGame_Test:test_move_clockTimeExceeded_reverts() (gas: 23219)
FaultDisputeGame_Test:test_move_clockTimeExceeded_reverts() (gas: 23219)
FaultDisputeGame_Test:test_move_defendRoot_reverts() (gas: 13366)
FaultDisputeGame_Test:test_move_defendRoot_reverts() (gas: 13366)
...
@@ -234,17 +234,17 @@ L2ERC721Bridge_Test:test_finalizeBridgeERC721_notFromRemoteMessenger_reverts() (
...
@@ -234,17 +234,17 @@ L2ERC721Bridge_Test:test_finalizeBridgeERC721_notFromRemoteMessenger_reverts() (
L2ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (gas: 16126)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_notViaLocalMessenger_reverts() (gas: 16126)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17681)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_selfToken_reverts() (gas: 17681)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 169375)
L2ERC721Bridge_Test:test_finalizeBridgeERC721_succeeds() (gas: 169375)
L2OutputOracleUpgradeable_Test:test_initValuesOnImpl_succeeds() (gas: 238
5
1)
L2OutputOracleUpgradeable_Test:test_initValuesOnImpl_succeeds() (gas: 238
9
1)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy_succeeds() (gas: 467
38
)
L2OutputOracleUpgradeable_Test:test_initValuesOnProxy_succeeds() (gas: 467
89
)
L2OutputOracleUpgradeable_Test:test_initializeImpl_alreadyInitialized_reverts() (gas: 15216)
L2OutputOracleUpgradeable_Test:test_initializeImpl_alreadyInitialized_reverts() (gas: 15216)
L2OutputOracleUpgradeable_Test:test_initializeProxy_alreadyInitialized_reverts() (gas: 20216)
L2OutputOracleUpgradeable_Test:test_initializeProxy_alreadyInitialized_reverts() (gas: 20216)
L2OutputOracleUpgradeable_Test:test_upgrading_succeeds() (gas: 191346)
L2OutputOracleUpgradeable_Test:test_upgrading_succeeds() (gas: 191346)
L2OutputOracle_constructor_Test:test_constructor_l2BlockTimeZero_reverts() (gas: 39
147
)
L2OutputOracle_constructor_Test:test_constructor_l2BlockTimeZero_reverts() (gas: 39
209
)
L2OutputOracle_constructor_Test:test_constructor_submissionInterval_reverts() (gas: 39
157
)
L2OutputOracle_constructor_Test:test_constructor_submissionInterval_reverts() (gas: 39
219
)
L2OutputOracle_constructor_Test:test_constructor_succeeds() (gas: 517
12
)
L2OutputOracle_constructor_Test:test_constructor_succeeds() (gas: 517
66
)
L2OutputOracle_constructor_Test:test_initialize_badTimestamp_reverts() (gas: 12353)
L2OutputOracle_constructor_Test:test_initialize_badTimestamp_reverts() (gas: 12353)
L2OutputOracle_deleteOutputs_Test:test_deleteL2Outputs_afterLatest_reverts() (gas: 217031)
L2OutputOracle_deleteOutputs_Test:test_deleteL2Outputs_afterLatest_reverts() (gas: 217031)
L2OutputOracle_deleteOutputs_Test:test_deleteL2Outputs_finalized_reverts() (gas: 11325
5
)
L2OutputOracle_deleteOutputs_Test:test_deleteL2Outputs_finalized_reverts() (gas: 11325
8
)
L2OutputOracle_deleteOutputs_Test:test_deleteL2Outputs_ifNotChallenger_reverts() (gas: 21018)
L2OutputOracle_deleteOutputs_Test:test_deleteL2Outputs_ifNotChallenger_reverts() (gas: 21018)
L2OutputOracle_deleteOutputs_Test:test_deleteL2Outputs_nonExistent_reverts() (gas: 111651)
L2OutputOracle_deleteOutputs_Test:test_deleteL2Outputs_nonExistent_reverts() (gas: 111651)
L2OutputOracle_deleteOutputs_Test:test_deleteOutputs_multipleOutputs_succeeds() (gas: 307411)
L2OutputOracle_deleteOutputs_Test:test_deleteOutputs_multipleOutputs_succeeds() (gas: 307411)
...
@@ -256,7 +256,7 @@ L2OutputOracle_getter_Test:test_getL2OutputIndexAfter_previousBlock_succeeds() (
...
@@ -256,7 +256,7 @@ L2OutputOracle_getter_Test:test_getL2OutputIndexAfter_previousBlock_succeeds() (
L2OutputOracle_getter_Test:test_getL2OutputIndexAfter_sameBlock_succeeds() (gas: 98096)
L2OutputOracle_getter_Test:test_getL2OutputIndexAfter_sameBlock_succeeds() (gas: 98096)
L2OutputOracle_getter_Test:test_getL2Output_succeeds() (gas: 103735)
L2OutputOracle_getter_Test:test_getL2Output_succeeds() (gas: 103735)
L2OutputOracle_getter_Test:test_latestBlockNumber_succeeds() (gas: 99129)
L2OutputOracle_getter_Test:test_latestBlockNumber_succeeds() (gas: 99129)
L2OutputOracle_getter_Test:test_nextBlockNumber_succeeds() (gas: 1744
4
)
L2OutputOracle_getter_Test:test_nextBlockNumber_succeeds() (gas: 1744
7
)
L2OutputOracle_proposeL2Output_Test:test_proposeL2Output_emptyOutput_reverts() (gas: 28812)
L2OutputOracle_proposeL2Output_Test:test_proposeL2Output_emptyOutput_reverts() (gas: 28812)
L2OutputOracle_proposeL2Output_Test:test_proposeL2Output_futureTimetamp_reverts() (gas: 30792)
L2OutputOracle_proposeL2Output_Test:test_proposeL2Output_futureTimetamp_reverts() (gas: 30792)
L2OutputOracle_proposeL2Output_Test:test_proposeL2Output_notProposer_reverts() (gas: 27928)
L2OutputOracle_proposeL2Output_Test:test_proposeL2Output_notProposer_reverts() (gas: 27928)
...
@@ -355,23 +355,23 @@ OptimismPortalUpgradeable_Test:test_initialize_cannotInitImpl_reverts() (gas: 11
...
@@ -355,23 +355,23 @@ OptimismPortalUpgradeable_Test:test_initialize_cannotInitImpl_reverts() (gas: 11
OptimismPortalUpgradeable_Test:test_initialize_cannotInitProxy_reverts() (gas: 16111)
OptimismPortalUpgradeable_Test:test_initialize_cannotInitProxy_reverts() (gas: 16111)
OptimismPortalUpgradeable_Test:test_params_initValuesOnProxy_succeeds() (gas: 21796)
OptimismPortalUpgradeable_Test:test_params_initValuesOnProxy_succeeds() (gas: 21796)
OptimismPortalUpgradeable_Test:test_upgradeToAndCall_upgrading_succeeds() (gas: 191412)
OptimismPortalUpgradeable_Test:test_upgradeToAndCall_upgrading_succeeds() (gas: 191412)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputRootChanges_reverts() (gas: 17866
1
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputRootChanges_reverts() (gas: 17866
7
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputTimestampIsNotFinalized_reverts() (gas: 182
297
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifOutputTimestampIsNotFinalized_reverts() (gas: 182
306
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalNotProven_reverts() (gas: 41780)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalNotProven_reverts() (gas: 41780)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalProofNotOldEnough_reverts() (gas: 17395
0
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_ifWithdrawalProofNotOldEnough_reverts() (gas: 17395
3
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onInsufficientGas_reverts() (gas: 180
692
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onInsufficientGas_reverts() (gas: 180
701
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onRecentWithdrawal_reverts() (gas: 1547
37
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onRecentWithdrawal_reverts() (gas: 1547
40
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReentrancy_reverts() (gas: 2187
35
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReentrancy_reverts() (gas: 2187
47
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReplay_reverts() (gas: 2209
68
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_onReplay_reverts() (gas: 2209
83
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_paused_reverts() (gas: 38706)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_paused_reverts() (gas: 38706)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_provenWithdrawalHash_succeeds() (gas: 20967
0
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_provenWithdrawalHash_succeeds() (gas: 20967
9
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_targetFails_fails() (gas: 8797746687696162676)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_targetFails_fails() (gas: 8797746687696162676)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_timestampLessThanL2OracleStart_reverts() (gas: 171
299
)
OptimismPortal_FinalizeWithdrawal_Test:test_finalizeWithdrawalTransaction_timestampLessThanL2OracleStart_reverts() (gas: 171
302
)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onInvalidOutputRootProof_reverts() (gas: 85805)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onInvalidOutputRootProof_reverts() (gas: 85805)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onInvalidWithdrawalProof_reverts() (gas: 111317)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onInvalidWithdrawalProof_reverts() (gas: 111317)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onSelfCall_reverts() (gas: 52973)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_onSelfCall_reverts() (gas: 52973)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_paused_reverts() (gas: 58846)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_paused_reverts() (gas: 58846)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProveChangedOutputRootAndOutputIndex_succeeds() (gas: 297
494
)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProveChangedOutputRootAndOutputIndex_succeeds() (gas: 297
500
)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProveChangedOutputRoot_succeeds() (gas: 227596)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProveChangedOutputRoot_succeeds() (gas: 227596)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProve_reverts() (gas: 166699)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_replayProve_reverts() (gas: 166699)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_validWithdrawalProof_succeeds() (gas: 154430)
OptimismPortal_FinalizeWithdrawal_Test:test_proveWithdrawalTransaction_validWithdrawalProof_succeeds() (gas: 154430)
...
@@ -387,12 +387,12 @@ OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreat
...
@@ -387,12 +387,12 @@ OptimismPortal_Test:test_depositTransaction_withEthValueAndContractContractCreat
OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation_succeeds() (gas: 75932)
OptimismPortal_Test:test_depositTransaction_withEthValueAndEOAContractCreation_succeeds() (gas: 75932)
OptimismPortal_Test:test_depositTransaction_withEthValueFromContract_succeeds() (gas: 83479)
OptimismPortal_Test:test_depositTransaction_withEthValueFromContract_succeeds() (gas: 83479)
OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA_succeeds() (gas: 84072)
OptimismPortal_Test:test_depositTransaction_withEthValueFromEOA_succeeds() (gas: 84072)
OptimismPortal_Test:test_isOutputFinalized_succeeds() (gas: 1267
40
)
OptimismPortal_Test:test_isOutputFinalized_succeeds() (gas: 1267
55
)
OptimismPortal_Test:test_minimumGasLimit_succeeds() (gas: 17430)
OptimismPortal_Test:test_minimumGasLimit_succeeds() (gas: 17430)
OptimismPortal_Test:test_pause_onlyGuardian_reverts() (gas: 24487)
OptimismPortal_Test:test_pause_onlyGuardian_reverts() (gas: 24487)
OptimismPortal_Test:test_pause_succeeds() (gas: 27344)
OptimismPortal_Test:test_pause_succeeds() (gas: 27344)
OptimismPortal_Test:test_receive_succeeds() (gas: 127567)
OptimismPortal_Test:test_receive_succeeds() (gas: 127567)
OptimismPortal_Test:test_simple_isOutputFinalized_succeeds() (gas: 356
39
)
OptimismPortal_Test:test_simple_isOutputFinalized_succeeds() (gas: 356
51
)
OptimismPortal_Test:test_unpause_onlyGuardian_reverts() (gas: 31514)
OptimismPortal_Test:test_unpause_onlyGuardian_reverts() (gas: 31514)
OptimismPortal_Test:test_unpause_succeeds() (gas: 27451)
OptimismPortal_Test:test_unpause_succeeds() (gas: 27451)
OptimistAllowlistTest:test_constructor_succeeds() (gas: 16407)
OptimistAllowlistTest:test_constructor_succeeds() (gas: 16407)
...
...
packages/contracts-bedrock/.storage-layout
View file @
75b89b03
...
@@ -49,8 +49,8 @@
...
@@ -49,8 +49,8 @@
| startingBlockNumber | uint256 | 1 | 0 | 32 | src/L1/L2OutputOracle.sol:L2OutputOracle |
| startingBlockNumber | uint256 | 1 | 0 | 32 | src/L1/L2OutputOracle.sol:L2OutputOracle |
| startingTimestamp | uint256 | 2 | 0 | 32 | src/L1/L2OutputOracle.sol:L2OutputOracle |
| startingTimestamp | uint256 | 2 | 0 | 32 | src/L1/L2OutputOracle.sol:L2OutputOracle |
| l2Outputs | struct Types.OutputProposal[] | 3 | 0 | 32 | src/L1/L2OutputOracle.sol:L2OutputOracle |
| l2Outputs | struct Types.OutputProposal[] | 3 | 0 | 32 | src/L1/L2OutputOracle.sol:L2OutputOracle |
|
_CHALLENGER
| address | 4 | 0 | 20 | src/L1/L2OutputOracle.sol:L2OutputOracle |
|
CHALLENGER
| address | 4 | 0 | 20 | src/L1/L2OutputOracle.sol:L2OutputOracle |
|
_PROPOSER
| address | 5 | 0 | 20 | src/L1/L2OutputOracle.sol:L2OutputOracle |
|
PROPOSER
| address | 5 | 0 | 20 | src/L1/L2OutputOracle.sol:L2OutputOracle |
=======================
=======================
➡ src/L1/OptimismPortal.sol:OptimismPortal
➡ src/L1/OptimismPortal.sol:OptimismPortal
...
...
packages/contracts-bedrock/semver-lock.json
View file @
75b89b03
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"src/L1/L1CrossDomainMessenger.sol"
:
"0x2b276f14475869cfd81868b03dc72b91dd726a787c9568caf4849fe34830b207"
,
"src/L1/L1CrossDomainMessenger.sol"
:
"0x2b276f14475869cfd81868b03dc72b91dd726a787c9568caf4849fe34830b207"
,
"src/L1/L1ERC721Bridge.sol"
:
"0xac9d8e236a1b35c358f9800834f65375cf4270155e817cf3d0f2bac1968f9107"
,
"src/L1/L1ERC721Bridge.sol"
:
"0xac9d8e236a1b35c358f9800834f65375cf4270155e817cf3d0f2bac1968f9107"
,
"src/L1/L1StandardBridge.sol"
:
"0x26fd79e041c403f4bc68758c410fcc801975e7648c0b51a2c4a6e8c44fabcbfd"
,
"src/L1/L1StandardBridge.sol"
:
"0x26fd79e041c403f4bc68758c410fcc801975e7648c0b51a2c4a6e8c44fabcbfd"
,
"src/L1/L2OutputOracle.sol"
:
"0x
c9dcbefd8e1fec6fdafedbf509a95cd01fd31a819c5bc474ffb0aae10e29e44
a"
,
"src/L1/L2OutputOracle.sol"
:
"0x
7c3245c8f37475aab4e43b6ed753ed140b5d4c38d25de797af56ee63258c002
a"
,
"src/L1/OptimismPortal.sol"
:
"0xeaa47a63e8a3bcfdb7dfd3e6c8608369e34e362d9de82f3acf13cbc27c070bf7"
,
"src/L1/OptimismPortal.sol"
:
"0xeaa47a63e8a3bcfdb7dfd3e6c8608369e34e362d9de82f3acf13cbc27c070bf7"
,
"src/L1/SystemConfig.sol"
:
"0x8e2b5103d2eb93b74af2e2f96a4505e637cdc3c44d80cf5ec2eca70060e1deff"
,
"src/L1/SystemConfig.sol"
:
"0x8e2b5103d2eb93b74af2e2f96a4505e637cdc3c44d80cf5ec2eca70060e1deff"
,
"src/L2/BaseFeeVault.sol"
:
"0xa596e60762f16192cfa86459fcb9f4da9d8f756106eedac643a1ffeafbbfcc5f"
,
"src/L2/BaseFeeVault.sol"
:
"0xa596e60762f16192cfa86459fcb9f4da9d8f756106eedac643a1ffeafbbfcc5f"
,
...
...
packages/contracts-bedrock/src/L1/L2OutputOracle.sol
View file @
75b89b03
...
@@ -14,13 +14,22 @@ contract L2OutputOracle is Initializable, Semver {
...
@@ -14,13 +14,22 @@ contract L2OutputOracle is Initializable, Semver {
/// @notice The interval in L2 blocks at which checkpoints must be submitted.
/// @notice The interval in L2 blocks at which checkpoints must be submitted.
/// Although this is immutable, it can safely be modified by upgrading the
/// Although this is immutable, it can safely be modified by upgrading the
/// implementation contract.
/// implementation contract.
uint256 internal immutable _SUBMISSION_INTERVAL;
/// Public getter is legacy and will be removed in the future. Use `submissionInterval`
/// instead.
/// @custom:legacy
uint256 public immutable SUBMISSION_INTERVAL;
/// @notice The time between L2 blocks in seconds. Once set, this value MUST NOT be modified.
/// @notice The time between L2 blocks in seconds. Once set, this value MUST NOT be modified.
uint256 internal immutable _L2_BLOCK_TIME;
/// Public getter is legacy and will be removed in the future. Use `l2BlockTime`
/// instead.
/// @custom:legacy
uint256 public immutable L2_BLOCK_TIME;
/// @notice The minimum time (in seconds) that must elapse before a withdrawal can be finalized.
/// @notice The minimum time (in seconds) that must elapse before a withdrawal can be finalized.
uint256 internal immutable _FINALIZATION_PERIOD_SECONDS;
/// Public getter is legacy and will be removed in the future. Use
// `finalizationPeriodSeconds` instead.
/// @custom:legacy
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.
uint256 public startingBlockNumber;
uint256 public startingBlockNumber;
...
@@ -32,12 +41,18 @@ contract L2OutputOracle is Initializable, Semver {
...
@@ -32,12 +41,18 @@ contract L2OutputOracle is Initializable, Semver {
Types.OutputProposal[] internal l2Outputs;
Types.OutputProposal[] internal l2Outputs;
/// @notice The address of the challenger. Can be updated via upgrade.
/// @notice The address of the challenger. Can be updated via upgrade.
/// Public getter is legacy and will be removed in the future.
/// Use `challenger` instead.
/// @custom:network-specific
/// @custom:network-specific
address internal _CHALLENGER;
/// @custom:legacy
address public CHALLENGER;
/// @notice The address of the proposer. Can be updated via upgrade.
/// @notice The address of the proposer. Can be updated via upgrade.
/// Public getter is legacy and will be removed in the future.
/// Use `proposer` instead.
/// @custom:network-specific
/// @custom:network-specific
address internal _PROPOSER;
/// @custom:legacy
address public PROPOSER;
/// @notice Emitted when an output is proposed.
/// @notice Emitted when an output is proposed.
/// @param outputRoot The output root.
/// @param outputRoot The output root.
...
@@ -73,9 +88,9 @@ contract L2OutputOracle is Initializable, Semver {
...
@@ -73,9 +88,9 @@ contract L2OutputOracle is Initializable, Semver {
"L2OutputOracle: submission interval must be greater than 0"
"L2OutputOracle: submission interval must be greater than 0"
);
);
_
SUBMISSION_INTERVAL = _submissionInterval;
SUBMISSION_INTERVAL = _submissionInterval;
_
L2_BLOCK_TIME = _l2BlockTime;
L2_BLOCK_TIME = _l2BlockTime;
_
FINALIZATION_PERIOD_SECONDS = _finalizationPeriodSeconds;
FINALIZATION_PERIOD_SECONDS = _finalizationPeriodSeconds;
initialize({
initialize({
_startingBlockNumber: 0,
_startingBlockNumber: 0,
...
@@ -104,63 +119,33 @@ contract L2OutputOracle is Initializable, Semver {
...
@@ -104,63 +119,33 @@ contract L2OutputOracle is Initializable, Semver {
startingTimestamp = _startingTimestamp;
startingTimestamp = _startingTimestamp;
startingBlockNumber = _startingBlockNumber;
startingBlockNumber = _startingBlockNumber;
_PROPOSER = _proposer;
PROPOSER = _proposer;
_CHALLENGER = _challenger;
CHALLENGER = _challenger;
}
/// @notice Getter for the output proposal submission interval.
/// @custom:legacy
function SUBMISSION_INTERVAL() external view returns (uint256) {
return _SUBMISSION_INTERVAL;
}
}
/// @notice Getter for the output proposal submission interval.
/// @notice Getter for the output proposal submission interval.
function submissionInterval() external view returns (uint256) {
function submissionInterval() external view returns (uint256) {
return _SUBMISSION_INTERVAL;
return SUBMISSION_INTERVAL;
}
/// @notice Getter for the L2 block time.
/// @custom:legacy
function L2_BLOCK_TIME() external view returns (uint256) {
return _L2_BLOCK_TIME;
}
}
/// @notice Getter for the L2 block time.
/// @notice Getter for the L2 block time.
function l2BlockTime() external view returns (uint256) {
function l2BlockTime() external view returns (uint256) {
return _L2_BLOCK_TIME;
return L2_BLOCK_TIME;
}
/// @notice Getter for the finalization period.
/// @custom:legacy
function FINALIZATION_PERIOD_SECONDS() external view returns (uint256) {
return _FINALIZATION_PERIOD_SECONDS;
}
}
/// @notice Getter for the finalization period.
/// @notice Getter for the finalization period.
function finalizationPeriodSeconds() external view returns (uint256) {
function finalizationPeriodSeconds() external view returns (uint256) {
return _FINALIZATION_PERIOD_SECONDS;
return FINALIZATION_PERIOD_SECONDS;
}
/// @notice Getter for the challenger address.
/// @custom:legacy
function CHALLENGER() external view returns (address) {
return _CHALLENGER;
}
}
/// @notice Getter for the challenger address.
/// @notice Getter for the challenger address.
function challenger() external view returns (address) {
function challenger() external view returns (address) {
return _CHALLENGER;
return CHALLENGER;
}
/// @notice Getter for the proposer address.
/// @custom:legacy
function PROPOSER() external view returns (address) {
return _PROPOSER;
}
}
/// @notice Getter for the proposer address.
/// @notice Getter for the proposer address.
function proposer() external view returns (address) {
function proposer() external view returns (address) {
return
_
PROPOSER;
return PROPOSER;
}
}
/// @notice Deletes all output proposals after and including the proposal that corresponds to
/// @notice Deletes all output proposals after and including the proposal that corresponds to
...
@@ -170,7 +155,7 @@ contract L2OutputOracle is Initializable, Semver {
...
@@ -170,7 +155,7 @@ contract L2OutputOracle is Initializable, Semver {
// solhint-disable-next-line ordering
// solhint-disable-next-line ordering
function deleteL2Outputs(uint256 _l2OutputIndex) external {
function deleteL2Outputs(uint256 _l2OutputIndex) external {
require(
require(
msg.sender ==
_
CHALLENGER,
msg.sender == CHALLENGER,
"L2OutputOracle: only the challenger address can delete outputs"
"L2OutputOracle: only the challenger address can delete outputs"
);
);
...
@@ -182,7 +167,7 @@ contract L2OutputOracle is Initializable, Semver {
...
@@ -182,7 +167,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 <
_
FINALIZATION_PERIOD_SECONDS,
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"
);
);
...
@@ -210,7 +195,7 @@ contract L2OutputOracle is Initializable, Semver {
...
@@ -210,7 +195,7 @@ contract L2OutputOracle is Initializable, Semver {
uint256 _l1BlockNumber
uint256 _l1BlockNumber
) external payable {
) external payable {
require(
require(
msg.sender ==
_
PROPOSER,
msg.sender == PROPOSER,
"L2OutputOracle: only the proposer address can propose new outputs"
"L2OutputOracle: only the proposer address can propose new outputs"
);
);
...
@@ -339,13 +324,13 @@ contract L2OutputOracle is Initializable, Semver {
...
@@ -339,13 +324,13 @@ contract L2OutputOracle is Initializable, Semver {
/// @notice Computes the block number of the next L2 block that needs to be checkpointed.
/// @notice Computes the block number of the next L2 block that needs to be checkpointed.
/// @return Next L2 block number.
/// @return Next L2 block number.
function nextBlockNumber() public view returns (uint256) {
function nextBlockNumber() public view returns (uint256) {
return latestBlockNumber() +
_
SUBMISSION_INTERVAL;
return latestBlockNumber() + SUBMISSION_INTERVAL;
}
}
/// @notice Returns the L2 timestamp corresponding to a given L2 block number.
/// @notice Returns the L2 timestamp corresponding to a given L2 block number.
/// @param _l2BlockNumber The L2 block number of the target block.
/// @param _l2BlockNumber The L2 block number of the target block.
/// @return L2 timestamp of the given block.
/// @return L2 timestamp of the given block.
function computeL2Timestamp(uint256 _l2BlockNumber) public view returns (uint256) {
function computeL2Timestamp(uint256 _l2BlockNumber) public view returns (uint256) {
return startingTimestamp + ((_l2BlockNumber - startingBlockNumber) *
_
L2_BLOCK_TIME);
return startingTimestamp + ((_l2BlockNumber - startingBlockNumber) * L2_BLOCK_TIME);
}
}
}
}
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