Verify Versioned Hashes During Optimistic Sync (#4832)

* Convert NewPayloadRequest to use Reference

* Refactor for Clarity

* Verify Versioned Hashes

* Added Tests for Version Hash Verification

* Added Moar Tests

* Fix Problems Caused By  Merge

* Update to use Alloy Instead of Reth Crates (#14)

* Update beacon_node/execution_layer/src/engine_api/new_payload_request.rs

Co-authored-by: realbigsean <seananderson33@GMAIL.com>

* Faster Versioned Hash Extraction

* Update to rust 1.75 & Pin alloy-consensus
This commit is contained in:
ethDreamer
2024-02-18 23:40:45 +11:00
committed by GitHub
parent 1711b80779
commit a264afd19f
16 changed files with 957 additions and 222 deletions

View File

@@ -699,7 +699,7 @@ pub fn generate_blobs<E: EthSpec>(
Ok((bundle, transactions.into()))
}
fn static_valid_tx<T: EthSpec>() -> Result<Transaction<T::MaxBytesPerTransaction>, String> {
pub fn static_valid_tx<T: EthSpec>() -> Result<Transaction<T::MaxBytesPerTransaction>, String> {
// This is a real transaction hex encoded, but we don't care about the contents of the transaction.
let transaction: EthersTransaction = serde_json::from_str(
r#"{

View File

@@ -244,7 +244,7 @@ impl<T: EthSpec> MockExecutionLayer<T> {
// TODO: again consider forks
let status = self
.el
.notify_new_payload(payload.try_into().unwrap())
.notify_new_payload(payload.to_ref().try_into().unwrap())
.await
.unwrap();
assert_eq!(status, PayloadStatus::Valid);

View File

@@ -25,8 +25,8 @@ use warp::{http::StatusCode, Filter, Rejection};
use crate::EngineCapabilities;
pub use execution_block_generator::{
generate_blobs, generate_genesis_block, generate_genesis_header, generate_pow_block, Block,
ExecutionBlockGenerator,
generate_blobs, generate_genesis_block, generate_genesis_header, generate_pow_block,
static_valid_tx, Block, ExecutionBlockGenerator,
};
pub use hook::Hook;
pub use mock_builder::{MockBuilder, Operation};