From bef3a54c4ab9a28100aab2946e63457170f9718c Mon Sep 17 00:00:00 2001 From: Pawan Dhananjay Date: Thu, 16 Mar 2023 01:10:44 +0530 Subject: [PATCH] Fix after rebase --- consensus/types/src/blob_sidecar.rs | 8 ++------ consensus/types/src/lib.rs | 5 +---- consensus/types/src/signed_beacon_block.rs | 10 +++++++++- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/consensus/types/src/blob_sidecar.rs b/consensus/types/src/blob_sidecar.rs index c2d8e0aecd..27523d588d 100644 --- a/consensus/types/src/blob_sidecar.rs +++ b/consensus/types/src/blob_sidecar.rs @@ -1,11 +1,11 @@ use crate::test_utils::TestRandom; use crate::{Blob, EthSpec, Hash256, SignedRoot, Slot}; -use bls::Signature; use derivative::Derivative; use kzg::{KzgCommitment, KzgProof}; use serde_derive::{Deserialize, Serialize}; use ssz::Encode; use ssz_derive::{Decode, Encode}; +use ssz_types::VariableList; use test_random_derive::TestRandom; use tree_hash_derive::TreeHash; @@ -52,10 +52,6 @@ pub type BlobSidecarList = VariableList, ::MaxBl impl SignedRoot for BlobSidecar {} impl BlobSidecar { - pub fn id(&self) -> BlobIdentifier { - BlobIdentifier::new(self.block_root, self.index) - } - pub fn empty() -> Self { Self::default() } @@ -65,4 +61,4 @@ impl BlobSidecar { // Fixed part Self::empty().as_ssz_bytes().len() } -} +} \ No newline at end of file diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index 5db46c3445..e0db5419bb 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -25,7 +25,6 @@ pub mod beacon_block_body; pub mod beacon_block_header; pub mod beacon_committee; pub mod beacon_state; -pub mod blob_sidecar; pub mod bls_to_execution_change; pub mod builder_bid; pub mod chain_spec; @@ -220,7 +219,6 @@ pub type BLSFieldElement = Uint256; pub type Blob = FixedVector::BytesPerBlob>; pub type VersionedHash = Hash256; pub type Hash64 = ethereum_types::H64; -pub type BlobsSidecar = VariableList, ::MaxBlobsPerBlock>; pub use bls::{ AggregatePublicKey, AggregateSignature, Keypair, PublicKey, PublicKeyBytes, SecretKey, @@ -229,6 +227,5 @@ pub use bls::{ pub use kzg::{KzgCommitment, KzgProof}; -use crate::blob_sidecar::BlobSidecar; pub use ssz_types::{typenum, typenum::Unsigned, BitList, BitVector, FixedVector, VariableList}; -pub use superstruct::superstruct; +pub use superstruct::superstruct; \ No newline at end of file diff --git a/consensus/types/src/signed_beacon_block.rs b/consensus/types/src/signed_beacon_block.rs index 17651775da..00aad61ff4 100644 --- a/consensus/types/src/signed_beacon_block.rs +++ b/consensus/types/src/signed_beacon_block.rs @@ -35,6 +35,14 @@ impl From for Hash256 { } } +#[derive(Debug)] +pub enum BlobReconstructionError { + /// No blobs for the specified block where we would expect blobs. + UnavailableBlobs, + /// Blobs provided for a pre-Eip4844 fork. + InconsistentFork, +} + /// A `BeaconBlock` and a signature from its proposer. #[superstruct( variants(Base, Altair, Merge, Capella, Eip4844), @@ -573,4 +581,4 @@ mod test { assert_eq!(reconstructed, block); } } -} +} \ No newline at end of file