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
a8cf4399
Unverified
Commit
a8cf4399
authored
Feb 02, 2023
by
Marius van der Wijden
Committed by
GitHub
Feb 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/catalyst: return invalid params instead of invalid payload params (#26591)
parent
5d8bff1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
errors.go
core/beacon/errors.go
+1
-0
api.go
eth/catalyst/api.go
+2
-2
No files found.
core/beacon/errors.go
View file @
a8cf4399
...
@@ -80,6 +80,7 @@ var (
...
@@ -80,6 +80,7 @@ var (
UnknownPayload
=
&
EngineAPIError
{
code
:
-
38001
,
msg
:
"Unknown payload"
}
UnknownPayload
=
&
EngineAPIError
{
code
:
-
38001
,
msg
:
"Unknown payload"
}
InvalidForkChoiceState
=
&
EngineAPIError
{
code
:
-
38002
,
msg
:
"Invalid forkchoice state"
}
InvalidForkChoiceState
=
&
EngineAPIError
{
code
:
-
38002
,
msg
:
"Invalid forkchoice state"
}
InvalidPayloadAttributes
=
&
EngineAPIError
{
code
:
-
38003
,
msg
:
"Invalid payload attributes"
}
InvalidPayloadAttributes
=
&
EngineAPIError
{
code
:
-
38003
,
msg
:
"Invalid payload attributes"
}
InvalidParams
=
&
EngineAPIError
{
code
:
-
32602
,
msg
:
"Invalid parameters"
}
STATUS_INVALID
=
ForkChoiceResponse
{
PayloadStatus
:
PayloadStatusV1
{
Status
:
INVALID
},
PayloadID
:
nil
}
STATUS_INVALID
=
ForkChoiceResponse
{
PayloadStatus
:
PayloadStatusV1
{
Status
:
INVALID
},
PayloadID
:
nil
}
STATUS_SYNCING
=
ForkChoiceResponse
{
PayloadStatus
:
PayloadStatusV1
{
Status
:
SYNCING
},
PayloadID
:
nil
}
STATUS_SYNCING
=
ForkChoiceResponse
{
PayloadStatus
:
PayloadStatusV1
{
Status
:
SYNCING
},
PayloadID
:
nil
}
...
...
eth/catalyst/api.go
View file @
a8cf4399
...
@@ -168,7 +168,7 @@ func NewConsensusAPI(eth *eth.Ethereum) *ConsensusAPI {
...
@@ -168,7 +168,7 @@ func NewConsensusAPI(eth *eth.Ethereum) *ConsensusAPI {
// and return its payloadID.
// and return its payloadID.
func
(
api
*
ConsensusAPI
)
ForkchoiceUpdatedV1
(
update
beacon
.
ForkchoiceStateV1
,
payloadAttributes
*
beacon
.
PayloadAttributes
)
(
beacon
.
ForkChoiceResponse
,
error
)
{
func
(
api
*
ConsensusAPI
)
ForkchoiceUpdatedV1
(
update
beacon
.
ForkchoiceStateV1
,
payloadAttributes
*
beacon
.
PayloadAttributes
)
(
beacon
.
ForkChoiceResponse
,
error
)
{
if
payloadAttributes
!=
nil
&&
payloadAttributes
.
Withdrawals
!=
nil
{
if
payloadAttributes
!=
nil
&&
payloadAttributes
.
Withdrawals
!=
nil
{
return
beacon
.
STATUS_INVALID
,
fmt
.
Errorf
(
"withdrawals not supported in V1"
)
return
beacon
.
STATUS_INVALID
,
beacon
.
InvalidParams
.
With
(
fmt
.
Errorf
(
"withdrawals not supported in V1"
)
)
}
}
return
api
.
forkchoiceUpdated
(
update
,
payloadAttributes
)
return
api
.
forkchoiceUpdated
(
update
,
payloadAttributes
)
}
}
...
@@ -177,7 +177,7 @@ func (api *ConsensusAPI) ForkchoiceUpdatedV1(update beacon.ForkchoiceStateV1, pa
...
@@ -177,7 +177,7 @@ func (api *ConsensusAPI) ForkchoiceUpdatedV1(update beacon.ForkchoiceStateV1, pa
func
(
api
*
ConsensusAPI
)
ForkchoiceUpdatedV2
(
update
beacon
.
ForkchoiceStateV1
,
payloadAttributes
*
beacon
.
PayloadAttributes
)
(
beacon
.
ForkChoiceResponse
,
error
)
{
func
(
api
*
ConsensusAPI
)
ForkchoiceUpdatedV2
(
update
beacon
.
ForkchoiceStateV1
,
payloadAttributes
*
beacon
.
PayloadAttributes
)
(
beacon
.
ForkChoiceResponse
,
error
)
{
if
payloadAttributes
!=
nil
{
if
payloadAttributes
!=
nil
{
if
err
:=
api
.
verifyPayloadAttributes
(
payloadAttributes
);
err
!=
nil
{
if
err
:=
api
.
verifyPayloadAttributes
(
payloadAttributes
);
err
!=
nil
{
return
beacon
.
STATUS_INVALID
,
beacon
.
InvalidPa
yloadAttribute
s
.
With
(
err
)
return
beacon
.
STATUS_INVALID
,
beacon
.
InvalidPa
ram
s
.
With
(
err
)
}
}
}
}
return
api
.
forkchoiceUpdated
(
update
,
payloadAttributes
)
return
api
.
forkchoiceUpdated
(
update
,
payloadAttributes
)
...
...
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