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

Closed
mattsse opened this issue Jan 11, 2025 · 1 comment · Fixed by #2050
Closed

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

mattsse opened this issue Jan 11, 2025 · 1 comment · Fixed by #2050
Assignees
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

@mattsse mattsse added this to Alloy Feb 13, 2025
@github-project-automation github-project-automation bot moved this to Todo in Alloy Feb 13, 2025
@mattsse mattsse moved this from Todo to In Progress in Alloy Feb 13, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Alloy Feb 13, 2025
@yash-atreya yash-atreya moved this from Done to Completed in Alloy Mar 3, 2025
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
Status: Completed
Development

Successfully merging a pull request may close this issue.

3 participants