Skip to content

Commit

Permalink
check existence of hardfork milestone to decide if engine APIs should…
Browse files Browse the repository at this point in the history
… be added or not

Signed-off-by: Daniel Lehrner <[email protected]>
  • Loading branch information
daniellehrner committed Jan 17, 2025
1 parent a98e950 commit 97cdf61
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
*/
package org.hyperledger.besu.ethereum.api.jsonrpc.methods;

import static org.hyperledger.besu.datatypes.HardforkId.MainnetHardforkId.CANCUN;
import static org.hyperledger.besu.datatypes.HardforkId.MainnetHardforkId.PRAGUE;

import org.hyperledger.besu.consensus.merge.blockcreation.MergeMiningCoordinator;
import org.hyperledger.besu.ethereum.ProtocolContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.RpcApis;
Expand Down Expand Up @@ -172,7 +175,7 @@ protected Map<String, JsonRpcMethod> create() {
new EngineGetBlobsV1(
consensusEngineServer, protocolContext, engineQosTimer, transactionPool)));

if (protocolSchedule.anyMatch(p -> p.spec().getName().equalsIgnoreCase("cancun"))) {
if (protocolSchedule.milestoneFor(CANCUN).isPresent()) {
executionEngineApisSupported.add(
new EngineGetPayloadV3(
consensusEngineServer,
Expand All @@ -183,7 +186,7 @@ protected Map<String, JsonRpcMethod> create() {
protocolSchedule));
}

if (protocolSchedule.anyMatch(p -> p.spec().getName().equalsIgnoreCase("prague"))) {
if (protocolSchedule.milestoneFor(PRAGUE).isPresent()) {
executionEngineApisSupported.add(
new EngineGetPayloadV4(
consensusEngineServer,
Expand Down

0 comments on commit 97cdf61

Please sign in to comment.