From deba4b6a891f7b086f89edfed3b85978ee981326 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Thu, 2 May 2024 11:38:24 -0600 Subject: [PATCH] submit blobs to CL when verifying block before relay release --- Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- mev-relay-rs/src/relay.rs | 9 +++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c78a969c..0a0d1e43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -980,7 +980,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "beacon-api-client" version = "0.1.0" -source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=0919f02435e1b64e27c53931cac8e08edaad5f8b#0919f02435e1b64e27c53931cac8e08edaad5f8b" +source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=5cf67a5944ef4e18742178374eb4d37b50a5b292#5cf67a5944ef4e18742178374eb4d37b50a5b292" dependencies = [ "clap", "ethereum-consensus", @@ -2654,7 +2654,7 @@ dependencies = [ [[package]] name = "ethereum-consensus" version = "0.1.1" -source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=0919f02435e1b64e27c53931cac8e08edaad5f8b#0919f02435e1b64e27c53931cac8e08edaad5f8b" +source = "git+https://github.com/ralexstokes/ethereum-consensus?rev=5cf67a5944ef4e18742178374eb4d37b50a5b292#5cf67a5944ef4e18742178374eb4d37b50a5b292" dependencies = [ "blst", "bs58 0.4.0", diff --git a/Cargo.toml b/Cargo.toml index 97051daa..17bfd5b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,8 +14,8 @@ default-members = ["bin/mev"] version = "0.3.0" [workspace.dependencies] -ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "0919f02435e1b64e27c53931cac8e08edaad5f8b" } -beacon-api-client = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "0919f02435e1b64e27c53931cac8e08edaad5f8b" } +ethereum-consensus = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "5cf67a5944ef4e18742178374eb4d37b50a5b292" } +beacon-api-client = { git = "https://github.com/ralexstokes/ethereum-consensus", rev = "5cf67a5944ef4e18742178374eb4d37b50a5b292" } reth = { git = "https://github.com/paradigmxyz/reth", rev = "8e65cb3" } reth-db = { git = "https://github.com/paradigmxyz/reth", rev = "8e65cb3" } diff --git a/mev-relay-rs/src/relay.rs b/mev-relay-rs/src/relay.rs index fa68f21a..deb59922 100644 --- a/mev-relay-rs/src/relay.rs +++ b/mev-relay-rs/src/relay.rs @@ -1,6 +1,6 @@ use crate::auction_context::AuctionContext; use async_trait::async_trait; -use beacon_api_client::{BroadcastValidation, PayloadAttributesEvent}; +use beacon_api_client::{BroadcastValidation, PayloadAttributesEvent, SubmitSignedBeaconBlock}; use ethereum_consensus::{ clock::get_current_unix_time_in_nanos, crypto::SecretKey, @@ -528,10 +528,15 @@ impl BlindedBlockProvider for Relay { let version = signed_block.version(); let block_root = signed_block.message().hash_tree_root().map_err(ConsensusError::from)?; + let request = SubmitSignedBeaconBlock { + signed_block: &signed_block, + kzg_proofs: auction_context.blobs_bundle().map(|bundle| bundle.proofs.as_ref()), + blobs: auction_context.blobs_bundle().map(|bundle| bundle.blobs.as_ref()), + }; if let Err(err) = self .beacon_node .post_signed_beacon_block_v2( - &signed_block, + request, version, Some(BroadcastValidation::ConsensusAndEquivocation), )