Skip to content

Commit 6f2a3c6

Browse files
ethDreamerpaulhauner
authored andcommitted
Removed PowBlock struct that never got used (#2813)
1 parent fbbea17 commit 6f2a3c6

File tree

7 files changed

+179
-137
lines changed

7 files changed

+179
-137
lines changed

Cargo.lock

Lines changed: 144 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

beacon_node/beacon_chain/src/eth1_chain.rs

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use std::time::{SystemTime, UNIX_EPOCH};
1515
use store::{DBColumn, Error as StoreError, StoreItem};
1616
use task_executor::TaskExecutor;
1717
use types::{
18-
BeaconState, BeaconStateError, ChainSpec, Deposit, Eth1Data, EthSpec, ExecutionPayload,
19-
Hash256, Slot, Unsigned, DEPOSIT_TREE_DEPTH,
18+
BeaconState, BeaconStateError, ChainSpec, Deposit, Eth1Data, EthSpec, Hash256, Slot, Unsigned,
19+
DEPOSIT_TREE_DEPTH,
2020
};
2121

2222
type BlockNumber = u64;
@@ -53,8 +53,6 @@ pub enum Error {
5353
UnknownPreviousEth1BlockHash,
5454
/// An arithmetic error occurred.
5555
ArithError(safe_arith::ArithError),
56-
/// Unable to execute payload
57-
UnableToExecutePayload(String),
5856
}
5957

6058
impl From<safe_arith::ArithError> for Error {
@@ -281,15 +279,6 @@ where
281279
)
282280
}
283281

284-
pub fn on_payload(&self, execution_payload: &ExecutionPayload<E>) -> Result<bool, Error> {
285-
if self.use_dummy_backend {
286-
let dummy_backend: DummyEth1ChainBackend<E> = DummyEth1ChainBackend::default();
287-
dummy_backend.on_payload(execution_payload)
288-
} else {
289-
self.backend.on_payload(execution_payload)
290-
}
291-
}
292-
293282
/// Instantiate `Eth1Chain` from a persisted `SszEth1`.
294283
///
295284
/// The `Eth1Chain` will have the same caches as the persisted `SszEth1`.
@@ -350,9 +339,6 @@ pub trait Eth1ChainBackend<T: EthSpec>: Sized + Send + Sync {
350339
/// an idea of how up-to-date the remote eth1 node is.
351340
fn head_block(&self) -> Option<Eth1Block>;
352341

353-
/// Verifies the execution payload
354-
fn on_payload(&self, execution_payload: &ExecutionPayload<T>) -> Result<bool, Error>;
355-
356342
/// Encode the `Eth1ChainBackend` instance to bytes.
357343
fn as_bytes(&self) -> Vec<u8>;
358344

@@ -407,10 +393,6 @@ impl<T: EthSpec> Eth1ChainBackend<T> for DummyEth1ChainBackend<T> {
407393
None
408394
}
409395

410-
fn on_payload(&self, _execution_payload: &ExecutionPayload<T>) -> Result<bool, Error> {
411-
Ok(true)
412-
}
413-
414396
/// Return empty Vec<u8> for dummy backend.
415397
fn as_bytes(&self) -> Vec<u8> {
416398
Vec::new()
@@ -579,15 +561,6 @@ impl<T: EthSpec> Eth1ChainBackend<T> for CachingEth1Backend<T> {
579561
self.core.head_block()
580562
}
581563

582-
fn on_payload(&self, execution_payload: &ExecutionPayload<T>) -> Result<bool, Error> {
583-
futures::executor::block_on(async move {
584-
self.core
585-
.on_payload(execution_payload.clone())
586-
.await
587-
.map_err(|e| Error::UnableToExecutePayload(format!("{:?}", e)))
588-
})
589-
}
590-
591564
/// Return encoded byte representation of the block and deposit caches.
592565
fn as_bytes(&self) -> Vec<u8> {
593566
self.core.as_bytes()

0 commit comments

Comments
 (0)