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
b0a2d00d
Unverified
Commit
b0a2d00d
authored
Apr 06, 2023
by
OptimismBot
Committed by
GitHub
Apr 06, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5362 from ethereum-optimism/inphi/batcher-sane
op-batcher: Sanity check block for non-empty transactions
parents
5eae8164
db9b0867
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
channel_out.go
op-node/rollup/derive/channel_out.go
+3
-0
channel_out_test.go
op-node/rollup/derive/channel_out_test.go
+6
-0
No files found.
op-node/rollup/derive/channel_out.go
View file @
b0a2d00d
...
@@ -206,6 +206,9 @@ func BlockToBatch(block *types.Block) (*BatchData, L1BlockInfo, error) {
...
@@ -206,6 +206,9 @@ func BlockToBatch(block *types.Block) (*BatchData, L1BlockInfo, error) {
}
}
opaqueTxs
=
append
(
opaqueTxs
,
otx
)
opaqueTxs
=
append
(
opaqueTxs
,
otx
)
}
}
if
len
(
block
.
Transactions
())
==
0
{
return
nil
,
L1BlockInfo
{},
fmt
.
Errorf
(
"block %v has no transactions"
,
block
.
Hash
())
}
l1InfoTx
:=
block
.
Transactions
()[
0
]
l1InfoTx
:=
block
.
Transactions
()[
0
]
if
l1InfoTx
.
Type
()
!=
types
.
DepositTxType
{
if
l1InfoTx
.
Type
()
!=
types
.
DepositTxType
{
return
nil
,
L1BlockInfo
{},
ErrNotDepositTx
return
nil
,
L1BlockInfo
{},
ErrNotDepositTx
...
...
op-node/rollup/derive/channel_out_test.go
View file @
b0a2d00d
...
@@ -132,3 +132,9 @@ func TestForceCloseTxData(t *testing.T) {
...
@@ -132,3 +132,9 @@ func TestForceCloseTxData(t *testing.T) {
}
}
}
}
}
}
func
TestBlockToBatchValidity
(
t
*
testing
.
T
)
{
block
:=
new
(
types
.
Block
)
_
,
_
,
err
:=
BlockToBatch
(
block
)
require
.
ErrorContains
(
t
,
err
,
"has no transactions"
)
}
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