Merge remote-tracking branch 'upstream/unstable'

This commit is contained in:
Mark Mackey
2024-05-24 13:24:37 +02:00
103 changed files with 2154 additions and 1595 deletions

View File

@@ -5,6 +5,7 @@ use derivative::Derivative;
use serde::{Deserialize, Serialize};
use ssz::{Decode, DecodeError};
use ssz_derive::{Decode, Encode};
use std::fmt;
use std::marker::PhantomData;
use superstruct::superstruct;
use test_random_derive::TestRandom;
@@ -869,6 +870,23 @@ impl<E: EthSpec, Payload: AbstractExecPayload<E>> ForkVersionDeserialize
))
}
}
pub enum BlockImportSource {
Gossip,
Lookup,
RangeSync,
HttpApi,
}
impl fmt::Display for BlockImportSource {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
BlockImportSource::Gossip => write!(f, "gossip"),
BlockImportSource::Lookup => write!(f, "lookup"),
BlockImportSource::RangeSync => write!(f, "range_sync"),
BlockImportSource::HttpApi => write!(f, "http_api"),
}
}
}
#[cfg(test)]
mod tests {

View File

@@ -130,7 +130,7 @@ pub use crate::attester_slashing::{
pub use crate::beacon_block::{
BeaconBlock, BeaconBlockAltair, BeaconBlockBase, BeaconBlockBellatrix, BeaconBlockCapella,
BeaconBlockDeneb, BeaconBlockElectra, BeaconBlockRef, BeaconBlockRefMut, BlindedBeaconBlock,
EmptyBlock,
BlockImportSource, EmptyBlock,
};
pub use crate::beacon_block_body::{
BeaconBlockBody, BeaconBlockBodyAltair, BeaconBlockBodyBase, BeaconBlockBodyBellatrix,