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
26179b1e
Unverified
Commit
26179b1e
authored
Jun 29, 2022
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix FillMissingBatches edge case, and correct spec off by 1
parent
ec2b8a39
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
batches.go
op-node/rollup/derive/batches.go
+2
-2
l1_block_info_test.go
op-node/rollup/derive/l1_block_info_test.go
+0
-1
rollup-node.md
specs/rollup-node.md
+2
-2
No files found.
op-node/rollup/derive/batches.go
View file @
26179b1e
...
@@ -70,8 +70,8 @@ func FillMissingBatches(batches []*BatchData, epoch eth.BlockID, blockTime, minL
...
@@ -70,8 +70,8 @@ func FillMissingBatches(batches []*BatchData, epoch eth.BlockID, blockTime, minL
// - fill up to the next L1 block timestamp, if higher, to keep up with L1 time
// - fill up to the next L1 block timestamp, if higher, to keep up with L1 time
// - fill up to the last valid batch, to keep up with L2 time
// - fill up to the last valid batch, to keep up with L2 time
newHeadL2Timestamp
:=
minL2Time
newHeadL2Timestamp
:=
minL2Time
if
nextL1Time
>
newHeadL2Timestamp
+
blockTime
{
if
nextL1Time
>
newHeadL2Timestamp
+
1
{
newHeadL2Timestamp
=
nextL1Time
-
blockTime
newHeadL2Timestamp
=
nextL1Time
-
1
}
}
for
_
,
b
:=
range
batches
{
for
_
,
b
:=
range
batches
{
m
[
b
.
BatchV1
.
Timestamp
]
=
b
m
[
b
.
BatchV1
.
Timestamp
]
=
b
...
...
op-node/rollup/derive/l1_block_info_test.go
View file @
26179b1e
...
@@ -6,7 +6,6 @@ import (
...
@@ -6,7 +6,6 @@ import (
"testing"
"testing"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum-optimism/optimism/op-node/testutils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/assert"
...
...
specs/rollup-node.md
View file @
26179b1e
...
@@ -181,8 +181,8 @@ To encode user-deposited transactions, refer to the following sections of the de
...
@@ -181,8 +181,8 @@ To encode user-deposited transactions, refer to the following sections of the de
A sequencing window is derived into a variable number of L2 blocks, defined by a range of timestamps:
A sequencing window is derived into a variable number of L2 blocks, defined by a range of timestamps:
-
Starting at
`min_l2_timestamp`
, as defined in the batch filtering.
-
Starting at
`min_l2_timestamp`
, as defined in the batch filtering.
-
Up to and including
-
Up to and including
(including only if aligned with L2 block time)
`new_head_l2_timestamp = max(highest_valid_batch_timestamp, next_l1_timestamp -
l2_block_time
, min_l2_timestamp)`
`new_head_l2_timestamp = max(highest_valid_batch_timestamp, next_l1_timestamp -
1
, min_l2_timestamp)`
-
`highest_valid_batch_timestamp = max(batch.timestamp for batch in filtered_batches)`
,
-
`highest_valid_batch_timestamp = max(batch.timestamp for batch in filtered_batches)`
,
or
`0`
if no there are no
`filtered_batches`
.
or
`0`
if no there are no
`filtered_batches`
.
`batch.timestamp`
refers to the L2 block timestamp encoded in the batch.
`batch.timestamp`
refers to the L2 block timestamp encoded in the batch.
...
...
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