-
Notifications
You must be signed in to change notification settings - Fork 1.1k
eip8016: add CompatibleUnion specs and tests #4581
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
Conversation
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
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
This is the final of the new SSZ types. |
- `CompatibleUnion({selector: type})` with a selector outside `uint8(1)` through | ||
`uint8(127)` are illegal. |
There was a problem hiding this comment.
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]
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
There was a problem hiding this 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:
This follows up on #4445, #4480, and #4529 to extend EIP-8016 support for unions, making the
CompatibleUnion
type available to _features.