From 7520651515dd65da45464dfb3d6fbcb3fea11db7 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Tue, 5 Apr 2022 17:02:54 -0400 Subject: [PATCH] cargo fix and some test fixes --- beacon_node/beacon_chain/src/beacon_chain.rs | 2 +- beacon_node/beacon_chain/src/execution_payload.rs | 6 +++--- beacon_node/execution_layer/src/engine_api.rs | 2 +- beacon_node/execution_layer/src/lib.rs | 12 ++++++------ .../lighthouse_network/src/rpc/codec/base.rs | 3 +++ .../lighthouse_network/src/rpc/codec/ssz_snappy.rs | 3 +++ beacon_node/lighthouse_network/tests/common/mod.rs | 3 +++ beacon_node/network/src/beacon_processor/mod.rs | 2 +- .../src/beacon_processor/worker/gossip_methods.rs | 14 +++++++------- .../src/beacon_processor/worker/rpc_methods.rs | 6 +++--- beacon_node/network/src/sync/manager.rs | 2 +- consensus/types/src/signed_blobs_sidecar.rs | 3 +-- 12 files changed, 33 insertions(+), 25 deletions(-) diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index 9f536254a..ad2cd9ca6 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -3622,7 +3622,7 @@ impl BeaconChain { }), BeaconState::Capella(_) => { let sync_aggregate = get_sync_aggregate()?; - let (execution_payload, blobs) = + let (execution_payload, _blobs) = get_execution_payload_and_blobs(self, &state, proposer_index)?; //FIXME(sean) get blobs BeaconBlock::Capella(BeaconBlockCapella { diff --git a/beacon_node/beacon_chain/src/execution_payload.rs b/beacon_node/beacon_chain/src/execution_payload.rs index 022cfc361..7b84d4f8f 100644 --- a/beacon_node/beacon_chain/src/execution_payload.rs +++ b/beacon_node/beacon_chain/src/execution_payload.rs @@ -520,9 +520,9 @@ pub async fn prepare_execution_payload_and_blobs< T: BeaconChainTypes, Payload: ExecPayload, >( - chain: &BeaconChain, - state: &BeaconState, - proposer_index: u64, + _chain: &BeaconChain, + _state: &BeaconState, + _proposer_index: u64, ) -> Result< Option<( Payload, diff --git a/beacon_node/execution_layer/src/engine_api.rs b/beacon_node/execution_layer/src/engine_api.rs index 361953beb..9c94a666e 100644 --- a/beacon_node/execution_layer/src/engine_api.rs +++ b/beacon_node/execution_layer/src/engine_api.rs @@ -9,7 +9,7 @@ pub use types::{ Address, EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadHeader, FixedVector, Hash256, Uint256, VariableList, }; -use types::{Blob, KZGCommitment}; +use types::{KZGCommitment}; pub mod auth; pub mod http; diff --git a/beacon_node/execution_layer/src/lib.rs b/beacon_node/execution_layer/src/lib.rs index 50ea35d76..b28d08fa6 100644 --- a/beacon_node/execution_layer/src/lib.rs +++ b/beacon_node/execution_layer/src/lib.rs @@ -890,12 +890,12 @@ impl ExecutionLayer { pub async fn get_blob( &self, - parent_hash: Hash256, - timestamp: u64, - random: Hash256, - finalized_block_hash: Hash256, - proposer_index: u64, - versioned_hash: Hash256, + _parent_hash: Hash256, + _timestamp: u64, + _random: Hash256, + _finalized_block_hash: Hash256, + _proposer_index: u64, + _versioned_hash: Hash256, ) -> Result { todo!() } diff --git a/beacon_node/lighthouse_network/src/rpc/codec/base.rs b/beacon_node/lighthouse_network/src/rpc/codec/base.rs index 53f85d9a7..6c6ce2da3 100644 --- a/beacon_node/lighthouse_network/src/rpc/codec/base.rs +++ b/beacon_node/lighthouse_network/src/rpc/codec/base.rs @@ -193,14 +193,17 @@ mod tests { let mut chain_spec = Spec::default_spec(); let altair_fork_epoch = Epoch::new(1); let merge_fork_epoch = Epoch::new(2); + let capella_fork_epoch = Epoch::new(3); chain_spec.altair_fork_epoch = Some(altair_fork_epoch); chain_spec.bellatrix_fork_epoch = Some(merge_fork_epoch); + chain_spec.capella_fork_epoch = Some(capella_fork_epoch); let current_slot = match fork_name { ForkName::Base => Slot::new(0), ForkName::Altair => altair_fork_epoch.start_slot(Spec::slots_per_epoch()), ForkName::Merge => merge_fork_epoch.start_slot(Spec::slots_per_epoch()), + ForkName::Capella => capella_fork_epoch.start_slot(Spec::slots_per_epoch()), }; ForkContext::new::(current_slot, Hash256::zero(), &chain_spec) } 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 58bd9786e..013273328 100644 --- a/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs +++ b/beacon_node/lighthouse_network/src/rpc/codec/ssz_snappy.rs @@ -677,14 +677,17 @@ mod tests { let mut chain_spec = Spec::default_spec(); let altair_fork_epoch = Epoch::new(1); let merge_fork_epoch = Epoch::new(2); + let capella_fork_epoch = Epoch::new(3); chain_spec.altair_fork_epoch = Some(altair_fork_epoch); chain_spec.bellatrix_fork_epoch = Some(merge_fork_epoch); + chain_spec.capella_fork_epoch = Some(capella_fork_epoch); let current_slot = match fork_name { ForkName::Base => Slot::new(0), ForkName::Altair => altair_fork_epoch.start_slot(Spec::slots_per_epoch()), ForkName::Merge => merge_fork_epoch.start_slot(Spec::slots_per_epoch()), + ForkName::Capella => capella_fork_epoch.start_slot(Spec::slots_per_epoch()), }; ForkContext::new::(current_slot, Hash256::zero(), &chain_spec) } diff --git a/beacon_node/lighthouse_network/tests/common/mod.rs b/beacon_node/lighthouse_network/tests/common/mod.rs index a3c32d0fb..c367f5f02 100644 --- a/beacon_node/lighthouse_network/tests/common/mod.rs +++ b/beacon_node/lighthouse_network/tests/common/mod.rs @@ -32,14 +32,17 @@ pub fn fork_context(fork_name: ForkName) -> ForkContext { let mut chain_spec = E::default_spec(); let altair_fork_epoch = Epoch::new(1); let merge_fork_epoch = Epoch::new(2); + let capella_fork_epoch = Epoch::new(3); chain_spec.altair_fork_epoch = Some(altair_fork_epoch); chain_spec.bellatrix_fork_epoch = Some(merge_fork_epoch); + chain_spec.capella_fork_epoch = Some(capella_fork_epoch); let current_slot = match fork_name { ForkName::Base => Slot::new(0), ForkName::Altair => altair_fork_epoch.start_slot(E::slots_per_epoch()), ForkName::Merge => merge_fork_epoch.start_slot(E::slots_per_epoch()), + ForkName::Capella => capella_fork_epoch.start_slot(E::slots_per_epoch()), }; ForkContext::new::(current_slot, Hash256::zero(), &chain_spec) } diff --git a/beacon_node/network/src/beacon_processor/mod.rs b/beacon_node/network/src/beacon_processor/mod.rs index 496142f9a..e4202d447 100644 --- a/beacon_node/network/src/beacon_processor/mod.rs +++ b/beacon_node/network/src/beacon_processor/mod.rs @@ -60,7 +60,7 @@ use std::task::Context; use std::time::Duration; use std::{cmp, collections::HashSet}; use task_executor::TaskExecutor; -use tokio::sync::{mpsc, oneshot}; +use tokio::sync::{mpsc}; use types::{ Attestation, AttesterSlashing, BlobsSidecar, Hash256, ProposerSlashing, SignedAggregateAndProof, SignedBeaconBlock, SignedContributionAndProof, SignedVoluntaryExit, 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 e78da09ca..b257862a1 100644 --- a/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs +++ b/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs @@ -695,13 +695,13 @@ impl Worker { #[allow(clippy::too_many_arguments)] pub fn process_gossip_blob( self, - message_id: MessageId, - peer_id: PeerId, - peer_client: Client, - blob: BlobsSidecar, - reprocess_tx: mpsc::Sender>, - duplicate_cache: DuplicateCache, - seen_duration: Duration, + _message_id: MessageId, + _peer_id: PeerId, + _peer_client: Client, + _blob: BlobsSidecar, + _reprocess_tx: mpsc::Sender>, + _duplicate_cache: DuplicateCache, + _seen_duration: Duration, ) { //FIXME(sean) } diff --git a/beacon_node/network/src/beacon_processor/worker/rpc_methods.rs b/beacon_node/network/src/beacon_processor/worker/rpc_methods.rs index d480004f5..d7a21e49b 100644 --- a/beacon_node/network/src/beacon_processor/worker/rpc_methods.rs +++ b/beacon_node/network/src/beacon_processor/worker/rpc_methods.rs @@ -125,9 +125,9 @@ impl Worker { pub fn handle_tx_blobs_by_range_request( &self, - peer_id: PeerId, - request_id: PeerRequestId, - mut req: TxBlobsByRangeRequest, + _peer_id: PeerId, + _request_id: PeerRequestId, + _req: TxBlobsByRangeRequest, ) { //FIXME(sean) } diff --git a/beacon_node/network/src/sync/manager.rs b/beacon_node/network/src/sync/manager.rs index 1451ffb07..15b5d2421 100644 --- a/beacon_node/network/src/sync/manager.rs +++ b/beacon_node/network/src/sync/manager.rs @@ -53,7 +53,7 @@ use std::ops::Sub; use std::sync::Arc; use std::time::Duration; use tokio::sync::mpsc; -use types::{BlobsSidecar, Epoch, EthSpec, Hash256, SignedBeaconBlock, Slot}; +use types::{BlobsSidecar, EthSpec, Hash256, SignedBeaconBlock, Slot}; /// The number of slots ahead of us that is allowed before requesting a long-range (batch) Sync /// from a peer. If a peer is within this tolerance (forwards or backwards), it is treated as a diff --git a/consensus/types/src/signed_blobs_sidecar.rs b/consensus/types/src/signed_blobs_sidecar.rs index f5f60e2bd..3e1ee6df8 100644 --- a/consensus/types/src/signed_blobs_sidecar.rs +++ b/consensus/types/src/signed_blobs_sidecar.rs @@ -1,9 +1,8 @@ -use crate::{Blob, BlobsSidecar, EthSpec, Hash256, Slot}; +use crate::{BlobsSidecar, EthSpec}; use bls::Signature; use serde_derive::{Deserialize, Serialize}; use ssz::Encode; use ssz_derive::{Decode, Encode}; -use ssz_types::VariableList; use tree_hash::TreeHash; use tree_hash_derive::TreeHash;