Removed PowBlock struct that never got used (#2813)

This commit is contained in:
ethDreamer
2021-11-16 23:51:11 -06:00
committed by Paul Hauner
parent 5f0fef2d1e
commit f6748537db
6 changed files with 35 additions and 129 deletions

View File

@@ -21,7 +21,7 @@ use std::sync::Arc;
use std::time::{SystemTime, UNIX_EPOCH};
use tokio::sync::RwLock as TRwLock;
use tokio::time::{interval_at, Duration, Instant};
use types::{ChainSpec, EthSpec, ExecutionPayload, Unsigned};
use types::{ChainSpec, EthSpec, Unsigned};
/// Indicates the default eth1 network id we use for the deposit contract.
pub const DEFAULT_NETWORK_ID: Eth1Id = Eth1Id::Goerli;
@@ -331,8 +331,6 @@ pub enum SingleEndpointError {
GetDepositCountFailed(String),
/// Failed to read the deposit contract root from the eth1 node.
GetDepositLogsFailed(String),
/// Failed to run engine_ExecutePayload
EngineExecutePayloadFailed,
}
#[derive(Debug, PartialEq)]
@@ -671,21 +669,6 @@ impl Service {
}
}
/// This is were we call out to engine_executePayload to determine if payload is valid
pub async fn on_payload<T: EthSpec>(
&self,
_execution_payload: ExecutionPayload<T>,
) -> Result<bool, Error> {
let endpoints = self.init_endpoints();
// TODO: call engine_executePayload and figure out how backup endpoint works..
endpoints
.first_success(|_e| async move { Ok(true) })
.await
.map(|(res, _)| res)
.map_err(Error::FallbackError)
}
/// Update the deposit and block cache, returning an error if either fail.
///
/// ## Returns
@@ -1259,7 +1242,7 @@ async fn download_eth1_block(
});
// Performs a `get_blockByNumber` call to an eth1 node.
let pow_block = get_block(
let http_block = get_block(
endpoint,
block_number_opt
.map(BlockQuery::Number)
@@ -1270,9 +1253,9 @@ async fn download_eth1_block(
.await?;
Ok(Eth1Block {
hash: pow_block.block_hash,
number: pow_block.block_number,
timestamp: pow_block.timestamp,
hash: http_block.hash,
number: http_block.number,
timestamp: http_block.timestamp,
deposit_root,
deposit_count,
})