diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2.java index c2a69349235..c0189674c52 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/engine/EngineNewPayloadV2.java @@ -18,6 +18,7 @@ import org.hyperledger.besu.datatypes.VersionedHash; import org.hyperledger.besu.ethereum.ProtocolContext; import org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.EnginePayloadParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.Transaction; @@ -48,6 +49,22 @@ public String getName() { return RpcMethod.ENGINE_NEW_PAYLOAD_V2.getMethodName(); } + @Override + protected ValidationResult validateParameters( + final EnginePayloadParameter payloadParameter, + final Optional> maybeVersionedHashParam, + final Optional maybeBeaconBlockRootParam) { + if (payloadParameter.getBlobGasUsed() != null) { + return ValidationResult.invalid( + RpcErrorType.INVALID_PARAMS, "non-nil BlobGasUsed pre-cancun"); + } + if (payloadParameter.getExcessBlobGas() != null) { + return ValidationResult.invalid( + RpcErrorType.INVALID_PARAMS, "non-nil ExcessBlobGas pre-cancun"); + } + return ValidationResult.valid(); + } + @Override protected ValidationResult validateBlobs( final List transactions,