Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove incorrect usage of additionalProperties #502

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Feb 14, 2025

The usage of additionalProperties: false here is incorrect as each sub schema is evaluated independently, so what ends up happening is that when the second schema is evaluated which only has transactions_root as property, it will complain that there are additional properties if we pass a ExecutionPayloadHeader value since it has more properties like parent_hash.

This is the error when running spec tests in Lodestar

/body/message/body/execution_payload_header - must NOT have additional properties

And the more detailed error

{
  instancePath: "/body/message/body/execution_payload_header",
  schemaPath: "#/properties/body/anyOf/0/properties/message/allOf/1/properties/body/allOf/1/properties/execution_payload_header/allOf/1/additionalProperties",
  keyword: "additionalProperties",
  params: {
    additionalProperty: "parent_hash",
  },
  message: "must NOT have additional properties",
}

It also seems like we only use additionalProperties: false in the bellatrix types.

eg. capella types don't use it

allOf:
- $ref: '#/Capella/ExecutionPayloadCommon'
- type: object
required: [transactions_root, withdrawals_root]
properties:

@rolfyone rolfyone merged commit f8a01f6 into master Feb 14, 2025
3 checks passed
@rolfyone rolfyone deleted the nflaig/remove-additional-properties branch February 14, 2025 19:46
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.

2 participants