Skip to content
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

[Feature] Add Blob type that behaves like Bytes #1907

Open
mattsse opened this issue Jan 11, 2025 · 1 comment
Open

[Feature] Add Blob type that behaves like Bytes #1907

mattsse opened this issue Jan 11, 2025 · 1 comment
Labels
blocked This cannot move forward until something else changes

Comments

@mattsse
Copy link
Member

mattsse commented Jan 11, 2025

Component

consensus, eips, genesis

Describe the feature you would like

the current blob type is a fixedbytes alias allocated on the stack

/// A Blob serialized as 0x-prefixed hex string
pub type Blob = FixedBytes<BYTES_PER_BLOB>;

this is expensive to clone and has issues with StackOverflow in serde.

ideally we want a this to behave like Bytes but enforces the length at all times

we can solve this with a wrapper type Blob(Bytes) and only allow BYTES_PER_BLOB

but we need a way to transmute the blob to ckzg type so perhaps this should instead be Arc<FixedBytes<BYTES_PER_BLOB>>

so this will be problematic

core::mem::transmute::<&[Blob], &[c_kzg::Blob]>(self.blobs.as_slice()),

so I think we can do this unless we change the ckzg validation interfaces
or we arc the entire sidecar, which would then be incompatible with the blobsbundlev1 type

Additional context

No response

@mattsse mattsse added the blocked This cannot move forward until something else changes label Jan 11, 2025
@nadtech-hub
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This cannot move forward until something else changes
Projects
None yet
Development

No branches or pull requests

2 participants