mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
feat: add empty payload building support (#2346)
This commit is contained in:
@@ -125,11 +125,12 @@ where
|
||||
/// Note:
|
||||
/// > Client software MAY stop the corresponding build process after serving this call.
|
||||
pub async fn get_payload_v1(&self, payload_id: PayloadId) -> EngineApiResult<ExecutionPayload> {
|
||||
self.payload_store
|
||||
Ok(self
|
||||
.payload_store
|
||||
.get_payload(payload_id)
|
||||
.await
|
||||
.map(|payload| (*payload).clone().into_v1_payload())
|
||||
.ok_or(EngineApiError::UnknownPayload)
|
||||
.ok_or(EngineApiError::UnknownPayload)?
|
||||
.map(|payload| (*payload).clone().into_v1_payload())?)
|
||||
}
|
||||
|
||||
/// Returns the most recent version of the payload that is available in the corresponding
|
||||
@@ -143,11 +144,12 @@ where
|
||||
&self,
|
||||
payload_id: PayloadId,
|
||||
) -> EngineApiResult<ExecutionPayloadEnvelope> {
|
||||
self.payload_store
|
||||
Ok(self
|
||||
.payload_store
|
||||
.get_payload(payload_id)
|
||||
.await
|
||||
.map(|payload| (*payload).clone().into_v2_payload())
|
||||
.ok_or(EngineApiError::UnknownPayload)
|
||||
.ok_or(EngineApiError::UnknownPayload)?
|
||||
.map(|payload| (*payload).clone().into_v2_payload())?)
|
||||
}
|
||||
|
||||
/// Called to retrieve execution payload bodies by range.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use jsonrpsee_types::error::{INTERNAL_ERROR_CODE, INVALID_PARAMS_CODE};
|
||||
use reth_beacon_consensus::{BeaconEngineError, BeaconForkChoiceUpdateError};
|
||||
use reth_payload_builder::error::PayloadBuilderError;
|
||||
use reth_primitives::{H256, U256};
|
||||
use thiserror::Error;
|
||||
use tokio::sync::{mpsc, oneshot};
|
||||
@@ -75,6 +76,9 @@ pub enum EngineApiError {
|
||||
/// Failed to send message due ot closed channel
|
||||
#[error("Closed channel")]
|
||||
ChannelClosed,
|
||||
/// Fetching the payload failed
|
||||
#[error(transparent)]
|
||||
GetPayloadError(#[from] PayloadBuilderError),
|
||||
}
|
||||
|
||||
impl<T> From<mpsc::error::SendError<T>> for EngineApiError {
|
||||
|
||||
Reference in New Issue
Block a user