Some gossip work

This commit is contained in:
realbigsean
2022-02-20 14:11:10 -07:00
parent ebc0ccd02a
commit 3f1e5cee78
14 changed files with 138 additions and 34 deletions

View File

@@ -1,10 +1,10 @@
use crate::{Blob, EthSpec, Hash256, SignedBeaconBlock, Slot};
use serde_derive::{Deserialize, Serialize};
use ssz_derive::{Encode, Decode};
use ssz::{Decode, Encode};
use ssz_derive::{Decode, Encode};
use ssz_types::VariableList;
use tree_hash::TreeHash;
use tree_hash_derive::TreeHash;
use ssz::{Decode, Encode};
#[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))]
#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, PartialEq, Default)]
@@ -14,7 +14,7 @@ pub struct BlobWrapper<E: EthSpec> {
pub blobs: VariableList<Blob<E::ChunksPerBlob>, E::MaxObjectListSize>,
}
impl <E: EthSpec> BlobWrapper<E> {
impl<E: EthSpec> BlobWrapper<E> {
pub fn empty() -> Self {
Self::default()
}
@@ -24,4 +24,4 @@ impl <E: EthSpec> BlobWrapper<E> {
// Max size of variable length `blobs` field
+ (E::max_object_list_size() * <Blob<E::ChunksPerBlob> as Encode>::ssz_fixed_len())
}
}
}

View File

@@ -111,6 +111,7 @@ pub use crate::beacon_block_body::{
pub use crate::beacon_block_header::BeaconBlockHeader;
pub use crate::beacon_committee::{BeaconCommittee, OwnedBeaconCommittee};
pub use crate::beacon_state::{BeaconTreeHashCache, Error as BeaconStateError, *};
pub use crate::blob_wrapper::BlobWrapper;
pub use crate::chain_spec::{ChainSpec, Config, Domain};
pub use crate::checkpoint::Checkpoint;
pub use crate::config_and_preset::{
@@ -169,7 +170,6 @@ pub use crate::validator_registration_data::*;
pub use crate::validator_subscription::ValidatorSubscription;
pub use crate::voluntary_exit::VoluntaryExit;
use serde_big_array::BigArray;
pub use crate::blob_wrapper::BlobWrapper;
pub type CommitteeIndex = u64;
pub type Hash256 = H256;