From daab3408aa23c1ca4ed923e3e9c1476775fb9b95 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 27 Apr 2026 17:08:16 +0200 Subject: [PATCH] spawn a task for col construction --- .../src/beacon/execution_payload_envelope.rs | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/beacon_node/http_api/src/beacon/execution_payload_envelope.rs b/beacon_node/http_api/src/beacon/execution_payload_envelope.rs index e06a7e9201..78dae410b0 100644 --- a/beacon_node/http_api/src/beacon/execution_payload_envelope.rs +++ b/beacon_node/http_api/src/beacon/execution_payload_envelope.rs @@ -11,9 +11,11 @@ use beacon_chain::{BeaconChain, BeaconChainTypes}; use bytes::Bytes; use eth2::types as api_types; use eth2::{CONTENT_TYPE_HEADER, SSZ_CONTENT_TYPE_HEADER}; +use futures::TryFutureExt; use lighthouse_network::PubsubMessage; use network::NetworkMessage; use ssz::{Decode, Encode}; +use std::future::Future; use std::sync::Arc; use tokio::sync::mpsc::UnboundedSender; use tracing::{debug, error, info, warn}; @@ -130,7 +132,8 @@ pub async fn publish_execution_payload_envelope( && !blobs.is_empty() { let gossip_verified_columns = - build_gloas_data_columns(&chain, beacon_block_root, slot, &blobs)?; + spawn_build_gloas_data_columns_task(chain.clone(), beacon_block_root, slot, blobs)? + .await?; if !gossip_verified_columns.is_empty() { publish_column_sidecars(network_tx, &gossip_verified_columns, &chain).map_err( @@ -164,6 +167,26 @@ pub async fn publish_execution_payload_envelope( Ok(warp::reply().into_response()) } +fn spawn_build_gloas_data_columns_task( + chain: Arc>, + beacon_block_root: types::Hash256, + slot: types::Slot, + blobs: types::BlobsList, +) -> Result>, Rejection>>, Rejection> { + chain + .clone() + .task_executor + .spawn_blocking_handle( + move || build_gloas_data_columns(&chain, beacon_block_root, slot, &blobs), + "build_gloas_data_columns", + ) + .ok_or_else(|| warp_utils::reject::custom_server_error("runtime shutdown".to_string())) + .map(|r| { + r.map_err(|_| warp_utils::reject::custom_server_error("join error".to_string())) + .and_then(|output| async move { output }) + }) +} + fn build_gloas_data_columns( chain: &BeaconChain, beacon_block_root: types::Hash256,