diff --git a/beacon_node/beacon_chain/src/block_verification.rs b/beacon_node/beacon_chain/src/block_verification.rs index 5fc295900b..3a578b63a5 100644 --- a/beacon_node/beacon_chain/src/block_verification.rs +++ b/beacon_node/beacon_chain/src/block_verification.rs @@ -147,7 +147,6 @@ pub enum BlockError { present_slot: Slot, block_slot: Slot, }, - MissingSidecar, /// The block state_root does not match the generated state. /// /// ## Peer scoring diff --git a/beacon_node/beacon_chain/src/snapshot_cache.rs b/beacon_node/beacon_chain/src/snapshot_cache.rs index c77ef9e38a..40b73451cb 100644 --- a/beacon_node/beacon_chain/src/snapshot_cache.rs +++ b/beacon_node/beacon_chain/src/snapshot_cache.rs @@ -16,7 +16,7 @@ pub const DEFAULT_SNAPSHOT_CACHE_SIZE: usize = 4; const MINIMUM_BLOCK_DELAY_FOR_CLONE: Duration = Duration::from_secs(6); /// This snapshot is to be used for verifying a child of `self.beacon_block`. -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct PreProcessingSnapshot { /// This state is equivalent to the `self.beacon_block.state_root()` state that has been /// advanced forward one slot using `per_slot_processing`. This state is "primed and ready" for diff --git a/beacon_node/execution_layer/src/engine_api.rs b/beacon_node/execution_layer/src/engine_api.rs index 8dd7992751..e11ba52a85 100644 --- a/beacon_node/execution_layer/src/engine_api.rs +++ b/beacon_node/execution_layer/src/engine_api.rs @@ -166,9 +166,3 @@ pub struct ProposeBlindedBlockResponse { pub latest_valid_hash: Option, pub validation_error: Option, } - -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct BlobDetailsV1 { - kzg: KzgCommitment, - blob: Vec, -} diff --git a/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs b/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs index f88721a81d..c00ff64004 100644 --- a/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs +++ b/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs @@ -410,7 +410,7 @@ fn context_bytes( // NOTE: If you are adding another fork type here, be sure to modify the // `fork_context.to_context_bytes()` function to support it as well! SignedBeaconBlock::Eip4844 { .. } => { - // Merge context being `None` implies that "merge never happened". + // Eip4844 context being `None` implies that "merge never happened". fork_context.to_context_bytes(ForkName::Eip4844) } SignedBeaconBlock::Merge { .. } => { diff --git a/beacon_node/lighthouse_network/src/rpc/protocol.rs b/beacon_node/lighthouse_network/src/rpc/protocol.rs index 23a142a7ef..c0c8e83eaa 100644 --- a/beacon_node/lighthouse_network/src/rpc/protocol.rs +++ b/beacon_node/lighthouse_network/src/rpc/protocol.rs @@ -475,7 +475,7 @@ impl InboundRequest { ProtocolId::new(Protocol::BlocksByRoot, Version::V1, Encoding::SSZSnappy), ], InboundRequest::BlobsByRange(_) => vec![ProtocolId::new( - Protocol::BlocksByRoot, + Protocol::BlobsByRange, Version::V1, Encoding::SSZSnappy, )], diff --git a/beacon_node/lighthouse_network/src/rpc/rate_limiter.rs b/beacon_node/lighthouse_network/src/rpc/rate_limiter.rs index 62a81f3e23..6aa91aab6b 100644 --- a/beacon_node/lighthouse_network/src/rpc/rate_limiter.rs +++ b/beacon_node/lighthouse_network/src/rpc/rate_limiter.rs @@ -100,7 +100,7 @@ pub struct RPCRateLimiterBuilder { bbrange_quota: Option, /// Quota for the BlocksByRoot protocol. bbroots_quota: Option, - /// Quota for the BlocksByRange protocol. + /// Quota for the BlobsByRange protocol. blbrange_quota: Option, } diff --git a/beacon_node/lighthouse_network/src/service/api_types.rs b/beacon_node/lighthouse_network/src/service/api_types.rs index 57f2074b4b..46af7ddb22 100644 --- a/beacon_node/lighthouse_network/src/service/api_types.rs +++ b/beacon_node/lighthouse_network/src/service/api_types.rs @@ -33,7 +33,7 @@ pub enum Request { Status(StatusMessage), /// A blocks by range request. BlocksByRange(BlocksByRangeRequest), - /// A bloibs by range request. + /// A blobs by range request. BlobsByRange(BlobsByRangeRequest), /// A request blocks root request. BlocksByRoot(BlocksByRootRequest), diff --git a/beacon_node/lighthouse_network/src/types/pubsub.rs b/beacon_node/lighthouse_network/src/types/pubsub.rs index 12cb0bf69e..781ac9a12c 100644 --- a/beacon_node/lighthouse_network/src/types/pubsub.rs +++ b/beacon_node/lighthouse_network/src/types/pubsub.rs @@ -175,10 +175,6 @@ impl PubsubMessage { SignedBeaconBlockEip4844::from_ssz_bytes(data) .map_err(|e| format!("{:?}", e))?, ), - Some(ForkName::Eip4844) => SignedBeaconBlock::::Eip4844( - SignedBeaconBlockEip4844::from_ssz_bytes(data) - .map_err(|e| format!("{:?}", e))?, - ), None => { return Err(format!( "Unknown gossipsub fork digest: {:?}", diff --git a/beacon_node/network/src/beacon_processor/mod.rs b/beacon_node/network/src/beacon_processor/mod.rs index 97e18acc39..9d42db4495 100644 --- a/beacon_node/network/src/beacon_processor/mod.rs +++ b/beacon_node/network/src/beacon_processor/mod.rs @@ -157,7 +157,7 @@ const MAX_STATUS_QUEUE_LEN: usize = 1_024; /// will be stored before we start dropping them. const MAX_BLOCKS_BY_RANGE_QUEUE_LEN: usize = 1_024; -const MAX_TX_BLOBS_BY_RANGE_QUEUE_LEN: usize = 1_024; +const MAX_BLOBS_BY_RANGE_QUEUE_LEN: usize = 1_024; /// The maximum number of queued `BlocksByRootRequest` objects received from the network RPC that /// will be stored before we start dropping them. @@ -951,14 +951,13 @@ impl BeaconProcessor { let mut chain_segment_queue = FifoQueue::new(MAX_CHAIN_SEGMENT_QUEUE_LEN); let mut backfill_chain_segment = FifoQueue::new(MAX_CHAIN_SEGMENT_QUEUE_LEN); let mut gossip_block_queue = FifoQueue::new(MAX_GOSSIP_BLOCK_QUEUE_LEN); - let mut gossip_blobs_sidecar_queue = FifoQueue::new(MAX_GOSSIP_BLOCK_QUEUE_LEN); + let mut gossip_blobs_sidecar_queue = FifoQueue::new(MAX_GOSSIP_BLOB_QUEUE_LEN); let mut delayed_block_queue = FifoQueue::new(MAX_DELAYED_BLOCK_QUEUE_LEN); let mut status_queue = FifoQueue::new(MAX_STATUS_QUEUE_LEN); let mut bbrange_queue = FifoQueue::new(MAX_BLOCKS_BY_RANGE_QUEUE_LEN); - let mut txbbrange_queue = FifoQueue::new(MAX_TX_BLOBS_BY_RANGE_QUEUE_LEN); let mut bbroots_queue = FifoQueue::new(MAX_BLOCKS_BY_ROOTS_QUEUE_LEN); - let mut blbrange_queue = FifoQueue::new(MAX_BLOCKS_BY_ROOTS_QUEUE_LEN); + let mut blbrange_queue = FifoQueue::new(MAX_BLOBS_BY_RANGE_QUEUE_LEN); // Channels for sending work to the re-process scheduler (`work_reprocessing_tx`) and to // receive them back once they are ready (`ready_work_rx`). @@ -1343,9 +1342,8 @@ impl BeaconProcessor { &metrics::BEACON_PROCESSOR_GOSSIP_BLOCK_QUEUE_TOTAL, gossip_block_queue.len() as i64, ); - //FIXME(sean) blob metrics metrics::set_gauge( - &metrics::BEACON_PROCESSOR_RPC_BLOCK_QUEUE_TOTAL, + &metrics::BEACON_PROCESSOR_RPC_BLOB_QUEUE_TOTAL, rpc_block_queue.len() as i64, ); metrics::set_gauge( diff --git a/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs b/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs index 8454d83f2b..e5b0d76dae 100644 --- a/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs +++ b/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs @@ -786,9 +786,6 @@ impl Worker { verified_block } - Err(BlockError::MissingSidecar) => { - todo!(); //is relevant? - } Err(BlockError::ParentUnknown(block)) => { debug!( self.log, diff --git a/beacon_node/network/src/metrics.rs b/beacon_node/network/src/metrics.rs index b4e7a3bace..94de2988c8 100644 --- a/beacon_node/network/src/metrics.rs +++ b/beacon_node/network/src/metrics.rs @@ -152,6 +152,15 @@ lazy_static! { "beacon_processor_rpc_block_imported_total", "Total number of gossip blocks imported to fork choice, etc." ); + // Rpc blobs. + pub static ref BEACON_PROCESSOR_RPC_BLOB_QUEUE_TOTAL: Result = try_create_int_gauge( + "beacon_processor_rpc_blob_queue_total", + "Count of blobs from the rpc waiting to be verified." + ); + pub static ref BEACON_PROCESSOR_RPC_BLOB_IMPORTED_TOTAL: Result = try_create_int_counter( + "beacon_processor_rpc_blob_imported_total", + "Total number of gossip blobs imported." + ); // Chain segments. pub static ref BEACON_PROCESSOR_CHAIN_SEGMENT_QUEUE_TOTAL: Result = try_create_int_gauge( "beacon_processor_chain_segment_queue_total", diff --git a/beacon_node/store/src/config.rs b/beacon_node/store/src/config.rs index 1422216876..53d99f75eb 100644 --- a/beacon_node/store/src/config.rs +++ b/beacon_node/store/src/config.rs @@ -18,7 +18,7 @@ pub struct StoreConfig { pub slots_per_restore_point_set_explicitly: bool, /// Maximum number of blocks to store in the in-memory block cache. pub block_cache_size: usize, - /// Maximum number of blobs to store in the in-memory block cache. + /// Maximum number of blobs to store in the in-memory blob cache. pub blob_cache_size: usize, /// Whether to compact the database on initialization. pub compact_on_init: bool, diff --git a/beacon_node/store/src/lib.rs b/beacon_node/store/src/lib.rs index df6e395013..00e37a18ec 100644 --- a/beacon_node/store/src/lib.rs +++ b/beacon_node/store/src/lib.rs @@ -173,7 +173,7 @@ pub enum DBColumn { BeaconMeta, #[strum(serialize = "blk")] BeaconBlock, - #[strum(serialize = "blo")] + #[strum(serialize = "blb")] BeaconBlob, /// For full `BeaconState`s in the hot database (finalized or fork-boundary states). #[strum(serialize = "ste")] diff --git a/consensus/types/src/chain_spec.rs b/consensus/types/src/chain_spec.rs index 9641b2059c..279a449e53 100644 --- a/consensus/types/src/chain_spec.rs +++ b/consensus/types/src/chain_spec.rs @@ -22,8 +22,7 @@ pub enum Domain { ContributionAndProof, SyncCommitteeSelectionProof, ApplicationMask(ApplicationDomain), - //FIXME(sean) add this domain - //BlobsSideCar, + BlobsSideCar, } /// Lighthouse's internal configuration struct. @@ -565,7 +564,7 @@ impl ChainSpec { domain_sync_committee: 7, domain_sync_committee_selection_proof: 8, domain_contribution_and_proof: 9, - altair_fork_version: [0x01, 0x00, 0x0f, 0xfd], + altair_fork_version: [0x01, 0x00, 0x00, 0x00], altair_fork_epoch: Some(Epoch::new(74240)), /* @@ -576,7 +575,7 @@ impl ChainSpec { min_slashing_penalty_quotient_bellatrix: u64::checked_pow(2, 5) .expect("pow does not overflow"), proportional_slashing_multiplier_bellatrix: 3, - bellatrix_fork_version: [0x02, 0x00, 0x0f, 0xfd], + bellatrix_fork_version: [0x02, 0x00, 0x00, 0x00], bellatrix_fork_epoch: Some(Epoch::new(144896)), terminal_total_difficulty: Uint256::from_dec_str("58750000000000000000000") .expect("terminal_total_difficulty is a valid integer"), @@ -587,8 +586,8 @@ impl ChainSpec { /* * Eip4844 hard fork params */ - eip4844_fork_version: [0x04, 0x00, 0x00, 0xfd], - eip4844_fork_epoch: Some(Epoch::new(u64::MAX)), + eip4844_fork_version: [0x04, 0x00, 0x00, 0x00], + eip4844_fork_epoch: None, /* * Network specific @@ -646,8 +645,7 @@ impl ChainSpec { .checked_add(Uint256::one()) .expect("addition does not overflow"), // Eip4844 - //FIXME(sean) - eip4844_fork_version: [0x03, 0x00, 0x00, 0x01], + eip4844_fork_version: [0x04, 0x00, 0x00, 0x01], eip4844_fork_epoch: None, // Other network_id: 2, // lighthouse testnet network id @@ -805,7 +803,7 @@ impl ChainSpec { safe_slots_to_import_optimistically: 128u64, eip4844_fork_version: [0x04, 0x00, 0x00, 0x64], - eip4844_fork_epoch: Some(Epoch::new(u64::MAX)), + eip4844_fork_epoch: None, /* * Network specific diff --git a/consensus/types/src/consts.rs b/consensus/types/src/consts.rs index 8e12b05fb5..2469f5f9cf 100644 --- a/consensus/types/src/consts.rs +++ b/consensus/types/src/consts.rs @@ -22,7 +22,7 @@ pub mod altair { pub mod merge { pub const INTERVALS_PER_SLOT: u64 = 3; } -pub mod cappella { +pub mod eip4844 { use crate::Uint256; use lazy_static::lazy_static; diff --git a/consensus/types/src/eth_spec.rs b/consensus/types/src/eth_spec.rs index e67389a384..716754c7e5 100644 --- a/consensus/types/src/eth_spec.rs +++ b/consensus/types/src/eth_spec.rs @@ -275,7 +275,7 @@ impl EthSpec for MainnetEthSpec { type GasLimitDenominator = U1024; type MinGasLimit = U5000; type MaxExtraDataBytes = U32; - type MaxBlobsPerBlock = U16777216; // 2**24 + type MaxBlobsPerBlock = U16; // 2**4 = 16 type FieldElementsPerBlob = U4096; type SyncSubcommitteeSize = U128; // 512 committee size / 4 sync committee subnet count type MaxPendingAttestations = U4096; // 128 max attestations * 32 slots per epoch @@ -371,7 +371,7 @@ impl EthSpec for GnosisEthSpec { type SyncSubcommitteeSize = U128; // 512 committee size / 4 sync committee subnet count type MaxPendingAttestations = U2048; // 128 max attestations * 16 slots per epoch type SlotsPerEth1VotingPeriod = U1024; // 64 epochs * 16 slots per epoch - type MaxBlobsPerBlock = U16777216; // 2**24 + type MaxBlobsPerBlock = U16; // 2**4 = 16 type FieldElementsPerBlob = U4096; fn default_spec() -> ChainSpec {