mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 04:37:13 +00:00
Deprecate gossip blobs (#9126)
#9124 Deprecate unneeded pre-Fulu blob features - blob gossip - blob lookup sync - engine getBlobsV1 Also deprecates some tests and cleans up production code paths I think this is blocked until gnosis forks to fulu? Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu> Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com> Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com> Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com> Co-Authored-By: Michael Sproul <michael@sigmaprime.io> Co-Authored-By: Daniel Knopik <daniel@dknopik.de> Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
use crate::engines::ForkchoiceState;
|
||||
use crate::http::{
|
||||
ENGINE_FORKCHOICE_UPDATED_V1, ENGINE_FORKCHOICE_UPDATED_V2, ENGINE_FORKCHOICE_UPDATED_V3,
|
||||
ENGINE_FORKCHOICE_UPDATED_V4, ENGINE_GET_BLOBS_V1, ENGINE_GET_BLOBS_V2,
|
||||
ENGINE_GET_CLIENT_VERSION_V1, ENGINE_GET_PAYLOAD_BODIES_BY_HASH_V1,
|
||||
ENGINE_GET_PAYLOAD_BODIES_BY_RANGE_V1, ENGINE_GET_PAYLOAD_V1, ENGINE_GET_PAYLOAD_V2,
|
||||
ENGINE_GET_PAYLOAD_V3, ENGINE_GET_PAYLOAD_V4, ENGINE_GET_PAYLOAD_V5, ENGINE_GET_PAYLOAD_V6,
|
||||
ENGINE_NEW_PAYLOAD_V1, ENGINE_NEW_PAYLOAD_V2, ENGINE_NEW_PAYLOAD_V3, ENGINE_NEW_PAYLOAD_V4,
|
||||
ENGINE_NEW_PAYLOAD_V5,
|
||||
ENGINE_FORKCHOICE_UPDATED_V4, ENGINE_GET_BLOBS_V2, ENGINE_GET_CLIENT_VERSION_V1,
|
||||
ENGINE_GET_PAYLOAD_BODIES_BY_HASH_V1, ENGINE_GET_PAYLOAD_BODIES_BY_RANGE_V1,
|
||||
ENGINE_GET_PAYLOAD_V1, ENGINE_GET_PAYLOAD_V2, ENGINE_GET_PAYLOAD_V3, ENGINE_GET_PAYLOAD_V4,
|
||||
ENGINE_GET_PAYLOAD_V5, ENGINE_GET_PAYLOAD_V6, ENGINE_NEW_PAYLOAD_V1, ENGINE_NEW_PAYLOAD_V2,
|
||||
ENGINE_NEW_PAYLOAD_V3, ENGINE_NEW_PAYLOAD_V4, ENGINE_NEW_PAYLOAD_V5,
|
||||
};
|
||||
use eth2::types::{
|
||||
BlobsBundle, SsePayloadAttributes, SsePayloadAttributesV1, SsePayloadAttributesV2,
|
||||
@@ -607,7 +606,6 @@ pub struct EngineCapabilities {
|
||||
pub get_payload_v5: bool,
|
||||
pub get_payload_v6: bool,
|
||||
pub get_client_version_v1: bool,
|
||||
pub get_blobs_v1: bool,
|
||||
pub get_blobs_v2: bool,
|
||||
pub get_blobs_v3: bool,
|
||||
}
|
||||
@@ -669,9 +667,6 @@ impl EngineCapabilities {
|
||||
if self.get_client_version_v1 {
|
||||
response.push(ENGINE_GET_CLIENT_VERSION_V1);
|
||||
}
|
||||
if self.get_blobs_v1 {
|
||||
response.push(ENGINE_GET_BLOBS_V1);
|
||||
}
|
||||
if self.get_blobs_v2 {
|
||||
response.push(ENGINE_GET_BLOBS_V2);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ pub const ENGINE_EXCHANGE_CAPABILITIES_TIMEOUT: Duration = Duration::from_secs(1
|
||||
pub const ENGINE_GET_CLIENT_VERSION_V1: &str = "engine_getClientVersionV1";
|
||||
pub const ENGINE_GET_CLIENT_VERSION_TIMEOUT: Duration = Duration::from_secs(1);
|
||||
|
||||
pub const ENGINE_GET_BLOBS_V1: &str = "engine_getBlobsV1";
|
||||
pub const ENGINE_GET_BLOBS_V2: &str = "engine_getBlobsV2";
|
||||
pub const ENGINE_GET_BLOBS_V3: &str = "engine_getBlobsV3";
|
||||
pub const ENGINE_GET_BLOBS_TIMEOUT: Duration = Duration::from_secs(1);
|
||||
@@ -92,7 +91,6 @@ pub static LIGHTHOUSE_CAPABILITIES: &[&str] = &[
|
||||
ENGINE_GET_PAYLOAD_BODIES_BY_HASH_V1,
|
||||
ENGINE_GET_PAYLOAD_BODIES_BY_RANGE_V1,
|
||||
ENGINE_GET_CLIENT_VERSION_V1,
|
||||
ENGINE_GET_BLOBS_V1,
|
||||
ENGINE_GET_BLOBS_V2,
|
||||
ENGINE_GET_BLOBS_V3,
|
||||
];
|
||||
@@ -717,20 +715,6 @@ impl HttpJsonRpc {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn get_blobs_v1<E: EthSpec>(
|
||||
&self,
|
||||
versioned_hashes: Vec<Hash256>,
|
||||
) -> Result<Vec<Option<BlobAndProofV1<E>>>, Error> {
|
||||
let params = json!([versioned_hashes]);
|
||||
|
||||
self.rpc_request(
|
||||
ENGINE_GET_BLOBS_V1,
|
||||
params,
|
||||
ENGINE_GET_BLOBS_TIMEOUT * self.execution_timeout_multiplier,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn get_blobs_v2<E: EthSpec>(
|
||||
&self,
|
||||
versioned_hashes: Vec<Hash256>,
|
||||
@@ -1272,7 +1256,6 @@ impl HttpJsonRpc {
|
||||
get_payload_v5: capabilities.contains(ENGINE_GET_PAYLOAD_V5),
|
||||
get_payload_v6: capabilities.contains(ENGINE_GET_PAYLOAD_V6),
|
||||
get_client_version_v1: capabilities.contains(ENGINE_GET_CLIENT_VERSION_V1),
|
||||
get_blobs_v1: capabilities.contains(ENGINE_GET_BLOBS_V1),
|
||||
get_blobs_v2: capabilities.contains(ENGINE_GET_BLOBS_V2),
|
||||
get_blobs_v3: capabilities.contains(ENGINE_GET_BLOBS_V3),
|
||||
})
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//! This crate only provides useful functionality for "The Merge", it does not provide any of the
|
||||
//! deposit-contract functionality that the `beacon_node/eth1` crate already provides.
|
||||
|
||||
use crate::json_structures::{BlobAndProofV1, BlobAndProofV2, BlobAndProofV3};
|
||||
use crate::json_structures::{BlobAndProofV2, BlobAndProofV3};
|
||||
use crate::payload_cache::PayloadCache;
|
||||
use arc_swap::ArcSwapOption;
|
||||
use auth::{Auth, JwtKey, strip_prefix};
|
||||
@@ -1722,23 +1722,6 @@ impl<E: EthSpec> ExecutionLayer<E> {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn get_blobs_v1(
|
||||
&self,
|
||||
query: Vec<Hash256>,
|
||||
) -> Result<Vec<Option<BlobAndProofV1<E>>>, Error> {
|
||||
let capabilities = self.get_engine_capabilities(None).await?;
|
||||
|
||||
if capabilities.get_blobs_v1 {
|
||||
self.engine()
|
||||
.request(|engine| async move { engine.api.get_blobs_v1(query).await })
|
||||
.await
|
||||
.map_err(Box::new)
|
||||
.map_err(Error::EngineError)
|
||||
} else {
|
||||
Err(Error::GetBlobsNotSupported)
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn get_blobs_v2(
|
||||
&self,
|
||||
query: Vec<Hash256>,
|
||||
|
||||
@@ -565,20 +565,16 @@ impl<E: EthSpec> ExecutionBlockGenerator<E> {
|
||||
self.insert_block(Block::PoS(payload))?;
|
||||
}
|
||||
|
||||
// Post-Gloas, the justified and finalized block hashes must be non-zero, since the
|
||||
// CL always has a known parent_block_hash to reference.
|
||||
if let Some(head_block) = self.blocks.get(&head_block_hash)
|
||||
&& self
|
||||
.get_fork_at_timestamp(head_block.timestamp())
|
||||
.gloas_enabled()
|
||||
{
|
||||
// If Gloas was enabled from genesis, the justified and finalized block hashes must be
|
||||
// non-zero, since the CL always has a known parent_block_hash to reference.
|
||||
if self.get_fork_at_timestamp(0).gloas_enabled() {
|
||||
assert!(
|
||||
forkchoice_state.safe_block_hash != ExecutionBlockHash::zero(),
|
||||
"post-Gloas safe_block_hash must not be zero"
|
||||
"for Gloas genesis safe_block_hash must not be zero"
|
||||
);
|
||||
assert!(
|
||||
forkchoice_state.finalized_block_hash != ExecutionBlockHash::zero(),
|
||||
"post-Gloas finalized_block_hash must not be zero"
|
||||
"for Gloas genesis finalized_block_hash must not be zero"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -494,20 +494,6 @@ pub async fn handle_rpc<E: EthSpec>(
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
ENGINE_GET_BLOBS_V1 => {
|
||||
let versioned_hashes =
|
||||
get_param::<Vec<Hash256>>(params, 0).map_err(|s| (s, BAD_PARAMS_ERROR_CODE))?;
|
||||
let generator = ctx.execution_block_generator.read();
|
||||
// V1: per-element nullable array, positionally matching the request.
|
||||
let response: Vec<Option<BlobAndProofV1<E>>> = versioned_hashes
|
||||
.iter()
|
||||
.map(|hash| match generator.get_blob_and_proof(hash) {
|
||||
Some(BlobAndProof::V1(v1)) => Some(v1),
|
||||
_ => None,
|
||||
})
|
||||
.collect();
|
||||
Ok(serde_json::to_value(response).unwrap())
|
||||
}
|
||||
ENGINE_GET_BLOBS_V2 => {
|
||||
let versioned_hashes =
|
||||
get_param::<Vec<Hash256>>(params, 0).map_err(|s| (s, BAD_PARAMS_ERROR_CODE))?;
|
||||
|
||||
@@ -57,7 +57,6 @@ pub const DEFAULT_ENGINE_CAPABILITIES: EngineCapabilities = EngineCapabilities {
|
||||
get_payload_v5: true,
|
||||
get_payload_v6: true,
|
||||
get_client_version_v1: true,
|
||||
get_blobs_v1: true,
|
||||
get_blobs_v2: true,
|
||||
get_blobs_v3: true,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user