mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
Fmt
This commit is contained in:
@@ -1504,7 +1504,9 @@ pub fn serve<T: BeaconChainTypes>(
|
|||||||
network_tx: UnboundedSender<NetworkMessage<T::EthSpec>>| {
|
network_tx: UnboundedSender<NetworkMessage<T::EthSpec>>| {
|
||||||
task_spawner.spawn_async_with_rejection(Priority::P0, async move {
|
task_spawner.spawn_async_with_rejection(Priority::P0, async move {
|
||||||
publish_execution_payload_envelope::publish_execution_payload_envelope(
|
publish_execution_payload_envelope::publish_execution_payload_envelope(
|
||||||
envelope, chain, &network_tx,
|
envelope,
|
||||||
|
chain,
|
||||||
|
&network_tx,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
})
|
})
|
||||||
@@ -1517,7 +1519,10 @@ pub fn serve<T: BeaconChainTypes>(
|
|||||||
.and(warp::path("beacon"))
|
.and(warp::path("beacon"))
|
||||||
.and(warp::path("execution_payload_envelope"))
|
.and(warp::path("execution_payload_envelope"))
|
||||||
.and(warp::path::end())
|
.and(warp::path::end())
|
||||||
.and(warp::header::exact(CONTENT_TYPE_HEADER, SSZ_CONTENT_TYPE_HEADER))
|
.and(warp::header::exact(
|
||||||
|
CONTENT_TYPE_HEADER,
|
||||||
|
SSZ_CONTENT_TYPE_HEADER,
|
||||||
|
))
|
||||||
.and(warp::body::bytes())
|
.and(warp::body::bytes())
|
||||||
.and(task_spawner_filter.clone())
|
.and(task_spawner_filter.clone())
|
||||||
.and(chain_filter.clone())
|
.and(chain_filter.clone())
|
||||||
@@ -1531,10 +1536,12 @@ pub fn serve<T: BeaconChainTypes>(
|
|||||||
let envelope =
|
let envelope =
|
||||||
SignedExecutionPayloadEnvelope::<T::EthSpec>::from_ssz_bytes(&body_bytes)
|
SignedExecutionPayloadEnvelope::<T::EthSpec>::from_ssz_bytes(&body_bytes)
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
warp_utils::reject::custom_bad_request(format!("invalid SSZ: {e:?}"))
|
warp_utils::reject::custom_bad_request(format!("invalid SSZ: {e:?}"))
|
||||||
})?;
|
})?;
|
||||||
publish_execution_payload_envelope::publish_execution_payload_envelope(
|
publish_execution_payload_envelope::publish_execution_payload_envelope(
|
||||||
envelope, chain, &network_tx,
|
envelope,
|
||||||
|
chain,
|
||||||
|
&network_tx,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ pub async fn publish_execution_payload_envelope<T: BeaconChainTypes>(
|
|||||||
let beacon_block_root = envelope.message.beacon_block_root;
|
let beacon_block_root = envelope.message.beacon_block_root;
|
||||||
|
|
||||||
// Basic validation: check that the slot is reasonable
|
// Basic validation: check that the slot is reasonable
|
||||||
let current_slot = chain
|
let current_slot = chain.slot().map_err(|_| {
|
||||||
.slot()
|
warp_utils::reject::custom_server_error("Unable to get current slot".into())
|
||||||
.map_err(|_| warp_utils::reject::custom_server_error("Unable to get current slot".into()))?;
|
})?;
|
||||||
|
|
||||||
// Don't accept envelopes too far in the future
|
// Don't accept envelopes too far in the future
|
||||||
if slot > current_slot + 1 {
|
if slot > current_slot + 1 {
|
||||||
|
|||||||
@@ -7721,7 +7721,6 @@ async fn block_production_v4_ssz() {
|
|||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
async fn blinded_block_production_full_payload_premerge() {
|
async fn blinded_block_production_full_payload_premerge() {
|
||||||
ApiTester::new().await.test_blinded_block_production().await;
|
ApiTester::new().await.test_blinded_block_production().await;
|
||||||
|
|||||||
Reference in New Issue
Block a user