cargo fmt

This commit is contained in:
realbigsean
2023-07-14 17:29:41 -04:00
parent b19883e63b
commit e3ee0c6cce
17 changed files with 83 additions and 84 deletions

View File

@@ -1161,12 +1161,8 @@ impl<T: BeaconChainTypes> IntoExecutionPendingBlock<T> for Arc<SignedBeaconBlock
BlockError::AvailabilityCheck(e),
)
})?;
SignatureVerifiedBlock::check_slashable(
maybe_available,
block_root,
chain,
)?
.into_execution_pending_block_slashable(block_root, chain, notify_execution_layer)
SignatureVerifiedBlock::check_slashable(maybe_available, block_root, chain)?
.into_execution_pending_block_slashable(block_root, chain, notify_execution_layer)
}
fn block(&self) -> &SignedBeaconBlock<T::EthSpec> {

View File

@@ -1,6 +1,7 @@
use crate::blob_verification::GossipVerifiedBlobList;
use crate::data_availability_checker::AvailabilityCheckError;
pub use crate::data_availability_checker::{AvailableBlock, MaybeAvailableBlock};
use crate::eth1_finalization_cache::Eth1FinalizationData;
use crate::{data_availability_checker, GossipVerifiedBlock, PayloadVerificationOutcome};
use derivative::Derivative;
use ssz_derive::{Decode, Encode};
@@ -14,7 +15,6 @@ use types::{
BeaconBlockRef, BeaconState, BlindedPayload, BlobSidecarList, Epoch, EthSpec, Hash256,
SignedBeaconBlock, SignedBeaconBlockHeader, Slot,
};
use crate::eth1_finalization_cache::Eth1FinalizationData;
#[derive(Debug, Clone, Derivative)]
#[derivative(Hash(bound = "E: EthSpec"))]
@@ -44,7 +44,7 @@ impl<E: EthSpec> RpcBlock<E> {
blobs: Option<BlobSidecarList<E>>,
) -> Result<Self, AvailabilityCheckError> {
if let Some(blobs) = blobs.as_ref() {
data_availability_checker::consistency_checks( &block, blobs)?;
data_availability_checker::consistency_checks(&block, blobs)?;
}
let inner = match blobs {
Some(blobs) => RpcBlockInner::BlockAndBlobs(block, blobs),
@@ -401,4 +401,4 @@ impl<E: EthSpec> AsBlock<E> for RpcBlock<E> {
fn into_rpc_block(self) -> RpcBlock<E> {
self
}
}
}

View File

@@ -317,7 +317,7 @@ pub fn make_available<T: EthSpec>(
) -> Result<AvailableBlock<T>, AvailabilityCheckError> {
let blobs = VariableList::new(blobs.into_iter().map(|blob| blob.to_blob()).collect())?;
consistency_checks( &block, &blobs)?;
consistency_checks(&block, &blobs)?;
Ok(AvailableBlock {
block,
@@ -347,7 +347,10 @@ pub fn consistency_checks<T: EthSpec>(
return Ok(());
}
let block_root = blobs.first().map(|blob|blob.block_root).unwrap_or(block.canonical_root());
let block_root = blobs
.first()
.map(|blob| blob.block_root)
.unwrap_or(block.canonical_root());
for (index, (block_commitment, blob)) in
block_kzg_commitments.iter().zip(blobs.iter()).enumerate()
{

View File

@@ -540,8 +540,7 @@ impl<T: BeaconChainTypes> OverflowLRUCache<T> {
import_data,
payload_verification_outcome,
} = executed_block;
let available_block =
make_available(block, vec![])?;
let available_block = make_available(block, vec![])?;
return Ok(Availability::Available(Box::new(
AvailableExecutedBlock::new(
available_block,
@@ -591,8 +590,7 @@ impl<T: BeaconChainTypes> OverflowLRUCache<T> {
return Ok(Availability::MissingComponents(import_data.block_root))
};
let available_block =
make_available(block, verified_blobs)?;
let available_block = make_available(block, verified_blobs)?;
Ok(Availability::Available(Box::new(
AvailableExecutedBlock::new(
available_block,

View File

@@ -700,7 +700,7 @@ where
let block = self.chain.get_blinded_block(block_root).unwrap().unwrap();
let full_block = self.chain.store.make_full_block(block_root, block).unwrap();
let blobs = self.chain.get_blobs(block_root).unwrap();
RpcBlock::new( Arc::new(full_block), blobs).unwrap()
RpcBlock::new(Arc::new(full_block), blobs).unwrap()
}
pub fn get_all_validators(&self) -> Vec<usize> {
@@ -1985,11 +1985,7 @@ where
.process_block(
slot,
block.canonical_root(),
RpcBlock::new(
Arc::new(block.clone()),
blobs_without_signatures.clone(),
)
.unwrap(),
RpcBlock::new(Arc::new(block.clone()), blobs_without_signatures.clone()).unwrap(),
)
.await?;
Ok((block_hash, (block, blobs), new_state))