get spec tests working and fix json serialization

This commit is contained in:
realbigsean
2022-11-23 18:30:45 -05:00
parent abc933faa8
commit beddcfaac2
28 changed files with 487 additions and 212 deletions

View File

@@ -12,8 +12,9 @@ use tree_hash_derive::TreeHash;
pub struct BlobsSidecar<T: EthSpec> {
pub beacon_block_root: Hash256,
pub beacon_block_slot: Slot,
#[serde(with = "ssz_types::serde_utils::list_of_hex_fixed_vec")]
pub blobs: VariableList<Blob<T>, T::MaxBlobsPerBlock>,
pub kzg_aggregate_proof: KzgProof,
pub kzg_aggregated_proof: KzgProof,
}
impl<T: EthSpec> SignedRoot for BlobsSidecar<T> {}

View File

@@ -254,11 +254,6 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq +
Self::MaxBlobsPerBlock::to_usize()
}
/// FIXME: why is this called chunks_per_blob??
fn chunks_per_blob() -> usize {
Self::FieldElementsPerBlob::to_usize()
}
/// Returns the `BYTES_PER_BLOB` constant for the specification.
fn bytes_per_blob() -> usize {
Self::BytesPerBlob::to_usize()
@@ -339,6 +334,7 @@ impl EthSpec for MinimalEthSpec {
type SlotsPerEth1VotingPeriod = U32; // 4 epochs * 8 slots per epoch
type MaxWithdrawalsPerPayload = U4;
type FieldElementsPerBlob = U4; //FIXME(sean) this is spec'd out currently but will likely change
type BytesPerBlob = U128; //FIXME(sean) this is spec'd out currently but will likely change
params_from_eth_spec!(MainnetEthSpec {
JustificationBitsLength,
@@ -361,8 +357,7 @@ impl EthSpec for MinimalEthSpec {
MaxExtraDataBytes,
MaxBlsToExecutionChanges,
MaxBlobsPerBlock,
BytesPerFieldElement,
BytesPerBlob
BytesPerFieldElement
});
fn default_spec() -> ChainSpec {

View File

@@ -170,8 +170,9 @@ pub use crate::signed_beacon_block::{
SignedBlindedBeaconBlock,
};
pub use crate::signed_beacon_block_header::SignedBeaconBlockHeader;
pub use crate::signed_bls_to_execution_change::SignedBlsToExecutionChange;
pub use crate::signed_block_and_blobs::SignedBeaconBlockAndBlobsSidecar;
pub use crate::signed_block_and_blobs::SignedBeaconBlockAndBlobsSidecarDecode;
pub use crate::signed_bls_to_execution_change::SignedBlsToExecutionChange;
pub use crate::signed_contribution_and_proof::SignedContributionAndProof;
pub use crate::signed_voluntary_exit::SignedVoluntaryExit;
pub use crate::signing_data::{SignedRoot, SigningData};