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
20df7459
Unverified
Commit
20df7459
authored
May 03, 2021
by
Mark Tyneway
Committed by
GitHub
May 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l2geth: docall protect nil block (#736)
* l2geth: protect nil in eth_call * chore: add changeset
parent
d32d9155
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
forty-hotels-brake.md
.changeset/forty-hotels-brake.md
+5
-0
api.go
l2geth/internal/ethapi/api.go
+9
-7
No files found.
.changeset/forty-hotels-brake.md
0 → 100644
View file @
20df7459
---
'
@eth-optimism/l2geth'
:
patch
---
Protect a possible
`nil`
reference in
`eth_call`
when the blockchain is empty
l2geth/internal/ethapi/api.go
View file @
20df7459
...
@@ -937,14 +937,16 @@ func DoCall(ctx context.Context, b Backend, args CallArgs, blockNrOrHash rpc.Blo
...
@@ -937,14 +937,16 @@ func DoCall(ctx context.Context, b Backend, args CallArgs, blockNrOrHash rpc.Blo
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
0
,
false
,
err
return
nil
,
0
,
false
,
err
}
}
txs
:=
block
.
Transactions
()
if
block
!=
nil
{
if
header
.
Number
.
Uint64
()
!=
0
{
txs
:=
block
.
Transactions
()
if
len
(
txs
)
!=
1
{
if
header
.
Number
.
Uint64
()
!=
0
{
return
nil
,
0
,
false
,
fmt
.
Errorf
(
"block %d has more than 1 transaction"
,
header
.
Number
.
Uint64
())
if
len
(
txs
)
!=
1
{
return
nil
,
0
,
false
,
fmt
.
Errorf
(
"block %d has more than 1 transaction"
,
header
.
Number
.
Uint64
())
}
tx
:=
txs
[
0
]
blockNumber
=
tx
.
L1BlockNumber
()
timestamp
=
new
(
big
.
Int
)
.
SetUint64
(
tx
.
L1Timestamp
())
}
}
tx
:=
txs
[
0
]
blockNumber
=
tx
.
L1BlockNumber
()
timestamp
=
new
(
big
.
Int
)
.
SetUint64
(
tx
.
L1Timestamp
())
}
}
msg
,
err
=
core
.
EncodeSimulatedMessage
(
msg
,
timestamp
,
blockNumber
,
executionManager
,
stateManager
)
msg
,
err
=
core
.
EncodeSimulatedMessage
(
msg
,
timestamp
,
blockNumber
,
executionManager
,
stateManager
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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