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
8d5109e7
Commit
8d5109e7
authored
Feb 04, 2023
by
Sebastian Stammler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-batcher: Rename TriggerTimeout -> CheckTimeout
parent
93f633d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
channel_builder.go
op-batcher/batcher/channel_builder.go
+3
-3
channel_manager.go
op-batcher/batcher/channel_manager.go
+4
-3
No files found.
op-batcher/batcher/channel_builder.go
View file @
8d5109e7
...
@@ -136,9 +136,9 @@ func (c *channelBuilder) TimedOut(blockNum uint64) bool {
...
@@ -136,9 +136,9 @@ func (c *channelBuilder) TimedOut(blockNum uint64) bool {
return
c
.
timeout
!=
0
&&
blockNum
>=
c
.
timeout
return
c
.
timeout
!=
0
&&
blockNum
>=
c
.
timeout
}
}
//
TriggerTimeout checks if the channel is timed out at the given timestamp
and
//
CheckTimeout checks if the channel is timed out at the given block number
and
// in this case
set
s the channel as full with reason ErrChannelTimedOut.
// in this case
mark
s the channel as full with reason ErrChannelTimedOut.
func
(
c
*
channelBuilder
)
Trigger
Timeout
(
blockNum
uint64
)
{
func
(
c
*
channelBuilder
)
Check
Timeout
(
blockNum
uint64
)
{
if
!
c
.
IsFull
()
&&
c
.
TimedOut
(
blockNum
)
{
if
!
c
.
IsFull
()
&&
c
.
TimedOut
(
blockNum
)
{
c
.
setFullErr
(
ErrChannelTimedOut
)
c
.
setFullErr
(
ErrChannelTimedOut
)
}
}
...
...
op-batcher/batcher/channel_manager.go
View file @
8d5109e7
...
@@ -211,7 +211,7 @@ func (s *channelManager) TxData(l1Head eth.BlockID) ([]byte, txID, error) {
...
@@ -211,7 +211,7 @@ func (s *channelManager) TxData(l1Head eth.BlockID) ([]byte, txID, error) {
return
nil
,
txID
{},
err
return
nil
,
txID
{},
err
}
}
s
.
trigger
Timeout
(
l1Head
)
s
.
check
Timeout
(
l1Head
)
if
err
:=
s
.
processBlocks
();
err
!=
nil
{
if
err
:=
s
.
processBlocks
();
err
!=
nil
{
return
nil
,
txID
{},
err
return
nil
,
txID
{},
err
...
@@ -239,8 +239,9 @@ func (s *channelManager) ensurePendingChannel(l1Head eth.BlockID) error {
...
@@ -239,8 +239,9 @@ func (s *channelManager) ensurePendingChannel(l1Head eth.BlockID) error {
return
nil
return
nil
}
}
func
(
s
*
channelManager
)
triggerTimeout
(
l1Head
eth
.
BlockID
)
{
// checkTimeout checks the block timeout on the pending channel.
s
.
pendingChannel
.
TriggerTimeout
(
l1Head
.
Number
)
func
(
s
*
channelManager
)
checkTimeout
(
l1Head
eth
.
BlockID
)
{
s
.
pendingChannel
.
CheckTimeout
(
l1Head
.
Number
)
ferr
:=
s
.
pendingChannel
.
FullErr
()
ferr
:=
s
.
pendingChannel
.
FullErr
()
s
.
log
.
Debug
(
"timeout triggered"
,
s
.
log
.
Debug
(
"timeout triggered"
,
"l1Head"
,
l1Head
,
"l1Head"
,
l1Head
,
...
...
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