Skip to content

Commit f4d4e84

Browse files
committed
remove executionWitness
1 parent 258758d commit f4d4e84

File tree

5 files changed

+0
-121
lines changed

5 files changed

+0
-121
lines changed

beacon_node/execution_layer/src/engine_api/http.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,26 +1460,6 @@ impl HttpJsonRpc {
14601460
Err(Error::RequiredMethodUnsupported("engine_forkchoiceUpdated"))
14611461
}
14621462
}
1463-
1464-
/// Calls the `debug_executionWitness` method on the execution engine.
1465-
///
1466-
/// This method retrieves the execution witness for a given block, which contains
1467-
/// the state data needed to re-execute and prove the block's execution.
1468-
///
1469-
/// The block can be specified by number (hex string like "0x1") or tag ("latest", "pending").
1470-
pub async fn debug_execution_witness(&self, block: &str) -> Result<serde_json::Value, Error> {
1471-
let params = json!([block]);
1472-
1473-
self.rpc_request(
1474-
"debug_executionWitness",
1475-
params,
1476-
// Use a longer timeout since this can be a heavy operation
1477-
// Though note that this should not take a long time because
1478-
// we call it near the tip or we can get it from disk.
1479-
Duration::from_secs(30) * self.execution_timeout_multiplier,
1480-
)
1481-
.await
1482-
}
14831463
}
14841464

14851465
#[cfg(test)]

beacon_node/execution_layer/src/lib.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,23 +2072,6 @@ impl<E: EthSpec> ExecutionLayer<E> {
20722072
Err(Error::NoPayloadBuilder)
20732073
}
20742074
}
2075-
2076-
/// Get the execution witness for a given block from the execution layer.
2077-
///
2078-
/// This method calls `debug_executionWitness` on the execution engine, which
2079-
/// returns the state data needed to re-execute and prove the block's execution.
2080-
///
2081-
/// The block can be specified by number (hex string like "0x1") or tag ("latest", "pending").
2082-
///
2083-
/// TODO(zkproofs): As noted in lighthouse/execution_witness -- we can have the EL
2084-
/// save this information(last 64 blocks) when newPayload is called and so this method is just fetching it.
2085-
pub async fn get_execution_witness(&self, block: &str) -> Result<serde_json::Value, Error> {
2086-
self.engine()
2087-
.api
2088-
.debug_execution_witness(block)
2089-
.await
2090-
.map_err(Error::ApiError)
2091-
}
20922075
}
20932076

20942077
#[derive(AsRefStr)]

beacon_node/http_api/src/lib.rs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3102,50 +3102,6 @@ pub fn serve<T: BeaconChainTypes>(
31023102
})
31033103
},
31043104
);
3105-
// TODO(zkproofs): I think we want to return a block_with_witness
3106-
// and note the EL could generate this witness when newPayload is called
3107-
// it gets saved to disk or in memory and then when the EL is asked for it
3108-
// it just gets it from disk or memory.
3109-
//
3110-
// Also consider adding another endpoint that just
3111-
// returns the unverified payload for those who want to generate the witness
3112-
// themselves quickly, and don't want to pay the latency cost for payload execution.
3113-
//
3114-
// GET lighthouse/execution_witness/{block}
3115-
// Returns the execution witness for a given block from the execution layer.
3116-
// The block parameter can be a hex block number (e.g., "0x1") or a tag ("latest", "pending").
3117-
let get_lighthouse_execution_witness = warp::path("lighthouse")
3118-
.and(warp::path("execution_witness"))
3119-
.and(warp::path::param::<String>())
3120-
.and(warp::path::end())
3121-
.and(task_spawner_filter.clone())
3122-
.and(chain_filter.clone())
3123-
.then(
3124-
|block: String, task_spawner: TaskSpawner<T::EthSpec>, chain: Arc<BeaconChain<T>>| {
3125-
task_spawner.spawn_async_with_rejection(Priority::P1, async move {
3126-
let execution_layer = chain.execution_layer.as_ref().ok_or_else(|| {
3127-
warp_utils::reject::custom_server_error(
3128-
"execution layer not configured".to_string(),
3129-
)
3130-
})?;
3131-
3132-
let witness = execution_layer
3133-
.get_execution_witness(&block)
3134-
.await
3135-
.map_err(|e| {
3136-
warp_utils::reject::custom_server_error(format!(
3137-
"failed to get execution witness: {:?}",
3138-
e
3139-
))
3140-
})?;
3141-
3142-
Ok::<_, warp::reject::Rejection>(
3143-
warp::reply::json(&api_types::GenericResponse::from(witness))
3144-
.into_response(),
3145-
)
3146-
})
3147-
},
3148-
);
31493105

31503106
let get_events = eth_v1
31513107
.clone()
@@ -3378,7 +3334,6 @@ pub fn serve<T: BeaconChainTypes>(
33783334
.uor(get_beacon_light_client_updates)
33793335
.uor(get_lighthouse_block_packing_efficiency)
33803336
.uor(get_lighthouse_merge_readiness)
3381-
.uor(get_lighthouse_execution_witness)
33823337
.uor(get_events)
33833338
.uor(get_expected_withdrawals)
33843339
.uor(lighthouse_log_events.boxed())

beacon_node/http_api/tests/tests.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2830,22 +2830,6 @@ impl ApiTester {
28302830
self
28312831
}
28322832

2833-
pub async fn test_get_lighthouse_execution_witness(self) -> Self {
2834-
// The mock execution layer doesn't support debug_executionWitness,
2835-
// so this test verifies the endpoint exists and returns an appropriate error.
2836-
// TODO(zkproofs): should we add to the mock el? Also might be good to have this
2837-
// TODO(zkproofs): fail on startup if its needed (or it cna be queried)
2838-
let result = self.client.get_lighthouse_execution_witness("latest").await;
2839-
2840-
// The endpoint should return an error since the mock EL doesn't support this method
2841-
assert!(
2842-
result.is_err(),
2843-
"execution witness endpoint should return error when EL doesn't support the method"
2844-
);
2845-
2846-
self
2847-
}
2848-
28492833
pub async fn test_get_config_fork_schedule(self) -> Self {
28502834
let result = self.client.get_config_fork_schedule().await.unwrap().data;
28512835

@@ -8135,8 +8119,6 @@ async fn lighthouse_endpoints() {
81358119
.test_post_lighthouse_liveness()
81368120
.await
81378121
.test_post_lighthouse_add_remove_peer()
8138-
.await
8139-
.test_get_lighthouse_execution_witness()
81408122
.await;
81418123
}
81428124

common/eth2/src/lighthouse.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -313,27 +313,6 @@ impl BeaconNodeHttpClient {
313313
self.post_with_response(path, &req).await
314314
}
315315

316-
/// `GET lighthouse/execution_witness/{block}`
317-
///
318-
/// Retrieves the execution witness for a given block, which contains
319-
/// the state data needed to re-execute and prove the block's execution.
320-
///
321-
/// The block can be specified by number (hex string like "0x1") or tag ("latest", "pending").
322-
pub async fn get_lighthouse_execution_witness(
323-
&self,
324-
block: &str,
325-
) -> Result<GenericResponse<serde_json::Value>, Error> {
326-
let mut path = self.server.expose_full().clone();
327-
328-
path.path_segments_mut()
329-
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
330-
.push("lighthouse")
331-
.push("execution_witness")
332-
.push(block);
333-
334-
self.get(path).await
335-
}
336-
337316
/*
338317
Analysis endpoints.
339318
*/

0 commit comments

Comments
 (0)