Skip to content

Conversation

@ryanschneider
Copy link

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:

  • Alternative names: ByteVector?
  • I'm honestly not sure if the regex should be {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.
  • I could instead refactor the build spec since really the requests are bounded to sizeof(largest request type) * max_request_count_per_block + 1 but that seemed to get really deep in the weeds for a field thats meany to be opaque for most purposes.

Useful for expressing an arbitrary sequence of bytes.
@mcdee
Copy link
Contributor

mcdee commented Dec 6, 2024

I'd rather see the regex as ^0x([0-9a-fA-F][0-9a-fA-F])+$ to ensure that we don't end up with odd-length hex strings.

@ryanschneider
Copy link
Author

I'd rather see the regex as ^0x([0-9a-fA-F][0-9a-fA-F])+$ to ensure that we don't end up with odd-length hex strings.

Good call @mcdee I made that change. We can always change the + to a * if we feel that "0x" should be allowed to represent an empty byte sequence.

Bytes:
type: string
format: hex
description: "An arbitrary-length sequence of bytes"
Copy link
Member

Choose a reason for hiding this comment

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

arbitrary-length / unbounded values are not SSZ compatible, you always have to define a maximum bound

Copy link
Author

Choose a reason for hiding this comment

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

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"

Copy link
Member

Choose a reason for hiding this comment

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

"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

@ryanschneider
Copy link
Author

Closing since ethereum/builder-specs#107 which required this was closed as well.

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.

3 participants