8000 eip8016: add CompatibleUnion specs and tests by etan-status · Pull Request #4581 · ethereum/consensus-specs · GitHub
[go: up one dir, main page]

Skip to content

Conversation

etan-status
Copy link
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
Copy link
Contributor Author
etan-status commented Sep 11, 2025

@etan-status
Copy link
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 on lines +164 to +165
- `CompatibleUnion({selector: type})` with a selector outside `uint8(1)` through
`uint8(127)` are illegal.
Copy link
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
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
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 👍

Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com>
@jtraglia jtraglia requested a review from leolara September 30, 2025 14:54
Copy link
Member
@jtraglia jtraglia 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'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
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
0