-
Notifications
You must be signed in to change notification settings - Fork 159
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
Fix the blob encoding type #443
base: master
Are you sure you want to change the base?
Conversation
@g11tech Please take a look at this small change. |
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
What exactly are you trying to do? If you wanna decode the raw hex-encoded blob you can do |
@@ -127,7 +127,7 @@ Blob: | |||
type: string | |||
format: hex | |||
pattern: "^0x[a-fA-F0-9]{262144}$" | |||
description: "A blob is `FIELD_ELEMENTS_PER_BLOB * size_of(BLSFieldElement) = 4096 * 32 = 131072` bytes (`DATA`) representing a SSZ-encoded Blob as defined in Deneb" | |||
description: "A blob is `FIELD_ELEMENTS_PER_BLOB * size_of(BLSFieldElement) = 4096 * 32 = 131072` bytes (`DATA`) representing a Blob as defined in Deneb" |
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.
This is the hex encoded value sent over the wire, the blob is serialized using the ByteVector
type, maybe we could slightly rephrase it
Edit: I think that "SSZ-encoded" is meant to refer to JSON mapping in the ssz spec, i.e. how the blob should be encoded over the wire in a JSON response.
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.
It's raw bytes which was sent from the sender of EIP4844 transaction. If we considered it SSZ-Serialized, one will try to deserialize to get the actual blob, which is not the case here.
The raw bytes sent in transaction are the exact bytes returned over the API, where this description is been used.
The blobs returned from the beacon-apis are the raw bytes not encoded into ssz.
Mentioning it as SSZ encoded cause confusion to decode the output from the API e.g.
ssz.Blob.decode(api_response)
which will not match with the actual blobs.Some reference:
https://github.com/ChainSafe/lodestar/blob/ae984f0f6079f78c2445f36ae2ac09c9e868197e/packages/types/src/deneb/types.ts#L8