mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 03:31:45 +00:00
add engine_getBlobV1
This commit is contained in:
@@ -11,6 +11,10 @@ pub use types::{
|
||||
};
|
||||
|
||||
pub mod auth;
|
||||
use crate::engines::ForkChoiceState;
|
||||
pub use types::{Address, EthSpec, ExecutionPayload, Hash256, Uint256};
|
||||
use types::{Blob, KZGCommitment};
|
||||
|
||||
pub mod http;
|
||||
pub mod json_structures;
|
||||
|
||||
@@ -166,3 +170,9 @@ pub struct ProposeBlindedBlockResponse {
|
||||
pub latest_valid_hash: Option<Hash256>,
|
||||
pub validation_error: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct BlobDetailsV1 {
|
||||
kzg: KZGCommitment,
|
||||
blob: Vec<Hash256>,
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ pub const ENGINE_NEW_PAYLOAD_TIMEOUT: Duration = Duration::from_secs(8);
|
||||
pub const ENGINE_GET_PAYLOAD_V1: &str = "engine_getPayloadV1";
|
||||
pub const ENGINE_GET_PAYLOAD_TIMEOUT: Duration = Duration::from_secs(2);
|
||||
|
||||
pub const ENGINE_GET_BLOB_V1: &str = "engine_getBlobV1";
|
||||
pub const ENGINE_GET_BLOB_TIMEOUT: Duration = Duration::from_secs(2);
|
||||
|
||||
pub const ENGINE_FORKCHOICE_UPDATED_V1: &str = "engine_forkchoiceUpdatedV1";
|
||||
pub const ENGINE_FORKCHOICE_UPDATED_TIMEOUT: Duration = Duration::from_secs(8);
|
||||
|
||||
@@ -664,6 +667,20 @@ impl HttpJsonRpc {
|
||||
Ok(response.into())
|
||||
}
|
||||
|
||||
async fn get_blob_v1<T: EthSpec>(
|
||||
&self,
|
||||
payload_id: PayloadId,
|
||||
versioned_hash: Hash256,
|
||||
) -> Result<BlobDetailsV1, Error> {
|
||||
let params = json!([JsonPayloadIdRequest::from(payload_id), versioned_hash]);
|
||||
|
||||
let response: BlobDetailsV1 = self
|
||||
.rpc_request(ENGINE_GET_BLOB_V1, params, ENGINE_GET_BLOB_TIMEOUT)
|
||||
.await?;
|
||||
|
||||
Ok(response.into())
|
||||
}
|
||||
|
||||
pub async fn forkchoice_updated_v1(
|
||||
&self,
|
||||
forkchoice_state: ForkChoiceState,
|
||||
|
||||
Reference in New Issue
Block a user