mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
Log block import source (#5738)
* the default target peers is 100 * add some comments * Merge branch 'unstable' of https://github.com/sigp/lighthouse into track-block-import-source * add block import source * revert * update logging text * fix tests * lint * use % instaed of to_string
This commit is contained in:
@@ -4,6 +4,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;
|
||||
@@ -836,6 +837,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 {
|
||||
|
||||
@@ -122,7 +122,7 @@ pub use crate::attester_slashing::AttesterSlashing;
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user