Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
2227589f
Unverified
Commit
2227589f
authored
Jun 02, 2022
by
Marius van der Wijden
Committed by
GitHub
Jun 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/catalyst: return 0x0 on Invalid block on top of pow block (#25006)
parent
3c6d6f7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
api.go
eth/catalyst/api.go
+6
-1
api_test.go
eth/catalyst/api_test.go
+2
-1
No files found.
eth/catalyst/api.go
View file @
2227589f
...
...
@@ -354,7 +354,12 @@ func computePayloadId(headBlockHash common.Hash, params *beacon.PayloadAttribute
func
(
api
*
ConsensusAPI
)
invalid
(
err
error
,
latestValid
*
types
.
Block
)
beacon
.
PayloadStatusV1
{
currentHash
:=
api
.
eth
.
BlockChain
()
.
CurrentBlock
()
.
Hash
()
if
latestValid
!=
nil
{
currentHash
=
latestValid
.
Hash
()
// Set latest valid hash to 0x0 if parent is PoW block
currentHash
=
common
.
Hash
{}
if
latestValid
.
Difficulty
()
.
BitLen
()
==
0
{
// Otherwise set latest valid hash to parent hash
currentHash
=
latestValid
.
Hash
()
}
}
errorMsg
:=
err
.
Error
()
return
beacon
.
PayloadStatusV1
{
Status
:
beacon
.
INVALID
,
LatestValidHash
:
&
currentHash
,
ValidationError
:
&
errorMsg
}
...
...
eth/catalyst/api_test.go
View file @
2227589f
...
...
@@ -647,7 +647,8 @@ func TestEmptyBlocks(t *testing.T) {
if
status
.
Status
!=
beacon
.
INVALID
{
t
.
Errorf
(
"invalid status: expected INVALID got: %v"
,
status
.
Status
)
}
expected
:=
commonAncestor
.
Hash
()
// Expect 0x0 on INVALID block on top of PoW block
expected
:=
common
.
Hash
{}
if
!
bytes
.
Equal
(
status
.
LatestValidHash
[
:
],
expected
[
:
])
{
t
.
Fatalf
(
"invalid LVH: got %v want %v"
,
status
.
LatestValidHash
,
expected
)
}
...
...
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