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
b18b1491
Commit
b18b1491
authored
Mar 15, 2023
by
Sebastian Stammler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-batcher: Let channelBuilder.AddBlock return L1BlockInfo
parent
cc2c0b4e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
channel_builder.go
op-batcher/batcher/channel_builder.go
+7
-7
No files found.
op-batcher/batcher/channel_builder.go
View file @
b18b1491
...
@@ -185,21 +185,21 @@ func (c *channelBuilder) Reset() error {
...
@@ -185,21 +185,21 @@ func (c *channelBuilder) Reset() error {
// already full. See description of FullErr for details.
// already full. See description of FullErr for details.
//
//
// Call OutputFrames() afterwards to create frames.
// Call OutputFrames() afterwards to create frames.
func
(
c
*
channelBuilder
)
AddBlock
(
block
*
types
.
Block
)
error
{
func
(
c
*
channelBuilder
)
AddBlock
(
block
*
types
.
Block
)
(
derive
.
L1BlockInfo
,
error
)
{
if
c
.
IsFull
()
{
if
c
.
IsFull
()
{
return
c
.
FullErr
()
return
derive
.
L1BlockInfo
{},
c
.
FullErr
()
}
}
batch
,
err
:=
derive
.
BlockToBatch
(
block
)
batch
,
l1info
,
err
:=
derive
.
BlockToBatch
(
block
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"converting block to batch: %w"
,
err
)
return
l1info
,
fmt
.
Errorf
(
"converting block to batch: %w"
,
err
)
}
}
if
_
,
err
=
c
.
co
.
AddBatch
(
batch
);
errors
.
Is
(
err
,
derive
.
ErrTooManyRLPBytes
)
{
if
_
,
err
=
c
.
co
.
AddBatch
(
batch
);
errors
.
Is
(
err
,
derive
.
ErrTooManyRLPBytes
)
{
c
.
setFullErr
(
err
)
c
.
setFullErr
(
err
)
return
c
.
FullErr
()
return
l1info
,
c
.
FullErr
()
}
else
if
err
!=
nil
{
}
else
if
err
!=
nil
{
return
fmt
.
Errorf
(
"adding block to channel out: %w"
,
err
)
return
l1info
,
fmt
.
Errorf
(
"adding block to channel out: %w"
,
err
)
}
}
c
.
blocks
=
append
(
c
.
blocks
,
block
)
c
.
blocks
=
append
(
c
.
blocks
,
block
)
c
.
updateSwTimeout
(
batch
)
c
.
updateSwTimeout
(
batch
)
...
@@ -209,7 +209,7 @@ func (c *channelBuilder) AddBlock(block *types.Block) error {
...
@@ -209,7 +209,7 @@ func (c *channelBuilder) AddBlock(block *types.Block) error {
// Adding this block still worked, so don't return error, just mark as full
// Adding this block still worked, so don't return error, just mark as full
}
}
return
nil
return
l1info
,
nil
}
}
// Timeout management
// Timeout management
...
...
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