Update primitive.yaml: Add Bytes primitive#484
Update primitive.yaml: Add Bytes primitive#484ryanschneider wants to merge 2 commits intoethereum:masterfrom
Conversation
Useful for expressing an arbitrary sequence of bytes.
|
I'd rather see the regex as |
Good call @mcdee I made that change. We can always change the |
| Bytes: | ||
| type: string | ||
| format: hex | ||
| description: "An arbitrary-length sequence of bytes" |
There was a problem hiding this comment.
arbitrary-length / unbounded values are not SSZ compatible, you always have to define a maximum bound
There was a problem hiding this comment.
I'll go ahead and close since ethereum/builder-specs#107 was closed as well. I guess better wording if we ever want to revisit this would be "An sequence of bytes with unspecified maximum length"
There was a problem hiding this comment.
"An sequence of bytes with unspecified maximum length"
You have to specify a maximum length, there is no unbounded type in ssz. That being said, it would still be possible for the execution requests list use case as you can just update the max length each hard fork if new request types are added
|
Closing since ethereum/builder-specs#107 which required this was closed as well. |
This came up in ethereum/builder-specs#107 (comment) (/cc @lucassaldanha). I agree with Lucas that Bitvector is probably wrong, and that currently we don't have a good primitive to express this.
I'm also not terribly familiar with the beacon API types though, so am open to other options, both in naming and format.
Some points of discussion:
ByteVector?{2,}(which I started with) or{0,}since before the latest changes to EIP-7865 the empty requests were encoded as"0x"which{2,}doesn't allow.sizeof(largest request type) * max_request_count_per_block + 1but that seemed to get really deep in the weeds for a field thats meany to be opaque for most purposes.