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
4d072c07
Unverified
Commit
4d072c07
authored
Mar 17, 2023
by
mergify[bot]
Committed by
GitHub
Mar 17, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feat/portal-guardian-config
parents
d7658477
07fc1d54
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
3 deletions
+25
-3
tricky-donkeys-lick.md
.changeset/tricky-donkeys-lick.md
+9
-0
channel_builder.go
op-batcher/batcher/channel_builder.go
+11
-2
channel_builder_test.go
op-batcher/batcher/channel_builder_test.go
+5
-1
No files found.
.changeset/tricky-donkeys-lick.md
0 → 100644
View file @
4d072c07
---
'
@eth-optimism/chain-mon'
:
patch
'
@eth-optimism/data-transport-layer'
:
patch
'
@eth-optimism/fault-detector'
:
patch
'
@eth-optimism/message-relayer'
:
patch
'
@eth-optimism/replica-healthcheck'
:
patch
---
Empty patch release to re-release packages that failed to be released by a bug in the release process.
op-batcher/batcher/channel_builder.go
View file @
4d072c07
...
@@ -12,7 +12,8 @@ import (
...
@@ -12,7 +12,8 @@ import (
)
)
var
(
var
(
ErrInvalidMaxFrameSize
=
errors
.
New
(
"max frame size cannot be zero"
)
ErrZeroMaxFrameSize
=
errors
.
New
(
"max frame size cannot be zero"
)
ErrSmallMaxFrameSize
=
errors
.
New
(
"max frame size cannot be less than 23"
)
ErrInvalidChannelTimeout
=
errors
.
New
(
"channel timeout is less than the safety margin"
)
ErrInvalidChannelTimeout
=
errors
.
New
(
"channel timeout is less than the safety margin"
)
ErrInputTargetReached
=
errors
.
New
(
"target amount of input data reached"
)
ErrInputTargetReached
=
errors
.
New
(
"target amount of input data reached"
)
ErrMaxFrameIndex
=
errors
.
New
(
"max frame index reached (uint16)"
)
ErrMaxFrameIndex
=
errors
.
New
(
"max frame index reached (uint16)"
)
...
@@ -82,7 +83,15 @@ func (cc *ChannelConfig) Check() error {
...
@@ -82,7 +83,15 @@ func (cc *ChannelConfig) Check() error {
// will infinitely loop when trying to create frames in the
// will infinitely loop when trying to create frames in the
// [channelBuilder.OutputFrames] function.
// [channelBuilder.OutputFrames] function.
if
cc
.
MaxFrameSize
==
0
{
if
cc
.
MaxFrameSize
==
0
{
return
ErrInvalidMaxFrameSize
return
ErrZeroMaxFrameSize
}
// If the [MaxFrameSize] is set to < 23, the channel out
// will underflow the maxSize variable in the [derive.ChannelOut].
// Since it is of type uint64, it will wrap around to a very large
// number, making the frame size extremely large.
if
cc
.
MaxFrameSize
<
23
{
return
ErrSmallMaxFrameSize
}
}
return
nil
return
nil
...
...
op-batcher/batcher/channel_builder_test.go
View file @
4d072c07
...
@@ -37,7 +37,11 @@ func TestConfigValidation(t *testing.T) {
...
@@ -37,7 +37,11 @@ func TestConfigValidation(t *testing.T) {
// Set the config to have a zero max frame size.
// Set the config to have a zero max frame size.
validChannelConfig
.
MaxFrameSize
=
0
validChannelConfig
.
MaxFrameSize
=
0
require
.
ErrorIs
(
t
,
validChannelConfig
.
Check
(),
ErrInvalidMaxFrameSize
)
require
.
ErrorIs
(
t
,
validChannelConfig
.
Check
(),
ErrZeroMaxFrameSize
)
// Set the config to have a max frame size less than 23.
validChannelConfig
.
MaxFrameSize
=
22
require
.
ErrorIs
(
t
,
validChannelConfig
.
Check
(),
ErrSmallMaxFrameSize
)
// Reset the config and test the Timeout error.
// Reset the config and test the Timeout error.
// NOTE: We should be fuzzing these values with the constraint that
// NOTE: We should be fuzzing these values with the constraint that
...
...
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