cargo fix and some test fixes
This commit is contained in:
parent
fe6fc55449
commit
7520651515
@ -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 {
|
||||||
|
@ -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,
|
||||||
|
@ -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;
|
||||||
|
@ -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!()
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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,
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user