cargo fix and some test fixes

This commit is contained in:
realbigsean 2022-04-05 17:02:54 -04:00
parent fe6fc55449
commit 7520651515
No known key found for this signature in database
GPG Key ID: B372B64D866BF8CC
12 changed files with 33 additions and 25 deletions

View File

@ -3622,7 +3622,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
}), }),
BeaconState::Capella(_) => { BeaconState::Capella(_) => {
let sync_aggregate = get_sync_aggregate()?; let sync_aggregate = get_sync_aggregate()?;
let (execution_payload, blobs) = let (execution_payload, _blobs) =
get_execution_payload_and_blobs(self, &state, proposer_index)?; get_execution_payload_and_blobs(self, &state, proposer_index)?;
//FIXME(sean) get blobs //FIXME(sean) get blobs
BeaconBlock::Capella(BeaconBlockCapella { BeaconBlock::Capella(BeaconBlockCapella {

View File

@ -520,9 +520,9 @@ pub async fn prepare_execution_payload_and_blobs<
T: BeaconChainTypes, T: BeaconChainTypes,
Payload: ExecPayload<T::EthSpec>, Payload: ExecPayload<T::EthSpec>,
>( >(
chain: &BeaconChain<T>, _chain: &BeaconChain<T>,
state: &BeaconState<T::EthSpec>, _state: &BeaconState<T::EthSpec>,
proposer_index: u64, _proposer_index: u64,
) -> Result< ) -> Result<
Option<( Option<(
Payload, Payload,

View File

@ -9,7 +9,7 @@ pub use types::{
Address, EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadHeader, FixedVector, Address, EthSpec, ExecutionBlockHash, ExecutionPayload, ExecutionPayloadHeader, FixedVector,
Hash256, Uint256, VariableList, Hash256, Uint256, VariableList,
}; };
use types::{Blob, KZGCommitment}; use types::{KZGCommitment};
pub mod auth; pub mod auth;
pub mod http; pub mod http;

View File

@ -890,12 +890,12 @@ impl<T: EthSpec> ExecutionLayer<T> {
pub async fn get_blob<T: EthSpec>( pub async fn get_blob<T: EthSpec>(
&self, &self,
parent_hash: Hash256, _parent_hash: Hash256,
timestamp: u64, _timestamp: u64,
random: Hash256, _random: Hash256,
finalized_block_hash: Hash256, _finalized_block_hash: Hash256,
proposer_index: u64, _proposer_index: u64,
versioned_hash: Hash256, _versioned_hash: Hash256,
) -> Result<BlobDetailsV1, Error> { ) -> Result<BlobDetailsV1, Error> {
todo!() todo!()
} }

View File

@ -193,14 +193,17 @@ mod tests {
let mut chain_spec = Spec::default_spec(); let mut chain_spec = Spec::default_spec();
let altair_fork_epoch = Epoch::new(1); let altair_fork_epoch = Epoch::new(1);
let merge_fork_epoch = Epoch::new(2); 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.altair_fork_epoch = Some(altair_fork_epoch);
chain_spec.bellatrix_fork_epoch = Some(merge_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 { let current_slot = match fork_name {
ForkName::Base => Slot::new(0), ForkName::Base => Slot::new(0),
ForkName::Altair => altair_fork_epoch.start_slot(Spec::slots_per_epoch()), ForkName::Altair => altair_fork_epoch.start_slot(Spec::slots_per_epoch()),
ForkName::Merge => merge_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::<Spec>(current_slot, Hash256::zero(), &chain_spec) ForkContext::new::<Spec>(current_slot, Hash256::zero(), &chain_spec)
} }

View File

@ -677,14 +677,17 @@ mod tests {
let mut chain_spec = Spec::default_spec(); let mut chain_spec = Spec::default_spec();
let altair_fork_epoch = Epoch::new(1); let altair_fork_epoch = Epoch::new(1);
let merge_fork_epoch = Epoch::new(2); 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.altair_fork_epoch = Some(altair_fork_epoch);
chain_spec.bellatrix_fork_epoch = Some(merge_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 { let current_slot = match fork_name {
ForkName::Base => Slot::new(0), ForkName::Base => Slot::new(0),
ForkName::Altair => altair_fork_epoch.start_slot(Spec::slots_per_epoch()), ForkName::Altair => altair_fork_epoch.start_slot(Spec::slots_per_epoch()),
ForkName::Merge => merge_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::<Spec>(current_slot, Hash256::zero(), &chain_spec) ForkContext::new::<Spec>(current_slot, Hash256::zero(), &chain_spec)
} }

View File

@ -32,14 +32,17 @@ pub fn fork_context(fork_name: ForkName) -> ForkContext {
let mut chain_spec = E::default_spec(); let mut chain_spec = E::default_spec();
let altair_fork_epoch = Epoch::new(1); let altair_fork_epoch = Epoch::new(1);
let merge_fork_epoch = Epoch::new(2); 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.altair_fork_epoch = Some(altair_fork_epoch);
chain_spec.bellatrix_fork_epoch = Some(merge_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 { let current_slot = match fork_name {
ForkName::Base => Slot::new(0), ForkName::Base => Slot::new(0),
ForkName::Altair => altair_fork_epoch.start_slot(E::slots_per_epoch()), ForkName::Altair => altair_fork_epoch.start_slot(E::slots_per_epoch()),
ForkName::Merge => merge_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::<E>(current_slot, Hash256::zero(), &chain_spec) ForkContext::new::<E>(current_slot, Hash256::zero(), &chain_spec)
} }

View File

@ -60,7 +60,7 @@ use std::task::Context;
use std::time::Duration; use std::time::Duration;
use std::{cmp, collections::HashSet}; use std::{cmp, collections::HashSet};
use task_executor::TaskExecutor; use task_executor::TaskExecutor;
use tokio::sync::{mpsc, oneshot}; use tokio::sync::{mpsc};
use types::{ use types::{
Attestation, AttesterSlashing, BlobsSidecar, Hash256, ProposerSlashing, Attestation, AttesterSlashing, BlobsSidecar, Hash256, ProposerSlashing,
SignedAggregateAndProof, SignedBeaconBlock, SignedContributionAndProof, SignedVoluntaryExit, SignedAggregateAndProof, SignedBeaconBlock, SignedContributionAndProof, SignedVoluntaryExit,

View File

@ -695,13 +695,13 @@ impl<T: BeaconChainTypes> Worker<T> {
#[allow(clippy::too_many_arguments)] #[allow(clippy::too_many_arguments)]
pub fn process_gossip_blob( pub fn process_gossip_blob(
self, self,
message_id: MessageId, _message_id: MessageId,
peer_id: PeerId, _peer_id: PeerId,
peer_client: Client, _peer_client: Client,
blob: BlobsSidecar<T::EthSpec>, _blob: BlobsSidecar<T::EthSpec>,
reprocess_tx: mpsc::Sender<ReprocessQueueMessage<T>>, _reprocess_tx: mpsc::Sender<ReprocessQueueMessage<T>>,
duplicate_cache: DuplicateCache, _duplicate_cache: DuplicateCache,
seen_duration: Duration, _seen_duration: Duration,
) { ) {
//FIXME(sean) //FIXME(sean)
} }

View File

@ -125,9 +125,9 @@ impl<T: BeaconChainTypes> Worker<T> {
pub fn handle_tx_blobs_by_range_request( pub fn handle_tx_blobs_by_range_request(
&self, &self,
peer_id: PeerId, _peer_id: PeerId,
request_id: PeerRequestId, _request_id: PeerRequestId,
mut req: TxBlobsByRangeRequest, _req: TxBlobsByRangeRequest,
) { ) {
//FIXME(sean) //FIXME(sean)
} }

View File

@ -53,7 +53,7 @@ use std::ops::Sub;
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
use tokio::sync::mpsc; 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 /// 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 /// from a peer. If a peer is within this tolerance (forwards or backwards), it is treated as a

View File

@ -1,9 +1,8 @@
use crate::{Blob, BlobsSidecar, EthSpec, Hash256, Slot}; use crate::{BlobsSidecar, EthSpec};
use bls::Signature; use bls::Signature;
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
use ssz::Encode; use ssz::Encode;
use ssz_derive::{Decode, Encode}; use ssz_derive::{Decode, Encode};
use ssz_types::VariableList;
use tree_hash::TreeHash; use tree_hash::TreeHash;
use tree_hash_derive::TreeHash; use tree_hash_derive::TreeHash;