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

@@ -61,6 +61,7 @@ mod metrics;
pub mod payload_cache;
mod payload_status;
pub mod test_utils;
mod versioned_hashes;
/// Indicates the default jwt authenticated execution endpoint.
pub const DEFAULT_EXECUTION_ENDPOINT: &str = "http://localhost:8551/";
@@ -141,6 +142,7 @@ pub enum Error {
InvalidBlobConversion(String),
BeaconStateError(BeaconStateError),
PayloadTypeMismatch,
VerifyingVersionedHashes(versioned_hashes::Error),
}
impl From<BeaconStateError> for Error {
@@ -1321,7 +1323,7 @@ impl<T: EthSpec> ExecutionLayer<T> {
/// Maps to the `engine_newPayload` JSON-RPC call.
pub async fn notify_new_payload(
&self,
new_payload_request: NewPayloadRequest<T>,
new_payload_request: NewPayloadRequest<'_, T>,
) -> Result<PayloadStatus, Error> {
let _timer = metrics::start_timer_vec(
&metrics::EXECUTION_LAYER_REQUEST_TIMES,