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
8ef4058d
Unverified
Commit
8ef4058d
authored
Dec 22, 2022
by
mergify[bot]
Committed by
GitHub
Dec 22, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4545 from ethereum-optimism/jm/sbn-specs
specs: Document starting timestamp and block num vars
parents
5d0a3af6
4c1d0c27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
13 deletions
+38
-13
deploy-config.ts
packages/contracts-bedrock/src/deploy-config.ts
+3
-0
proposals.md
specs/proposals.md
+35
-13
No files found.
packages/contracts-bedrock/src/deploy-config.ts
View file @
8ef4058d
...
@@ -83,11 +83,14 @@ interface RequiredDeployConfig {
...
@@ -83,11 +83,14 @@ interface RequiredDeployConfig {
/**
/**
* Starting block number for the output oracle.
* Starting block number for the output oracle.
* Must be greater than or equal to the first Bedrock block. The first L2 output will correspond
* to this value plus the submission interval.
*/
*/
l2OutputOracleStartingBlockNumber
?:
number
l2OutputOracleStartingBlockNumber
?:
number
/**
/**
* Starting timestamp for the output oracle.
* Starting timestamp for the output oracle.
* MUST be the same as the timestamp of the L2OO start block.
*/
*/
l2OutputOracleStartingTimestamp
?:
number
l2OutputOracleStartingTimestamp
?:
number
...
...
specs/proposals.md
View file @
8ef4058d
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
-
[
Proposing L2 Output Commitments
](
#proposing-l2-output-commitments
)
-
[
Proposing L2 Output Commitments
](
#proposing-l2-output-commitments
)
-
[
L2 Output Commitment Construction
](
#l2-output-commitment-construction
)
-
[
L2 Output Commitment Construction
](
#l2-output-commitment-construction
)
-
[
L2 Output Oracle Smart Contract
](
#l2-output-oracle-smart-contract
)
-
[
L2 Output Oracle Smart Contract
](
#l2-output-oracle-smart-contract
)
-
[
Configuration
](
#configuration
)
-
[
Security Considerations
](
#security-considerations
)
-
[
Security Considerations
](
#security-considerations
)
-
[
L1 Reorgs
](
#l1-reorgs
)
-
[
L1 Reorgs
](
#l1-reorgs
)
-
[
Summary of Definitions
](
#summary-of-definitions
)
-
[
Summary of Definitions
](
#summary-of-definitions
)
...
@@ -42,10 +43,11 @@ described [below](#l2-output-commitment-construction).
...
@@ -42,10 +43,11 @@ described [below](#l2-output-commitment-construction).
If there is no newly finalized output, the service continues querying until it receives one. It then submits this
If there is no newly finalized output, the service continues querying until it receives one. It then submits this
output, and the appropriate timestamp, to the
[
L2 Output Root
](
#l2-output-root-smart-contract
)
contract's
output, and the appropriate timestamp, to the
[
L2 Output Root
](
#l2-output-root-smart-contract
)
contract's
`proposeL2Output()`
function. The timestamp MUST be the next multiple of the
`SUBMISSION_INTERVAL`
value.
`proposeL2Output()`
function. The timestamp block number must correspond to the
`startingBlockNumber`
plus the next
multiple of the
`SUBMISSION_INTERVAL`
value.
The proposer may also delete
the most recent output root by calling the
`deleteL2Output()`
function.
The proposer may also delete
multiple output roots by calling the
`deleteL2Outputs()`
function and specifying the
The function can be called repeatedly if it is necessary to roll back the state further
.
index of the first output to delete, this will also delete all subsequent outputs
.
> **Note regarding future work:** In the initial version of the system, the proposer will be the same entity as the
> **Note regarding future work:** In the initial version of the system, the proposer will be the same entity as the
> sequencer, which is a trusted role. In the future proposers will need to submit a bond in order to post L2 output
> sequencer, which is a trusted role. In the future proposers will need to submit a bond in order to post L2 output
...
@@ -96,12 +98,23 @@ The exact number is yet to be determined, and will depend on the design of the f
...
@@ -96,12 +98,23 @@ The exact number is yet to be determined, and will depend on the design of the f
The L2 Output Oracle contract implements the following interface:
The L2 Output Oracle contract implements the following interface:
```
js
```
solidity
/**
* @notice The number of the first L2 block recorded in this contract.
*/
uint256 public startingBlockNumber;
/**
* @notice The timestamp of the first L2 block recorded in this contract.
*/
uint256 public startingTimestamp;
/**
/**
* @notice Accepts an L2 outputRoot and the timestamp of the corresponding L2 block. The
* @notice Accepts an L2 outputRoot and the timestamp of the corresponding L2 block. The
* timestamp must be equal to the current value returned by `nextTimestamp()` in order to be
* timestamp must be equal to the current value returned by `nextTimestamp()` in order to be
* accepted.
* accepted.
* This function may only be called by the Proposer.
* This function may only be called by the Proposer.
*
* @param _l2Output The L2 output of the checkpoint block.
* @param _l2Output The L2 output of the checkpoint block.
* @param _l2BlockNumber The L2 block number that resulted in _l2Output.
* @param _l2BlockNumber The L2 block number that resulted in _l2Output.
* @param _l1Blockhash A block hash which must be included in the current chain.
* @param _l1Blockhash A block hash which must be included in the current chain.
...
@@ -115,18 +128,27 @@ The L2 Output Oracle contract implements the following interface:
...
@@ -115,18 +128,27 @@ The L2 Output Oracle contract implements the following interface:
)
)
/**
/**
* @notice Deletes the most recent output.
* @notice Deletes all output proposals after and including the proposal that corresponds to
* @param _l2Output The value of the most recent output. Used to prevent erroneously deleting
* the given output index. Only the challenger address can delete outputs.
* the wrong root
*
* @param _l2OutputIndex Index of the first L2 output to be deleted. All outputs after this
* output will also be deleted.
*/
*/
function
deleteL2Output
(
bytes32
_l2Output
)
external
function deleteL2Output
s(uint256 _l2OutputIndex
) external
/**
/**
* @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.
*/
*/
function
getNextBlockNumber
()
public
view
returns
(
uint256
)
{
function getNextBlockNumber() public view returns (uint256)
```
```
### Configuration
The
`startingBlockNumber`
must be at least the number of the first Bedrock block.
The
`startingTimestamp`
MUST be the same as the timestamp of the start block.
The first
`outputRoot`
proposed will thus be at height
`startingBlockNumber + SUBMISSION_INTERVAL`
## Security Considerations
## Security Considerations
### L1 Reorgs
### L1 Reorgs
...
@@ -140,7 +162,7 @@ will not match that of the block with that number and the call will revert.
...
@@ -140,7 +162,7 @@ will not match that of the block with that number and the call will revert.
### Constants
### Constants
| Name | Value
| Unit |
| Name | Value | Unit |
| --------------------- | -----
-
| ------- |
| --------------------- | ----- | ------- |
|
`SUBMISSION_INTERVAL`
|
`1800`
| seconds
|
|
`SUBMISSION_INTERVAL`
|
TBD | blocks
|
|
`L2_BLOCK_TIME`
|
`2`
| seconds |
|
`L2_BLOCK_TIME`
|
`2`
| seconds |
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