Skip to content

eip8016: add CompatibleUnion specs and tests#4581

Merged
jtraglia merged 19 commits into
ethereum:masterfrom
etan-status:cu-8016
Oct 7, 2025
Merged

eip8016: add CompatibleUnion specs and tests#4581
jtraglia merged 19 commits into
ethereum:masterfrom
etan-status:cu-8016

Conversation

@etan-status

Copy link
Copy Markdown
Contributor

This follows up on #4445, #4480, and #4529 to extend EIP-8016 support for unions, making the CompatibleUnion type available to _features.

This follows up on ethereum#4445, ethereum#4480, and ethereum#4529 to extend EIP-8016 support
for unions, making the `CompatibleUnion` type available to _features.

- https://eips.ethereum.org/EIPS/eip-8016
etan-status added a commit to status-im/nimbus-eth2 that referenced this pull request Sep 11, 2025
Implement test runner for new consensus-spec test format for EIP-8016
CompatibleUnion. New tests will automatically be picked up once
they become available.

- ethereum/consensus-specs#4581
@etan-status

etan-status commented Sep 11, 2025

Copy link
Copy Markdown
Contributor Author

@etan-status

Copy link
Copy Markdown
Contributor Author

This is the final of the new SSZ types.

@jtraglia jtraglia added the ssz Simple Serialize label Sep 11, 2025
@leolara leolara self-requested a review September 19, 2025 09:32
Comment thread ssz/simple-serialize.md
Comment on lines +164 to +165
- `CompatibleUnion({selector: type})` with a selector outside `uint8(1)` through
`uint8(127)` are illegal.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this allow 0 as a valid selector? [0..127].

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

https://eips.ethereum.org/EIPS/eip-8016#why-are-compatibleunion-selectors-limited-to-1--127

Currently reserving 0 for two reasons:

  • Preventing bugs from default zero initialization (require selection of a specific case)
  • Allow future expansion into None values (right now not needed)

The selector does not indicate an offset, so does not have a base, one might use values 5 and 12 without 1 through 4.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see. This makes sense. My only concern is that this will be a bit confusing in practice.

If this is how it must be, I understand 👍

Comment thread ssz/simple-serialize.md Outdated
Comment thread ssz/simple-serialize.md
Comment thread ssz/simple-serialize.md
Comment thread ssz/simple-serialize.md Outdated
Comment thread ssz/simple-serialize.md Outdated
Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com>
Comment thread tests/generators/runners/ssz_generic_cases/ssz_compatible_union.py
Comment thread tests/generators/runners/ssz_generic_cases/ssz_compatible_union.py
Comment thread tests/generators/runners/ssz_generic_cases/ssz_compatible_union.py
@jtraglia jtraglia requested a review from leolara September 30, 2025 14:54
Comment thread tests/generators/runners/ssz_generic_cases/ssz_compatible_union.py

@jtraglia jtraglia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. I'm going to merge this now even though I suspect there will be determinism issues with the generated tests. We should fix this in a follow up PR. Related to:

@jtraglia jtraglia merged commit 67bf243 into ethereum:master Oct 7, 2025
15 checks passed
@etan-status etan-status deleted the cu-8016 branch October 7, 2025 16:44
leolara pushed a commit to leolara/consensus-specs that referenced this pull request Oct 14, 2025
This follows up on ethereum#4445, ethereum#4480, and ethereum#4529 to extend EIP-8016 support
for unions, making the `CompatibleUnion` type available to _features.

- https://eips.ethereum.org/EIPS/eip-8016
leolara pushed a commit to leolara/consensus-specs that referenced this pull request Oct 16, 2025
This follows up on ethereum#4445, ethereum#4480, and ethereum#4529 to extend EIP-8016 support
for unions, making the `CompatibleUnion` type available to _features.

- https://eips.ethereum.org/EIPS/eip-8016
tersec pushed a commit to status-im/nimbus-eth2 that referenced this pull request Oct 17, 2025
Implement test runner for new consensus-spec test format for EIP-8016
CompatibleUnion. New tests will automatically be picked up once
they become available.

- ethereum/consensus-specs#4581
tersec pushed a commit to status-im/nimbus-eth2 that referenced this pull request Oct 21, 2025
* Extend SSZ generic tests with CompatibleUnion tests

Implement test runner for new consensus-spec test format for EIP-8016
CompatibleUnion. New tests will automatically be picked up once
they become available.

- ethereum/consensus-specs#4581

* Properly process proglist SSZ generic tests

* Split loading fix for next beta

* Split coverage fix into next beta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ssz Simple Serialize

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants