From ff475fda8b751e6884e106fe0795b855d0b3b5b2 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Thu, 16 May 2024 12:52:05 +0300 Subject: [PATCH] electra fixes with attestation types --- Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- mev-relay-rs/src/relay.rs | 15 +++++++++++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2bcffb71..b304d0d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -969,7 +969,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "beacon-api-client" version = "0.1.0" -source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=98ca171#98ca171508273a8de3eca06d471978c7d4cf6ae0" +source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=269ba9b#269ba9be9b06f5bf00c78cbd21932e2233a5d5a8" dependencies = [ "clap", "ethereum-consensus", @@ -2568,7 +2568,7 @@ dependencies = [ [[package]] name = "ethereum-consensus" version = "0.1.1" -source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=98ca171#98ca171508273a8de3eca06d471978c7d4cf6ae0" +source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=269ba9b#269ba9be9b06f5bf00c78cbd21932e2233a5d5a8" dependencies = [ "blst", "bs58 0.4.0", diff --git a/Cargo.toml b/Cargo.toml index 6348da86..bf70c85a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,8 +24,8 @@ codegen-units = 1 incremental = false [workspace.dependencies] -ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "98ca171" } -beacon-api-client = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "98ca171" } +ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "269ba9b" } +beacon-api-client = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "269ba9b" } reth = { git = "https://github.com/paradigmxyz/reth", rev = "017cfa60c222aa93cf4e7dbe1f085e0d60f2096a" } reth-interfaces = { git = "https://github.com/paradigmxyz/reth", rev = "017cfa60c222aa93cf4e7dbe1f085e0d60f2096a" } diff --git a/mev-relay-rs/src/relay.rs b/mev-relay-rs/src/relay.rs index e7f01151..13a55c74 100644 --- a/mev-relay-rs/src/relay.rs +++ b/mev-relay-rs/src/relay.rs @@ -637,8 +637,19 @@ impl BlindedBlockProvider for Relay { match unblind_block(signed_block, auction_context.execution_payload()) { Ok(signed_block) => { let version = signed_block.version(); - let block_root = - signed_block.message().hash_tree_root().map_err(ConsensusError::from)?; + let block_root = match version { + Fork::Deneb => { + signed_block.message().hash_tree_root().map_err(ConsensusError::from)? + } + Fork::Electra => match signed_block { + SignedBeaconBlock::Electra(ref inner) => { + inner.message.hash_tree_root().map_err(ConsensusError::from)? + } + _ => unreachable!(), + }, + _ => unreachable!(), + }; + let request = SubmitSignedBeaconBlock { signed_block: &signed_block, kzg_proofs: auction_context.blobs_bundle().map(|bundle| bundle.proofs.as_ref()),