-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from jimmygchen/add-deneb-types
Add support for Deneb EIP-4844 types (blobs support)
- Loading branch information
Showing
8 changed files
with
184 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
pub use ethereum_consensus::{builder::SignedValidatorRegistration, deneb::mainnet as spec}; | ||
use ethereum_consensus::{ | ||
deneb::mainnet::MAX_BLOBS_PER_BLOCK, | ||
kzg::{KzgCommitment, KzgProof}, | ||
primitives::{BlsPublicKey, BlsSignature, Root, U256}, | ||
}; | ||
use ssz_rs::prelude::*; | ||
|
||
// NOTE: type alias here to call out the important types clearly, in lieu of just `pub use ...` | ||
pub type ExecutionPayload = spec::ExecutionPayload; | ||
pub type ExecutionPayloadHeader = spec::ExecutionPayloadHeader; | ||
pub type SignedBlindedBeaconBlock = spec::SignedBlindedBeaconBlock; | ||
pub type SignedBlindedBlobSidecar = spec::SignedBlindedBlobSidecar; | ||
pub type Blob = spec::Blob; | ||
|
||
#[derive(Debug, Default, Clone, SimpleSerialize)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
pub struct BuilderBid { | ||
pub header: spec::ExecutionPayloadHeader, | ||
pub blinded_blobs_bundle: BlindedBlobsBundle, | ||
pub value: U256, | ||
#[serde(rename = "pubkey")] | ||
pub public_key: BlsPublicKey, | ||
} | ||
|
||
#[derive(Debug, Default, Clone, SimpleSerialize)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
pub struct BlindedBlobsBundle { | ||
pub commitments: List<KzgCommitment, MAX_BLOBS_PER_BLOCK>, | ||
pub proofs: List<KzgProof, MAX_BLOBS_PER_BLOCK>, | ||
pub blob_roots: List<Root, MAX_BLOBS_PER_BLOCK>, | ||
} | ||
|
||
#[derive(Debug, Default, Clone, SimpleSerialize)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
pub struct SignedBuilderBid { | ||
pub message: BuilderBid, | ||
pub signature: BlsSignature, | ||
} | ||
|
||
#[derive(Debug, Default, Clone, SimpleSerialize)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
pub struct SignedBlindedBlockAndBlobSidecars { | ||
pub signed_blinded_block: SignedBlindedBeaconBlock, | ||
pub signed_blinded_blob_sidecars: List<SignedBlindedBlobSidecar, MAX_BLOBS_PER_BLOCK>, | ||
} | ||
|
||
#[derive(Debug, Default, Clone, SimpleSerialize)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
pub struct BlobsBundle { | ||
pub commitments: List<KzgCommitment, MAX_BLOBS_PER_BLOCK>, | ||
pub proofs: List<KzgProof, MAX_BLOBS_PER_BLOCK>, | ||
pub blobs: List<Blob, MAX_BLOBS_PER_BLOCK>, | ||
} | ||
|
||
#[derive(Debug, Default, Clone, SimpleSerialize)] | ||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] | ||
pub struct ExecutionPayloadAndBlobsBundle { | ||
pub execution_payload: ExecutionPayload, | ||
pub blobs_bundle: BlobsBundle, | ||
} |
Oops, something went wrong.