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
08b96e2f
Commit
08b96e2f
authored
Mar 15, 2023
by
Joshua Gutow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-node: More logging
parent
60129ad5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
batch_queue.go
op-node/rollup/derive/batch_queue.go
+3
-2
channel_bank.go
op-node/rollup/derive/channel_bank.go
+3
-2
No files found.
op-node/rollup/derive/batch_queue.go
View file @
08b96e2f
...
@@ -139,6 +139,7 @@ func (bq *BatchQueue) AddBatch(batch *BatchData, l2SafeHead eth.L2BlockRef) {
...
@@ -139,6 +139,7 @@ func (bq *BatchQueue) AddBatch(batch *BatchData, l2SafeHead eth.L2BlockRef) {
if
validity
==
BatchDrop
{
if
validity
==
BatchDrop
{
return
// if we do drop the batch, CheckBatch will log the drop reason with WARN level.
return
// if we do drop the batch, CheckBatch will log the drop reason with WARN level.
}
}
bq
.
log
.
Debug
(
"Adding batch"
,
"batch_timestamp"
,
batch
.
Timestamp
,
"parent_hash"
,
batch
.
ParentHash
,
"batch_epoch"
,
batch
.
Epoch
(),
"txs"
,
len
(
batch
.
Transactions
))
bq
.
batches
[
batch
.
Timestamp
]
=
append
(
bq
.
batches
[
batch
.
Timestamp
],
&
data
)
bq
.
batches
[
batch
.
Timestamp
]
=
append
(
bq
.
batches
[
batch
.
Timestamp
],
&
data
)
}
}
...
@@ -212,7 +213,7 @@ batchLoop:
...
@@ -212,7 +213,7 @@ batchLoop:
if
nextBatch
.
Batch
.
EpochNum
==
rollup
.
Epoch
(
epoch
.
Number
)
+
1
{
if
nextBatch
.
Batch
.
EpochNum
==
rollup
.
Epoch
(
epoch
.
Number
)
+
1
{
bq
.
l1Blocks
=
bq
.
l1Blocks
[
1
:
]
bq
.
l1Blocks
=
bq
.
l1Blocks
[
1
:
]
}
}
bq
.
log
.
Trace
(
"Returning found
batch"
,
"epoch"
,
epoch
,
"batch_epoch"
,
nextBatch
.
Batch
.
EpochNum
,
"batch_timestamp"
,
nextBatch
.
Batch
.
Timestamp
)
bq
.
log
.
Info
(
"Found next
batch"
,
"epoch"
,
epoch
,
"batch_epoch"
,
nextBatch
.
Batch
.
EpochNum
,
"batch_timestamp"
,
nextBatch
.
Batch
.
Timestamp
)
return
nextBatch
.
Batch
,
nil
return
nextBatch
.
Batch
,
nil
}
}
...
@@ -241,7 +242,7 @@ batchLoop:
...
@@ -241,7 +242,7 @@ batchLoop:
// to preserve that L2 time >= L1 time. If this is the first block of the epoch, always generate a
// to preserve that L2 time >= L1 time. If this is the first block of the epoch, always generate a
// batch to ensure that we at least have one batch per epoch.
// batch to ensure that we at least have one batch per epoch.
if
nextTimestamp
<
nextEpoch
.
Time
||
firstOfEpoch
{
if
nextTimestamp
<
nextEpoch
.
Time
||
firstOfEpoch
{
bq
.
log
.
Trace
(
"Generating next batch"
,
"epoch"
,
epoch
,
"timestamp"
,
nextTimestamp
)
bq
.
log
.
Info
(
"Generating next batch"
,
"epoch"
,
epoch
,
"timestamp"
,
nextTimestamp
)
return
&
BatchData
{
return
&
BatchData
{
BatchV1
{
BatchV1
{
ParentHash
:
l2SafeHead
.
Hash
,
ParentHash
:
l2SafeHead
.
Hash
,
...
...
op-node/rollup/derive/channel_bank.go
View file @
08b96e2f
...
@@ -69,6 +69,7 @@ func (cb *ChannelBank) prune() {
...
@@ -69,6 +69,7 @@ func (cb *ChannelBank) prune() {
ch
:=
cb
.
channels
[
id
]
ch
:=
cb
.
channels
[
id
]
cb
.
channelQueue
=
cb
.
channelQueue
[
1
:
]
cb
.
channelQueue
=
cb
.
channelQueue
[
1
:
]
delete
(
cb
.
channels
,
id
)
delete
(
cb
.
channels
,
id
)
cb
.
log
.
Info
(
"pruning channel"
,
"channel"
,
id
,
"totalSize"
,
totalSize
,
"channel_size"
,
ch
.
size
,
"remaining_channel_count"
,
len
(
cb
.
channels
))
totalSize
-=
ch
.
size
totalSize
-=
ch
.
size
}
}
}
}
...
@@ -86,6 +87,7 @@ func (cb *ChannelBank) IngestFrame(f Frame) {
...
@@ -86,6 +87,7 @@ func (cb *ChannelBank) IngestFrame(f Frame) {
currentCh
=
NewChannel
(
f
.
ID
,
origin
)
currentCh
=
NewChannel
(
f
.
ID
,
origin
)
cb
.
channels
[
f
.
ID
]
=
currentCh
cb
.
channels
[
f
.
ID
]
=
currentCh
cb
.
channelQueue
=
append
(
cb
.
channelQueue
,
f
.
ID
)
cb
.
channelQueue
=
append
(
cb
.
channelQueue
,
f
.
ID
)
log
.
Info
(
"created new channel"
)
}
}
// check if the channel is not timed out
// check if the channel is not timed out
...
@@ -114,7 +116,7 @@ func (cb *ChannelBank) Read() (data []byte, err error) {
...
@@ -114,7 +116,7 @@ func (cb *ChannelBank) Read() (data []byte, err error) {
ch
:=
cb
.
channels
[
first
]
ch
:=
cb
.
channels
[
first
]
timedOut
:=
ch
.
OpenBlockNumber
()
+
cb
.
cfg
.
ChannelTimeout
<
cb
.
Origin
()
.
Number
timedOut
:=
ch
.
OpenBlockNumber
()
+
cb
.
cfg
.
ChannelTimeout
<
cb
.
Origin
()
.
Number
if
timedOut
{
if
timedOut
{
cb
.
log
.
Debug
(
"channel timed out"
,
"channel"
,
first
,
"frames"
,
len
(
ch
.
inputs
))
cb
.
log
.
Info
(
"channel timed out"
,
"channel"
,
first
,
"frames"
,
len
(
ch
.
inputs
))
delete
(
cb
.
channels
,
first
)
delete
(
cb
.
channels
,
first
)
cb
.
channelQueue
=
cb
.
channelQueue
[
1
:
]
cb
.
channelQueue
=
cb
.
channelQueue
[
1
:
]
return
nil
,
nil
// multiple different channels may all be timed out
return
nil
,
nil
// multiple different channels may all be timed out
...
@@ -137,7 +139,6 @@ func (cb *ChannelBank) Read() (data []byte, err error) {
...
@@ -137,7 +139,6 @@ func (cb *ChannelBank) Read() (data []byte, err error) {
// consistency around channel bank pruning which depends upon the order
// consistency around channel bank pruning which depends upon the order
// of operations.
// of operations.
func
(
cb
*
ChannelBank
)
NextData
(
ctx
context
.
Context
)
([]
byte
,
error
)
{
func
(
cb
*
ChannelBank
)
NextData
(
ctx
context
.
Context
)
([]
byte
,
error
)
{
// Do the read from the channel bank first
// Do the read from the channel bank first
data
,
err
:=
cb
.
Read
()
data
,
err
:=
cb
.
Read
()
if
err
==
io
.
EOF
{
if
err
==
io
.
EOF
{
...
...
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