Don't create a execution payload with same timestamp as terminal block (#3331)

## Issue Addressed

Resolves #3316 

## Proposed Changes

This PR fixes an issue where lighthouse created a transition block with `block.execution_payload().timestamp == terminal_block.timestamp` if the terminal block was created at the slot boundary.
This commit is contained in:
Pawan Dhananjay
2022-07-18 23:15:41 +00:00
parent f9b9658711
commit e5e4e62758
9 changed files with 130 additions and 17 deletions

View File

@@ -6,7 +6,7 @@ use crate::engine_api::{
};
use bytes::Bytes;
use environment::null_logger;
use execution_block_generator::{Block, PoWBlock};
use execution_block_generator::PoWBlock;
use handle_rpc::handle_rpc;
use parking_lot::{Mutex, RwLock, RwLockWriteGuard};
use serde::{Deserialize, Serialize};
@@ -21,7 +21,7 @@ use tokio::{runtime, sync::oneshot};
use types::{EthSpec, ExecutionBlockHash, Uint256};
use warp::{http::StatusCode, Filter, Rejection};
pub use execution_block_generator::{generate_pow_block, ExecutionBlockGenerator};
pub use execution_block_generator::{generate_pow_block, Block, ExecutionBlockGenerator};
pub use mock_execution_layer::MockExecutionLayer;
pub const DEFAULT_TERMINAL_DIFFICULTY: u64 = 6400;
@@ -334,6 +334,7 @@ impl<T: EthSpec> MockServer<T> {
block_hash,
parent_hash,
total_difficulty,
timestamp: block_number,
});
self.ctx