Skip to content

engine: use -38003 for wrong payloadAttributes version in forkchoiceUpdatedV2#761

Merged
fjl merged 1 commit intoethereum:mainfrom
MysticRyuujin:fix/fcuv1-v2-payload-attributes-error-code
Mar 9, 2026
Merged

engine: use -38003 for wrong payloadAttributes version in forkchoiceUpdatedV2#761
fjl merged 1 commit intoethereum:mainfrom
MysticRyuujin:fix/fcuv1-v2-payload-attributes-error-code

Conversation

@MysticRyuujin
Copy link
Copy Markdown
Contributor

@MysticRyuujin MysticRyuujin commented Mar 3, 2026

engine_forkchoiceUpdatedV2 specified -32602: Invalid params when the wrong version of payloadAttributes is used, but V3 and V4 both return -38003: Invalid payload attributes for the same class of error. This aligns V2 with that behaviour.

Ref: ethereum/go-ethereum#33918

-32602 ("Invalid params") is the standard JSON-RPC error for "wrong parameter type/shape, i.e. the call itself is malformed at the RPC level.

-38003 ("Invalid payload attributes") targets this case: attributes that are wrong for the given context.

…pdatedV2

Aligns with the behaviour specified for V3 and V4, which both return
-38003: Invalid payload attributes for a payloadAttributes structure
mismatch, rather than -32602: Invalid params.
MysticRyuujin added a commit to MysticRyuujin/hive that referenced this pull request Mar 3, 2026
Per ethereum/execution-apis#761, engine_forkchoiceUpdatedV2 should return
-38003 (INVALID_PAYLOAD_ATTRIBUTES) instead of -32602 (INVALID_PARAMS)
when the wrong version of payloadAttributes is provided.
Copy link
Copy Markdown
Contributor

@mkalinin mkalinin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I believe all EL clients would return -38003: Invalid payload attributes?

@lightclient
Copy link
Copy Markdown
Member

Maybe stupid question, but why change an old version of fcu? If anything, clients should be deleting these methods?

@fjl fjl merged commit 82d6321 into ethereum:main Mar 9, 2026
5 checks passed
lightclient pushed a commit to ethereum/hive that referenced this pull request Mar 9, 2026
)

Per ethereum/execution-apis#761, engine_forkchoiceUpdatedV2 should return
-38003 (INVALID_PAYLOAD_ATTRIBUTES) instead of -32602 (INVALID_PARAMS)
when the wrong version of payloadAttributes is provided.
yperbasis pushed a commit to erigontech/erigon that referenced this pull request Mar 17, 2026
This PR updates `engine_forkchoiceUpdatedV2` to return `-38003: Invalid
payload attributes` when the wrong `payloadAttributes` version is used.

  In particular, FCUv2 payload-attribute version mismatches such as:
  - missing `withdrawals` at or after Shanghai
  - unexpected `withdrawals` before Shanghai

should be treated as `Invalid payload attributes`, not `Invalid params`.

  ## Why

This change aligns the client with the latest Engine API spec update in:
  - ethereum/execution-apis#761

It also follows the implementation discussion and prior client-side
change in:
  - ethereum/go-ethereum#33918

The spec was clarified so that FCUv2 now behaves consistently with newer
forkchoiceUpdated versions for payloadAttributes structure/version
  mismatches.

  ## What changed

- Updated FCUv2 payload attributes validation to return `-38003` for
payloadAttributes version mismatches.
  - Added/updated regression coverage for the affected FCUv2 cases.

  ## Hive impact

This fixes the Hive `engine-withdrawals` failure caused by returning the
wrong error code for FCUv2 payloadAttributes mismatches.

  Relevant Hive failure:
-
https://hive.ethpandaops.io/#/test/generic/1773130326-4e173a80b2b6f0634fd0139743cbe0de

After this change, the client returns the expected error code for the
affected FCUv2 cases.

If my understanding or interpretation of the spec change is incorrect,
please let me know and I can adjust the implementation accordingly.

---------

Co-authored-by: muzry.li <muzry.li1@ambergroup.io>
github-merge-queue Bot pushed a commit to lambdaclass/ethrex that referenced this pull request Mar 17, 2026
This PR updates `engine_forkchoiceUpdatedV2` to return `-38003: Invalid
payload attributes` when the wrong `payloadAttributes` version is used.

  In particular, FCUv2 payload-attribute version mismatches such as:
  - missing `withdrawals` at or after Shanghai
  - unexpected `withdrawals` before Shanghai

