ContextDeserialize and Beacon API Improvements (#7372)

* #7286
* BeaconAPI is not returning a versioned response when it should for some V1 endpoints
* these [strange functions with vX in the name that still accept `endpoint_version` arguments](https://github.com/sigp/lighthouse/blob/stable/beacon_node/http_api/src/produce_block.rs#L192)

This refactor is a prerequisite to get the fulu EF tests running.
This commit is contained in:
ethDreamer
2025-05-19 00:05:16 -05:00
committed by GitHub
parent fcfcbf9a11
commit 7684d1f866
92 changed files with 1863 additions and 827 deletions

View File

@@ -79,7 +79,7 @@ pub fn run<E: EthSpec>(
.await
.map_err(|e| format!("Failed to download block: {:?}", e))?
.ok_or_else(|| format!("Unable to locate block at {:?}", block_id))?
.data;
.into_data();
Ok::<_, String>(block)
})
.map_err(|e| format!("Failed to complete task: {:?}", e))?

View File

@@ -123,11 +123,11 @@ async fn get_block_from_source<T: EthSpec>(
.unwrap()
.unwrap();
let blobs_from_source = source
.get_blobs::<T>(block_id, None)
.get_blobs::<T>(block_id, None, spec)
.await
.unwrap()
.unwrap()
.data;
.into_data();
let (kzg_proofs, blobs): (Vec<_>, Vec<_>) = blobs_from_source
.iter()

View File

@@ -102,7 +102,7 @@ pub fn run<E: EthSpec>(
})
.map_err(|e| format!("Failed to complete task: {:?}", e))?
.ok_or_else(|| format!("Unable to locate state at {:?}", state_id))?
.data;
.into_data();
let state_root = match state_id {
StateId::Root(root) => Some(root),
_ => None,

View File

@@ -50,7 +50,7 @@ pub fn run<E: EthSpec>(
})
.map_err(|e| format!("Failed to complete task: {:?}", e))?
.ok_or_else(|| format!("Unable to locate state at {:?}", state_id))?
.data
.into_data()
}
_ => return Err("must supply either --state-path or --beacon-url".into()),
};

View File

@@ -154,7 +154,7 @@ pub fn run<E: EthSpec>(
.await
.map_err(|e| format!("Failed to download block: {:?}", e))?
.ok_or_else(|| format!("Unable to locate block at {:?}", block_id))?
.data;
.into_data();
if block.slot() == inner_spec.genesis_slot {
return Err("Cannot run on the genesis block".to_string());
@@ -165,7 +165,7 @@ pub fn run<E: EthSpec>(
.await
.map_err(|e| format!("Failed to download parent block: {:?}", e))?
.ok_or_else(|| format!("Unable to locate parent block at {:?}", block_id))?
.data;
.into_data();
let state_root = parent_block.state_root();
let state_id = StateId::Root(state_root);
@@ -174,7 +174,7 @@ pub fn run<E: EthSpec>(
.await
.map_err(|e| format!("Failed to download state: {:?}", e))?
.ok_or_else(|| format!("Unable to locate state at {:?}", state_id))?
.data;
.into_data();
Ok((pre_state, Some(state_root), block))
})