Skip to content

Commit 11e9e13

Browse files
committed
Use engine v4 methods for Fulu (v5 methods do not exist yet). Update kurtosis config for PeerDAS as electra genesis is not yet supported.
1 parent 4e25302 commit 11e9e13

File tree

4 files changed

+52
-17
lines changed

4 files changed

+52
-17
lines changed

beacon_node/beacon_chain/src/fulu_readiness.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Provides tools for checking if a node is ready for the Fulu upgrade.
22
33
use crate::{BeaconChain, BeaconChainTypes};
4-
use execution_layer::http::{ENGINE_GET_PAYLOAD_V5, ENGINE_NEW_PAYLOAD_V5};
4+
use execution_layer::http::{ENGINE_GET_PAYLOAD_V4, ENGINE_NEW_PAYLOAD_V4};
55
use serde::{Deserialize, Serialize};
66
use std::fmt;
77
use std::time::Duration;
@@ -87,14 +87,15 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
8787
Ok(capabilities) => {
8888
let mut missing_methods = String::from("Required Methods Unsupported:");
8989
let mut all_good = true;
90-
if !capabilities.get_payload_v5 {
90+
// TODO(fulu) switch to v5 when the EL is ready
91+
if !capabilities.get_payload_v4 {
9192
missing_methods.push(' ');
92-
missing_methods.push_str(ENGINE_GET_PAYLOAD_V5);
93+
missing_methods.push_str(ENGINE_GET_PAYLOAD_V4);
9394
all_good = false;
9495
}
95-
if !capabilities.new_payload_v5 {
96+
if !capabilities.new_payload_v4 {
9697
missing_methods.push(' ');
97-
missing_methods.push_str(ENGINE_NEW_PAYLOAD_V5);
98+
missing_methods.push_str(ENGINE_NEW_PAYLOAD_V4);
9899
all_good = false;
99100
}
100101

beacon_node/execution_layer/src/engine_api/http.rs

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,8 @@ impl HttpJsonRpc {
829829
Ok(response.into())
830830
}
831831

832-
pub async fn new_payload_v5_fulu<E: EthSpec>(
832+
// TODO(fulu): switch to v5 endpoint when the EL is ready for Fulu
833+
pub async fn new_payload_v4_fulu<E: EthSpec>(
833834
&self,
834835
new_payload_request_fulu: NewPayloadRequestFulu<'_, E>,
835836
) -> Result<PayloadStatusV1, Error> {
@@ -844,7 +845,7 @@ impl HttpJsonRpc {
844845

845846
let response: JsonPayloadStatusV1 = self
846847
.rpc_request(
847-
ENGINE_NEW_PAYLOAD_V5,
848+
ENGINE_NEW_PAYLOAD_V4,
848849
params,
849850
ENGINE_NEW_PAYLOAD_TIMEOUT * self.execution_timeout_multiplier,
850851
)
@@ -962,6 +963,19 @@ impl HttpJsonRpc {
962963
.try_into()
963964
.map_err(Error::BadResponse)
964965
}
966+
// TODO(fulu): remove when v5 method is ready.
967+
ForkName::Fulu => {
968+
let response: JsonGetPayloadResponseV5<E> = self
969+
.rpc_request(
970+
ENGINE_GET_PAYLOAD_V4,
971+
params,
972+
ENGINE_GET_PAYLOAD_TIMEOUT * self.execution_timeout_multiplier,
973+
)
974+
.await?;
975+
JsonGetPayloadResponse::V5(response)
976+
.try_into()
977+
.map_err(Error::BadResponse)
978+
}
965979
_ => Err(Error::UnsupportedForkVariant(format!(
966980
"called get_payload_v4 with {}",
967981
fork_name
@@ -1263,10 +1277,11 @@ impl HttpJsonRpc {
12631277
}
12641278
}
12651279
NewPayloadRequest::Fulu(new_payload_request_fulu) => {
1266-
if engine_capabilities.new_payload_v5 {
1267-
self.new_payload_v5_fulu(new_payload_request_fulu).await
1280+
// TODO(fulu): switch to v5 endpoint when the EL is ready for Fulu
1281+
if engine_capabilities.new_payload_v4 {
1282+
self.new_payload_v4_fulu(new_payload_request_fulu).await
12681283
} else {
1269-
Err(Error::RequiredMethodUnsupported("engine_newPayloadV5"))
1284+
Err(Error::RequiredMethodUnsupported("engine_newPayloadV4"))
12701285
}
12711286
}
12721287
}
@@ -1305,8 +1320,9 @@ impl HttpJsonRpc {
13051320
}
13061321
}
13071322
ForkName::Fulu => {
1308-
if engine_capabilities.get_payload_v5 {
1309-
self.get_payload_v5(fork_name, payload_id).await
1323+
// TODO(fulu): switch to v5 when the EL is ready
1324+
if engine_capabilities.get_payload_v4 {
1325+
self.get_payload_v4(fork_name, payload_id).await
13101326
} else {
13111327
Err(Error::RequiredMethodUnsupported("engine_getPayloadv5"))
13121328
}

beacon_node/execution_layer/src/test_utils/handle_rpc.rs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ pub async fn handle_rpc<E: EthSpec>(
230230
if method == ENGINE_NEW_PAYLOAD_V1
231231
|| method == ENGINE_NEW_PAYLOAD_V2
232232
|| method == ENGINE_NEW_PAYLOAD_V3
233-
|| method == ENGINE_NEW_PAYLOAD_V4
233+
// TODO(fulu): Uncomment this once v5 method is ready for Fulu
234+
// || method == ENGINE_NEW_PAYLOAD_V4
234235
{
235236
return Err((
236237
format!("{} called after Fulu fork!", method),
@@ -381,8 +382,9 @@ pub async fn handle_rpc<E: EthSpec>(
381382
== ForkName::Fulu
382383
&& (method == ENGINE_GET_PAYLOAD_V1
383384
|| method == ENGINE_GET_PAYLOAD_V2
384-
|| method == ENGINE_GET_PAYLOAD_V3
385-
|| method == ENGINE_GET_PAYLOAD_V4)
385+
|| method == ENGINE_GET_PAYLOAD_V3)
386+
// TODO(fulu): Uncomment this once v5 method is ready for Fulu
387+
// || method == ENGINE_GET_PAYLOAD_V4)
386388
{
387389
return Err((
388390
format!("{} called after Fulu fork!", method),
@@ -448,6 +450,22 @@ pub async fn handle_rpc<E: EthSpec>(
448450
})
449451
.unwrap()
450452
}
453+
// TODO(fulu): remove this once we switch to v5 method
454+
JsonExecutionPayload::V5(execution_payload) => {
455+
serde_json::to_value(JsonGetPayloadResponseV5 {
456+
execution_payload,
457+
block_value: Uint256::from(DEFAULT_MOCK_EL_PAYLOAD_VALUE_WEI),
458+
blobs_bundle: maybe_blobs
459+
.ok_or((
460+
"No blobs returned despite V5 Payload".to_string(),
461+
GENERIC_ERROR_CODE,
462+
))?
463+
.into(),
464+
should_override_builder: false,
465+
execution_requests: Default::default(),
466+
})
467+
.unwrap()
468+
}
451469
_ => unreachable!(),
452470
}),
453471
ENGINE_GET_PAYLOAD_V5 => Ok(match JsonExecutionPayload::from(response) {

scripts/local_testnet/network_params_das.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ participants:
1111
- --target-peers=3
1212
count: 2
1313
network_params:
14-
electra_fork_epoch: 0
15-
fulu_fork_epoch: 0
14+
electra_fork_epoch: 1
15+
fulu_fork_epoch: 2
1616
seconds_per_slot: 6
1717
snooper_enabled: false
1818
global_log_level: debug

0 commit comments

Comments
 (0)