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

Update blob_sidecar type #307

Merged
merged 6 commits into from
Nov 5, 2023
Merged

Conversation

EchoAlice
Copy link
Contributor

Fixes #306.

Note: kzg_commitment_inclusion_proof is a vector of Bytes32 in python spec.
Do we want it to be an array?

pub kzg_commitment_inclusion_proof = [Bytes32; KZG_COMMITMENT_INCLUSION_PROOF_DEPTH]

@ralexstokes
Copy link
Owner

the inclusion proof is a SSZ Vector

copying here:

class BlobSidecar(Container):
    index: BlobIndex  # Index of blob in block
    blob: Blob
    kzg_commitment: KZGCommitment
    kzg_proof: KZGProof  # Allows for quick verification of kzg_commitment
    signed_block_header: SignedBeaconBlockHeader
    kzg_commitment_inclusion_proof: Vector[Bytes32, KZG_COMMITMENT_INCLUSION_PROOF_DEPTH]

It's important for the SSZ serialization and hash tree root that the types match exactly.

So you can just import Vector from the ssz prelude: use crate::ssz::prelude::Vector along w/ the Bytes32 type if you need it

Copy link
Owner

@ralexstokes ralexstokes left a comment

Choose a reason for hiding this comment

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

nice! we can drop the signed envelope but then this looks g2g

ethereum-consensus/src/deneb/blob_sidecar.rs Outdated Show resolved Hide resolved
ethereum-consensus/src/deneb/presets/mainnet.rs Outdated Show resolved Hide resolved
ethereum-consensus/src/deneb/presets/minimal.rs Outdated Show resolved Hide resolved
Copy link
Owner

@ralexstokes ralexstokes left a comment

Choose a reason for hiding this comment

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

looks great! Nice work :)

@ralexstokes ralexstokes merged commit 70ed563 into ralexstokes:main Nov 5, 2023
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.

make latest blob updates
2 participants