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
ea25157d
Commit
ea25157d
authored
Dec 05, 2023
by
Tei Im
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log and set metrics after batch is derived without error
parent
a87eb496
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
channel_in_reader.go
op-node/rollup/derive/channel_in_reader.go
+10
-2
No files found.
op-node/rollup/derive/channel_in_reader.go
View file @
ea25157d
...
...
@@ -91,9 +91,13 @@ func (cr *ChannelInReader) NextBatch(ctx context.Context) (Batch, error) {
}
switch
batchData
.
GetBatchType
()
{
case
SingularBatchType
:
singularBatch
,
err
:=
GetSingularBatch
(
batchData
)
if
err
!=
nil
{
return
nil
,
err
}
cr
.
log
.
Debug
(
"decoded singular batch from channel"
)
cr
.
metrics
.
RecordDerivedBatches
(
"singular"
)
return
GetSingularBatch
(
batchData
)
return
singularBatch
,
nil
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.
...
...
@@ -101,9 +105,13 @@ func (cr *ChannelInReader) NextBatch(ctx context.Context) (Batch, error) {
// This is just for early dropping invalid batches as soon as possible.
return
nil
,
NewTemporaryError
(
fmt
.
Errorf
(
"cannot accept span batch in L1 block %s at time %d"
,
origin
,
origin
.
Time
))
}
spanBatch
,
err
:=
DeriveSpanBatch
(
batchData
,
cr
.
cfg
.
BlockTime
,
cr
.
cfg
.
Genesis
.
L2Time
,
cr
.
cfg
.
L2ChainID
)
if
err
!=
nil
{
return
nil
,
err
}
cr
.
log
.
Debug
(
"decoded span batch from channel"
)
cr
.
metrics
.
RecordDerivedBatches
(
"span"
)
return
DeriveSpanBatch
(
batchData
,
cr
.
cfg
.
BlockTime
,
cr
.
cfg
.
Genesis
.
L2Time
,
cr
.
cfg
.
L2ChainID
)
return
spanBatch
,
nil
default
:
// error is bubbled up to user, but pipeline can skip the batch and continue after.
return
nil
,
NewTemporaryError
(
fmt
.
Errorf
(
"unrecognized batch type: %d"
,
batchData
.
GetBatchType
()))
...
...
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