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
01270d2d
Unverified
Commit
01270d2d
authored
Aug 19, 2024
by
George Knee
Committed by
GitHub
Aug 19, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add regression test (#11519)
parent
698633cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
ssz_test.go
op-service/eth/ssz_test.go
+9
-0
No files found.
op-service/eth/ssz_test.go
View file @
01270d2d
...
@@ -40,6 +40,15 @@ func FuzzExecutionPayloadUnmarshal(f *testing.F) {
...
@@ -40,6 +40,15 @@ func FuzzExecutionPayloadUnmarshal(f *testing.F) {
})
})
}
}
func
TestExecutionPayloadUnmarshalMaliciousData
(
t
*
testing
.
T
)
{
// Prior to https://github.com/ethereum-optimism/optimism/pull/10362 this causes a panic
// It should return an error and not panic
data
:=
[]
byte
(
"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
\x00\x02\x00\x00
0000000000000000000000000000000000000000000000000000000000000000
\x00\x02\x00\x00
0000"
)
var
payload
ExecutionPayload
err
:=
payload
.
UnmarshalSSZ
(
BlockV2
,
uint32
(
len
(
data
)),
bytes
.
NewReader
(
data
))
require
.
Error
(
t
,
err
)
}
// FuzzExecutionPayloadMarshalUnmarshal checks that our SSZ encoding>decoding round trips properly
// FuzzExecutionPayloadMarshalUnmarshal checks that our SSZ encoding>decoding round trips properly
func
FuzzExecutionPayloadMarshalUnmarshalV1
(
f
*
testing
.
F
)
{
func
FuzzExecutionPayloadMarshalUnmarshalV1
(
f
*
testing
.
F
)
{
f
.
Fuzz
(
func
(
t
*
testing
.
T
,
data
[]
byte
,
a
,
b
,
c
,
d
uint64
,
extraData
[]
byte
,
txs
uint16
,
txsData
[]
byte
)
{
f
.
Fuzz
(
func
(
t
*
testing
.
T
,
data
[]
byte
,
a
,
b
,
c
,
d
uint64
,
extraData
[]
byte
,
txs
uint16
,
txsData
[]
byte
)
{
...
...
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