ethereum / beacon-APIs

Collection of RESTful APIs provided by Ethereum Beacon nodes
https://ethereum.github.io/beacon-APIs/
Creative Commons Zero v1.0 Universal
335 stars 169 forks source link

Fix the blob encoding type #443

Closed nazarhussain closed 4 months ago

nazarhussain commented 6 months ago

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

nazarhussain commented 6 months ago

@g11tech Please take a look at this small change.

nflaig commented 6 months ago

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.

What exactly are you trying to do? If you wanna decode the raw hex-encoded blob you can do ssz.Blob.fromJson()