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
f7cef711
Unverified
Commit
f7cef711
authored
Nov 07, 2024
by
Michael de Hoog
Committed by
GitHub
Nov 08, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Batcher] Fix memory leak, reverse prepended blocks (#12874)
* Don't prepend blocks in reverse order * Fix memory leak
parent
6ea4e40b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
channel_manager.go
op-batcher/batcher/channel_manager.go
+5
-2
No files found.
op-batcher/batcher/channel_manager.go
View file @
f7cef711
...
@@ -118,8 +118,11 @@ func (s *channelManager) TxConfirmed(_id txID, inclusionBlock eth.BlockID) {
...
@@ -118,8 +118,11 @@ func (s *channelManager) TxConfirmed(_id txID, inclusionBlock eth.BlockID) {
delete
(
s
.
txChannels
,
id
)
delete
(
s
.
txChannels
,
id
)
done
,
blocksToRequeue
:=
channel
.
TxConfirmed
(
id
,
inclusionBlock
)
done
,
blocksToRequeue
:=
channel
.
TxConfirmed
(
id
,
inclusionBlock
)
if
done
{
if
done
{
s
.
removePendingChannel
(
channel
)
if
len
(
blocksToRequeue
)
>
0
{
s
.
blocks
.
Prepend
(
blocksToRequeue
...
)
}
for
_
,
b
:=
range
blocksToRequeue
{
for
_
,
b
:=
range
blocksToRequeue
{
s
.
blocks
.
Prepend
(
b
)
s
.
metr
.
RecordL2BlockInPendingQueue
(
b
)
s
.
metr
.
RecordL2BlockInPendingQueue
(
b
)
}
}
}
}
...
@@ -505,8 +508,8 @@ func (s *channelManager) Requeue(newCfg ChannelConfig) {
...
@@ -505,8 +508,8 @@ func (s *channelManager) Requeue(newCfg ChannelConfig) {
}
}
// We put the blocks back at the front of the queue:
// We put the blocks back at the front of the queue:
s
.
blocks
.
Prepend
(
blocksToRequeue
...
)
for
_
,
b
:=
range
blocksToRequeue
{
for
_
,
b
:=
range
blocksToRequeue
{
s
.
blocks
.
Prepend
(
b
)
s
.
metr
.
RecordL2BlockInPendingQueue
(
b
)
s
.
metr
.
RecordL2BlockInPendingQueue
(
b
)
}
}
...
...
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