should be treated as `Invalid payload attributes`, not `Invalid params`.

  ## Why

This change aligns the client with the latest Engine API spec update in:
  - ethereum/execution-apis#761

It also follows the implementation discussion and prior client-side
change in:
  - ethereum/go-ethereum#33918

The spec was clarified so that FCUv2 now behaves consistently with newer
forkchoiceUpdated versions for payloadAttributes structure/version
  mismatches.

  ## What changed

- Updated FCUv2 payload attributes validation to return `-38003` for
payloadAttributes version mismatches.
  - Added/updated regression coverage for the affected FCUv2 cases.

  ## Hive impact

This fixes the Hive `engine-withdrawals` failure caused by returning the
wrong error code for FCUv2 payloadAttributes mismatches.

  Relevant Hive failure:
-
https://hive.ethpandaops.io/#/test/generic/1773130989-fdc508a8e36929a0f9059e686f9f65ba

After this change, the client returns the expected error code for the
affected FCUv2 cases.

If my understanding or interpretation of the spec change is incorrect,
please let me know and I can adjust the implementation accordingly.
lupin012 pushed a commit to erigontech/erigon that referenced this pull request Mar 17, 2026
This PR updates `engine_forkchoiceUpdatedV2` to return `-38003: Invalid
payload attributes` when the wrong `payloadAttributes` version is used.

  In particular, FCUv2 payload-attribute version mismatches such as:
  - missing `withdrawals` at or after Shanghai
  - unexpected `withdrawals` before Shanghai

should be treated as `Invalid payload attributes`, not `Invalid params`.

  ## Why

This change aligns the client with the latest Engine API spec update in:
  - ethereum/execution-apis#761

It also follows the implementation discussion and prior client-side
change in:
  - ethereum/go-ethereum#33918

The spec was clarified so that FCUv2 now behaves consistently with newer
forkchoiceUpdated versions for payloadAttributes structure/version
  mismatches.

  ## What changed

- Updated FCUv2 payload attributes validation to return `-38003` for
payloadAttributes version mismatches.
  - Added/updated regression coverage for the affected FCUv2 cases.

  ## Hive impact

This fixes the Hive `engine-withdrawals` failure caused by returning the
wrong error code for FCUv2 payloadAttributes mismatches.

  Relevant Hive failure:
-
https://hive.ethpandaops.io/#/test/generic/1773130326-4e173a80b2b6f0634fd0139743cbe0de

After this change, the client returns the expected error code for the
affected FCUv2 cases.

If my understanding or interpretation of the spec change is incorrect,
please let me know and I can adjust the implementation accordingly.

---------

Co-authored-by: muzry.li <muzry.li1@ambergroup.io>
AskAlexSharov pushed a commit to erigontech/erigon that referenced this pull request Apr 8, 2026
This PR updates `engine_forkchoiceUpdatedV2` to return `-38003: Invalid
payload attributes` when the wrong `payloadAttributes` version is used.

  In particular, FCUv2 payload-attribute version mismatches such as:
  - missing `withdrawals` at or after Shanghai
  - unexpected `withdrawals` before Shanghai

should be treated as `Invalid payload attributes`, not `Invalid params`.

  ## Why

This change aligns the client with the latest Engine API spec update in:
  - ethereum/execution-apis#761

It also follows the implementation discussion and prior client-side
change in:
  - ethereum/go-ethereum#33918

The spec was clarified so that FCUv2 now behaves consistently with newer
forkchoiceUpdated versions for payloadAttributes structure/version
  mismatches.

  ## What changed

- Updated FCUv2 payload attributes validation to return `-38003` for
payloadAttributes version mismatches.
  - Added/updated regression coverage for the affected FCUv2 cases.

  ## Hive impact

This fixes the Hive `engine-withdrawals` failure caused by returning the
wrong error code for FCUv2 payloadAttributes mismatches.

  Relevant Hive failure:
-
https://hive.ethpandaops.io/#/test/generic/1773130326-4e173a80b2b6f0634fd0139743cbe0de

After this change, the client returns the expected error code for the
affected FCUv2 cases.

If my understanding or interpretation of the spec change is incorrect,
please let me know and I can adjust the implementation accordingly.

---------

Co-authored-by: muzry.li <muzry.li1@ambergroup.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants