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
efddff2d
Commit
efddff2d
authored
Dec 01, 2023
by
pcw109550
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-node: Refactor to expose singular batch conversion
parent
c2260ca0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
channel_in_reader.go
op-node/rollup/derive/channel_in_reader.go
+1
-6
singular_batch.go
op-node/rollup/derive/singular_batch.go
+10
-0
No files found.
op-node/rollup/derive/channel_in_reader.go
View file @
efddff2d
...
...
@@ -3,7 +3,6 @@ package derive
import
(
"bytes"
"context"
"errors"
"fmt"
"io"
...
...
@@ -92,11 +91,7 @@ func (cr *ChannelInReader) NextBatch(ctx context.Context) (Batch, error) {
}
switch
batchData
.
GetBatchType
()
{
case
SingularBatchType
:
singularBatch
,
ok
:=
batchData
.
inner
.
(
*
SingularBatch
)
if
!
ok
{
return
nil
,
NewCriticalError
(
errors
.
New
(
"failed type assertion to SingularBatch"
))
}
return
singularBatch
,
nil
return
GetSingularBatch
(
batchData
)
case
SpanBatchType
:
if
origin
:=
cr
.
Origin
();
!
cr
.
cfg
.
IsDelta
(
origin
.
Time
)
{
// Check hard fork activation with the L1 inclusion block time instead of the L1 origin block time.
...
...
op-node/rollup/derive/singular_batch.go
View file @
efddff2d
...
...
@@ -2,6 +2,7 @@ package derive
import
(
"bytes"
"errors"
"io"
"github.com/ethereum-optimism/optimism/op-node/rollup"
...
...
@@ -65,3 +66,12 @@ func (b *SingularBatch) encode(w io.Writer) error {
func
(
b
*
SingularBatch
)
decode
(
r
*
bytes
.
Reader
)
error
{
return
rlp
.
Decode
(
r
,
b
)
}
// GetSingularBatch retrieves SingularBatch from batchData
func
GetSingularBatch
(
batchData
*
BatchData
)
(
*
SingularBatch
,
error
)
{
singularBatch
,
ok
:=
batchData
.
inner
.
(
*
SingularBatch
)
if
!
ok
{
return
nil
,
NewCriticalError
(
errors
.
New
(
"failed type assertion to SingularBatch"
))
}
return
singularBatch
,
nil
}
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