diff --git a/src/Nethermind/Nethermind.Consensus/Producers/PayloadAttributes.cs b/src/Nethermind/Nethermind.Consensus/Producers/PayloadAttributes.cs index ab4a8661e3f..1e6c8cdf345 100644 --- a/src/Nethermind/Nethermind.Consensus/Producers/PayloadAttributes.cs +++ b/src/Nethermind/Nethermind.Consensus/Producers/PayloadAttributes.cs @@ -2,9 +2,11 @@ // SPDX-License-Identifier: LGPL-3.0-only using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Text; using Nethermind.Core; using Nethermind.Core.Crypto; +using Nethermind.Core.Specs; namespace Nethermind.Consensus.Producers; @@ -45,3 +47,36 @@ public string ToString(string indentation) return sb.ToString(); } } + +public static class PayloadAttributesVersioningExtensions +{ + public static int GetVersion(this PayloadAttributes executionPayload) => + executionPayload.Withdrawals is null ? 1 : 2; + + public static bool Validate( + this PayloadAttributes payloadAttributes, + IReleaseSpec spec, + int version, + [NotNullWhen(false)] out string? error) + { + int actualVersion = payloadAttributes.GetVersion(); + + error = actualVersion switch + { + 1 when spec.WithdrawalsEnabled => "PayloadAttributesV2 expected", + > 1 when !spec.WithdrawalsEnabled => "PayloadAttributesV1 expected", + _ => actualVersion > version ? $"PayloadAttributesV{version} expected" : null + }; + + return error is null; + } + + public static bool Validate(this PayloadAttributes payloadAttributes, + ISpecProvider specProvider, + int version, + [NotNullWhen(false)] out string? error) => + payloadAttributes.Validate( + specProvider.GetSpec(ForkActivation.TimestampOnly(payloadAttributes.Timestamp)), + version, + out error); +} diff --git a/src/Nethermind/Nethermind.Core/Specs/ForkActivation.cs b/src/Nethermind/Nethermind.Core/Specs/ForkActivation.cs index 391c031f958..4ebb6f02460 100644 --- a/src/Nethermind/Nethermind.Core/Specs/ForkActivation.cs +++ b/src/Nethermind/Nethermind.Core/Specs/ForkActivation.cs @@ -16,6 +16,17 @@ public ForkActivation(long blockNumber, ulong? timestamp = null) BlockNumber = blockNumber; Timestamp = timestamp; } + + /// + /// Fork activation for forks past The Merge/Paris + /// + /// Timestamp of the fork or check + /// Post merge fork activation + /// + /// Post Merge are based only on timestamp and we can ignore block number. + /// + public static ForkActivation TimestampOnly(ulong timestamp) => new(long.MaxValue, timestamp); + public void Deconstruct(out long blockNumber, out ulong? timestamp) { blockNumber = BlockNumber; @@ -30,60 +41,28 @@ public static implicit operator ForkActivation((long blocknumber, ulong? timesta public static implicit operator (long blocknumber, ulong? timestamp)(ForkActivation forkActivation) => (forkActivation.BlockNumber, forkActivation.Timestamp); - public bool Equals(ForkActivation other) - { - return BlockNumber == other.BlockNumber && Timestamp == other.Timestamp; - } + public bool Equals(ForkActivation other) => BlockNumber == other.BlockNumber && Timestamp == other.Timestamp; - public override bool Equals(object? obj) - { - return obj is ForkActivation other && Equals(other); - } + public override bool Equals(object? obj) => obj is ForkActivation other && Equals(other); - public override int GetHashCode() - { - return HashCode.Combine(BlockNumber, Timestamp); - } + public override int GetHashCode() => HashCode.Combine(BlockNumber, Timestamp); - public override string ToString() - { - return $"{BlockNumber} {Timestamp}"; - } + public override string ToString() => $"{BlockNumber} {Timestamp}"; - public int CompareTo(ForkActivation other) - { - return Timestamp is null || other.Timestamp is null + public int CompareTo(ForkActivation other) => + Timestamp is null || other.Timestamp is null ? BlockNumber.CompareTo(other.BlockNumber) : Timestamp.Value.CompareTo(other.Timestamp.Value); - } - public static bool operator ==(ForkActivation first, ForkActivation second) - { - return first.Equals(second); - } + public static bool operator ==(ForkActivation first, ForkActivation second) => first.Equals(second); - public static bool operator !=(ForkActivation first, ForkActivation second) - { - return !first.Equals(second); - } + public static bool operator !=(ForkActivation first, ForkActivation second) => !first.Equals(second); - public static bool operator <(ForkActivation first, ForkActivation second) - { - return first.CompareTo(second) < 0; - } + public static bool operator <(ForkActivation first, ForkActivation second) => first.CompareTo(second) < 0; - public static bool operator >(ForkActivation first, ForkActivation second) - { - return first.CompareTo(second) > 0; - } + public static bool operator >(ForkActivation first, ForkActivation second) => first.CompareTo(second) > 0; - public static bool operator <=(ForkActivation first, ForkActivation second) - { - return first.CompareTo(second) <= 0; - } + public static bool operator <=(ForkActivation first, ForkActivation second) => first.CompareTo(second) <= 0; - public static bool operator >=(ForkActivation first, ForkActivation second) - { - return first.CompareTo(second) >= 0; - } + public static bool operator >=(ForkActivation first, ForkActivation second) => first.CompareTo(second) >= 0; } diff --git a/src/Nethermind/Nethermind.Merge.Plugin/Data/ExecutionPayload.cs b/src/Nethermind/Nethermind.Merge.Plugin/Data/ExecutionPayload.cs index 1f75a1746e9..2fe53122c96 100644 --- a/src/Nethermind/Nethermind.Merge.Plugin/Data/ExecutionPayload.cs +++ b/src/Nethermind/Nethermind.Merge.Plugin/Data/ExecutionPayload.cs @@ -3,9 +3,11 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using Nethermind.Core; using Nethermind.Core.Crypto; +using Nethermind.Core.Specs; using Nethermind.Int256; using Nethermind.Serialization.Rlp; using Nethermind.State.Proofs; @@ -144,3 +146,36 @@ public void SetTransactions(params Transaction[] transactions) => Transactions = public override string ToString() => $"{BlockNumber} ({BlockHash})"; } + +public static class ExecutionPayloadVersioningExtensions +{ + public static int GetVersion(this ExecutionPayload executionPayload) => + executionPayload.Withdrawals is null ? 1 : 2; + + public static bool Validate( + this ExecutionPayload executionPayload, + IReleaseSpec spec, + int version, + [NotNullWhen(false)] out string? error) + { + int actualVersion = executionPayload.GetVersion(); + + error = actualVersion switch + { + 1 when spec.WithdrawalsEnabled => "ExecutionPayloadV2 expected", + > 1 when !spec.WithdrawalsEnabled => "ExecutionPayloadV1 expected", + _ => actualVersion > version ? $"ExecutionPayloadV{version} expected" : null + }; + + return error is null; + } + + public static bool Validate(this ExecutionPayload executionPayload, + ISpecProvider specProvider, + int version, + [NotNullWhen(false)] out string? error) => + executionPayload.Validate( + specProvider.GetSpec(executionPayload.BlockNumber, executionPayload.Timestamp), + version, + out error); +} diff --git a/src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.Paris.cs b/src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.Paris.cs new file mode 100644 index 00000000000..6a2189736d8 --- /dev/null +++ b/src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.Paris.cs @@ -0,0 +1,102 @@ +// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited +// SPDX-License-Identifier: LGPL-3.0-only + +using System; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using Nethermind.Consensus.Producers; +using Nethermind.Core.Crypto; +using Nethermind.Core.Specs; +using Nethermind.JsonRpc; +using Nethermind.Logging; +using Nethermind.Merge.Plugin.Data; +using Nethermind.Merge.Plugin.Handlers; + +namespace Nethermind.Merge.Plugin +{ + public partial class EngineRpcModule : IEngineRpcModule + { + private readonly IAsyncHandler _getPayloadHandlerV1; + private readonly IAsyncHandler _newPayloadV1Handler; + private readonly IForkchoiceUpdatedHandler _forkchoiceUpdatedV1Handler; + private readonly IHandler _transitionConfigurationHandler; + private readonly SemaphoreSlim _locker = new(1, 1); + private readonly TimeSpan _timeout = TimeSpan.FromSeconds(8); + + public Task> engine_getPayloadV1(byte[] payloadId) => + _getPayloadHandlerV1.HandleAsync(payloadId); + + public async Task> engine_newPayloadV1(ExecutionPayload executionPayload) + => await NewPayload(executionPayload, 1); + + public async Task> engine_forkchoiceUpdatedV1(ForkchoiceStateV1 forkchoiceState, PayloadAttributes? payloadAttributes = null) + => await ForkchoiceUpdated(forkchoiceState, payloadAttributes, 1); + + public ResultWrapper engine_exchangeTransitionConfigurationV1( + TransitionConfigurationV1 beaconTransitionConfiguration) => _transitionConfigurationHandler.Handle(beaconTransitionConfiguration); + + private async Task> ForkchoiceUpdated(ForkchoiceStateV1 forkchoiceState, PayloadAttributes? payloadAttributes, int version) + { + if (payloadAttributes?.Validate(_specProvider, version, out string? error) == false) + { + if (_logger.IsWarn) _logger.Warn(error); + return ResultWrapper.Fail(error, ErrorCodes.InvalidParams); + } + + if (await _locker.WaitAsync(_timeout)) + { + Stopwatch watch = Stopwatch.StartNew(); + try + { + return await _forkchoiceUpdatedV1Handler.Handle(forkchoiceState, payloadAttributes); + } + finally + { + watch.Stop(); + Metrics.ForkchoiceUpdedExecutionTime = watch.ElapsedMilliseconds; + _locker.Release(); + } + } + else + { + if (_logger.IsWarn) _logger.Warn($"engine_forkchoiceUpdated{version} timed out"); + return ResultWrapper.Fail("Timed out", ErrorCodes.Timeout); + } + } + + private async Task> NewPayload(ExecutionPayload executionPayload, int version) + { + if (!executionPayload.Validate(_specProvider, version, out string? error)) + { + if (_logger.IsWarn) _logger.Warn(error); + return ResultWrapper.Fail(error, ErrorCodes.InvalidParams); + } + + if (await _locker.WaitAsync(_timeout)) + { + Stopwatch watch = Stopwatch.StartNew(); + try + { + return await _newPayloadV1Handler.HandleAsync(executionPayload); + } + catch (Exception exception) + { + if (_logger.IsError) _logger.Error($"engine_newPayloadV{version} failed: {exception}"); + return ResultWrapper.Fail(exception.Message); + } + finally + { + watch.Stop(); + Metrics.NewPayloadExecutionTime = watch.ElapsedMilliseconds; + _locker.Release(); + } + } + else + { + if (_logger.IsWarn) _logger.Warn($"engine_newPayloadV{version} timed out"); + return ResultWrapper.Fail("Timed out", ErrorCodes.Timeout); + } + } + } +} diff --git a/src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.Shanghai.cs b/src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.Shanghai.cs new file mode 100644 index 00000000000..f9b7b576cf1 --- /dev/null +++ b/src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.Shanghai.cs @@ -0,0 +1,31 @@ +// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited +// SPDX-License-Identifier: LGPL-3.0-only + +using System; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using Nethermind.Consensus.Producers; +using Nethermind.Core.Crypto; +using Nethermind.Core.Specs; +using Nethermind.JsonRpc; +using Nethermind.Logging; +using Nethermind.Merge.Plugin.Data; +using Nethermind.Merge.Plugin.Handlers; + +namespace Nethermind.Merge.Plugin +{ + public partial class EngineRpcModule : IEngineRpcModule + { + private readonly IAsyncHandler _getPayloadHandlerV2; + + public async Task> engine_getPayloadV2(byte[] payloadId) => + await _getPayloadHandlerV2.HandleAsync(payloadId); + + public Task> engine_newPayloadV2(ExecutionPayload executionPayload) + => NewPayload(executionPayload, 2); + + public Task> engine_forkchoiceUpdatedV2(ForkchoiceStateV1 forkchoiceState, PayloadAttributes? payloadAttributes = null) + => ForkchoiceUpdated(forkchoiceState, payloadAttributes, 2); + } +} diff --git a/src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.cs b/src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.cs index 9fb046e01e5..c468a979e28 100644 --- a/src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.cs +++ b/src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.cs @@ -15,18 +15,11 @@ namespace Nethermind.Merge.Plugin { - public class EngineRpcModule : IEngineRpcModule + public partial class EngineRpcModule : IEngineRpcModule { - private readonly IAsyncHandler _getPayloadHandlerV1; - private readonly IAsyncHandler _getPayloadHandlerV2; - private readonly IAsyncHandler _newPayloadV1Handler; - private readonly IForkchoiceUpdatedHandler _forkchoiceUpdatedV1Handler; private readonly IHandler _executionStatusHandler; private readonly IAsyncHandler _executionGetPayloadBodiesByHashV1Handler; private readonly IGetPayloadBodiesByRangeV1Handler _executionGetPayloadBodiesByRangeV1Handler; - private readonly IHandler _transitionConfigurationHandler; - private readonly SemaphoreSlim _locker = new(1, 1); - private readonly TimeSpan _timeout = TimeSpan.FromSeconds(8); private readonly ISpecProvider _specProvider; private readonly ILogger _logger; @@ -56,117 +49,6 @@ public EngineRpcModule( public ResultWrapper engine_executionStatus() => _executionStatusHandler.Handle(); - public Task> engine_getPayloadV1(byte[] payloadId) => - _getPayloadHandlerV1.HandleAsync(payloadId); - - public async Task> engine_getPayloadV2(byte[] payloadId) => - await _getPayloadHandlerV2.HandleAsync(payloadId); - - public async Task> engine_newPayloadV1(ExecutionPayload executionPayload) - { - if (executionPayload.Withdrawals is not null) - { - var error = "ExecutionPayloadV1 expected"; - - if (_logger.IsWarn) _logger.Warn(error); - - return ResultWrapper.Fail(error, ErrorCodes.InvalidParams); - } - - return await NewPayload(executionPayload, nameof(engine_newPayloadV1)); - } - - public Task> engine_newPayloadV2(ExecutionPayload executionPayload) - { - var spec = _specProvider.GetSpec((executionPayload.BlockNumber, executionPayload.Timestamp)); - string? error = null; - - if (spec.WithdrawalsEnabled && executionPayload.Withdrawals is null) - error = "ExecutionPayloadV2 expected"; - else if (!spec.WithdrawalsEnabled && executionPayload.Withdrawals is not null) - error = "ExecutionPayloadV1 expected"; - - if (error is not null) - { - if (_logger.IsWarn) _logger.Warn(error); - - return ResultWrapper.Fail(error, ErrorCodes.InvalidParams); - } - - return NewPayload(executionPayload, nameof(engine_newPayloadV2)); - } - - public async Task> engine_forkchoiceUpdatedV1(ForkchoiceStateV1 forkchoiceState, PayloadAttributes? payloadAttributes = null) - { - if (payloadAttributes?.Withdrawals is not null) - { - var error = "PayloadAttributesV1 expected"; - - if (_logger.IsWarn) _logger.Warn(error); - - return ResultWrapper.Fail(error, ErrorCodes.InvalidParams); - } - - return await ForkchoiceUpdated(forkchoiceState, payloadAttributes, nameof(engine_forkchoiceUpdatedV1)); - } - - public Task> engine_forkchoiceUpdatedV2(ForkchoiceStateV1 forkchoiceState, PayloadAttributes? payloadAttributes = null) - => ForkchoiceUpdated(forkchoiceState, payloadAttributes, nameof(engine_forkchoiceUpdatedV2)); - - public ResultWrapper engine_exchangeTransitionConfigurationV1( - TransitionConfigurationV1 beaconTransitionConfiguration) => _transitionConfigurationHandler.Handle(beaconTransitionConfiguration); - - private async Task> ForkchoiceUpdated(ForkchoiceStateV1 forkchoiceState, PayloadAttributes? payloadAttributes, string methodName) - { - if (await _locker.WaitAsync(_timeout)) - { - Stopwatch watch = Stopwatch.StartNew(); - try - { - return await _forkchoiceUpdatedV1Handler.Handle(forkchoiceState, payloadAttributes); - } - finally - { - watch.Stop(); - Metrics.ForkchoiceUpdedExecutionTime = watch.ElapsedMilliseconds; - _locker.Release(); - } - } - else - { - if (_logger.IsWarn) _logger.Warn($"{methodName} timed out"); - return ResultWrapper.Fail("Timed out", ErrorCodes.Timeout); - } - } - - private async Task> NewPayload(ExecutionPayload executionPayload, string methodName) - { - if (await _locker.WaitAsync(_timeout)) - { - Stopwatch watch = Stopwatch.StartNew(); - try - { - return await _newPayloadV1Handler.HandleAsync(executionPayload); - } - catch (Exception exception) - { - if (_logger.IsError) _logger.Error($"{methodName} failed: {exception}"); - return ResultWrapper.Fail(exception.Message); - } - finally - { - watch.Stop(); - Metrics.NewPayloadExecutionTime = watch.ElapsedMilliseconds; - _locker.Release(); - } - } - else - { - if (_logger.IsWarn) _logger.Warn($"{methodName} timed out"); - return ResultWrapper.Fail("Timed out", ErrorCodes.Timeout); - } - } - public async Task> engine_getPayloadBodiesByHashV1(Keccak[] blockHashes) { return await _executionGetPayloadBodiesByHashV1Handler.HandleAsync(blockHashes); diff --git a/src/Nethermind/Nethermind.Merge.Plugin/Handlers/ForkchoiceUpdatedHandler.cs b/src/Nethermind/Nethermind.Merge.Plugin/Handlers/ForkchoiceUpdatedHandler.cs index a1603d3edfb..07a9727a6fe 100644 --- a/src/Nethermind/Nethermind.Merge.Plugin/Handlers/ForkchoiceUpdatedHandler.cs +++ b/src/Nethermind/Nethermind.Merge.Plugin/Handlers/ForkchoiceUpdatedHandler.cs @@ -235,26 +235,6 @@ public Task> Handle(ForkchoiceStateV1 f return ForkchoiceUpdatedV1Result.Error(error, MergeErrorCodes.InvalidPayloadAttributes); } - var spec = _specProvider.GetSpec(newHeadBlock.Number + 1, payloadAttributes.Timestamp); - - if (spec.WithdrawalsEnabled && payloadAttributes.Withdrawals is null) - { - var error = "PayloadAttributesV2 expected"; - - if (_logger.IsInfo) _logger.Warn($"Invalid payload attributes: {error}"); - - return ForkchoiceUpdatedV1Result.Error(error, ErrorCodes.InvalidParams); - } - - if (!spec.WithdrawalsEnabled && payloadAttributes.Withdrawals is not null) - { - var error = "PayloadAttributesV1 expected"; - - if (_logger.IsInfo) _logger.Warn($"Invalid payload attributes: {error}"); - - return ForkchoiceUpdatedV1Result.Error(error, ErrorCodes.InvalidParams); - } - payloadAttributes.GasLimit = null; payloadId = _payloadPreparationService.StartPreparingPayload(newHeadBlock.Header, payloadAttributes); } diff --git a/src/Nethermind/Nethermind.Merge.Plugin/IEngineRpcModule.Paris.cs b/src/Nethermind/Nethermind.Merge.Plugin/IEngineRpcModule.Paris.cs new file mode 100644 index 00000000000..afa90d9c1c9 --- /dev/null +++ b/src/Nethermind/Nethermind.Merge.Plugin/IEngineRpcModule.Paris.cs @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited +// SPDX-License-Identifier: LGPL-3.0-only + +using System.Threading.Tasks; +using Nethermind.Consensus.Producers; +using Nethermind.Core.Crypto; +using Nethermind.JsonRpc; +using Nethermind.JsonRpc.Modules; +using Nethermind.Merge.Plugin.Data; + +namespace Nethermind.Merge.Plugin +{ + public partial interface IEngineRpcModule : IRpcModule + { + [JsonRpcMethod( + Description = "Returns the most recent version of an execution payload with respect to the transaction set contained by the mempool.", + IsSharable = true, + IsImplemented = true)] + Task> engine_getPayloadV1(byte[] payloadId); + + [JsonRpcMethod( + Description = "Verifies the payload according to the execution environment rules and returns the verification status and hash of the last valid block.", + IsSharable = true, + IsImplemented = true)] + Task> engine_newPayloadV1(ExecutionPayload executionPayload); + + [JsonRpcMethod( + Description = "Verifies the payload according to the execution environment rules and returns the verification status and hash of the last valid block.", + IsSharable = true, + IsImplemented = true)] + Task> engine_forkchoiceUpdatedV1(ForkchoiceStateV1 forkchoiceState, PayloadAttributes? payloadAttributes = null); + + [JsonRpcMethod( + Description = "Returns PoS transition configuration.", + IsSharable = true, + IsImplemented = true)] + ResultWrapper engine_exchangeTransitionConfigurationV1(TransitionConfigurationV1 beaconTransitionConfiguration); + } +} diff --git a/src/Nethermind/Nethermind.Merge.Plugin/IEngineRpcModule.Shanghai.cs b/src/Nethermind/Nethermind.Merge.Plugin/IEngineRpcModule.Shanghai.cs new file mode 100644 index 00000000000..142566226fc --- /dev/null +++ b/src/Nethermind/Nethermind.Merge.Plugin/IEngineRpcModule.Shanghai.cs @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited +// SPDX-License-Identifier: LGPL-3.0-only + +using System.Threading.Tasks; +using Nethermind.Consensus.Producers; +using Nethermind.Core.Crypto; +using Nethermind.JsonRpc; +using Nethermind.JsonRpc.Modules; +using Nethermind.Merge.Plugin.Data; + +namespace Nethermind.Merge.Plugin +{ + public partial interface IEngineRpcModule : IRpcModule + { + [JsonRpcMethod( + Description = "Returns the most recent version of an execution payload and fees with respect to the transaction set contained by the mempool.", + IsSharable = true, + IsImplemented = true)] + public Task> engine_getPayloadV2(byte[] payloadId); + + [JsonRpcMethod( + Description = "Verifies the payload according to the execution environment rules and returns the verification status and hash of the last valid block.", + IsSharable = true, + IsImplemented = true)] + Task> engine_newPayloadV2(ExecutionPayload executionPayload); + + [JsonRpcMethod( + Description = "Verifies the payload according to the execution environment rules and returns the verification status and hash of the last valid block.", + IsSharable = true, + IsImplemented = true)] + Task> engine_forkchoiceUpdatedV2(ForkchoiceStateV1 forkchoiceState, PayloadAttributes? payloadAttributes = null); + } +} diff --git a/src/Nethermind/Nethermind.Merge.Plugin/IEngineRpcModule.cs b/src/Nethermind/Nethermind.Merge.Plugin/IEngineRpcModule.cs index 5a2fc75c07b..f2e4d186774 100644 --- a/src/Nethermind/Nethermind.Merge.Plugin/IEngineRpcModule.cs +++ b/src/Nethermind/Nethermind.Merge.Plugin/IEngineRpcModule.cs @@ -11,7 +11,7 @@ namespace Nethermind.Merge.Plugin { [RpcModule(ModuleType.Engine)] - public interface IEngineRpcModule : IRpcModule + public partial interface IEngineRpcModule : IRpcModule { [JsonRpcMethod( Description = @@ -20,42 +20,6 @@ public interface IEngineRpcModule : IRpcModule IsImplemented = true)] ResultWrapper engine_executionStatus(); - [JsonRpcMethod( - Description = "Returns the most recent version of an execution payload with respect to the transaction set contained by the mempool.", - IsSharable = true, - IsImplemented = true)] - Task> engine_getPayloadV1(byte[] payloadId); - - [JsonRpcMethod( - Description = "Returns the most recent version of an execution payload and fees with respect to the transaction set contained by the mempool.", - IsSharable = true, - IsImplemented = true)] - public Task> engine_getPayloadV2(byte[] payloadId); - - [JsonRpcMethod( - Description = "Verifies the payload according to the execution environment rules and returns the verification status and hash of the last valid block.", - IsSharable = true, - IsImplemented = true)] - Task> engine_newPayloadV1(ExecutionPayload executionPayload); - - [JsonRpcMethod( - Description = "Verifies the payload according to the execution environment rules and returns the verification status and hash of the last valid block.", - IsSharable = true, - IsImplemented = true)] - Task> engine_newPayloadV2(ExecutionPayload executionPayload); - - [JsonRpcMethod( - Description = "Verifies the payload according to the execution environment rules and returns the verification status and hash of the last valid block.", - IsSharable = true, - IsImplemented = true)] - Task> engine_forkchoiceUpdatedV1(ForkchoiceStateV1 forkchoiceState, PayloadAttributes? payloadAttributes = null); - - [JsonRpcMethod( - Description = "Verifies the payload according to the execution environment rules and returns the verification status and hash of the last valid block.", - IsSharable = true, - IsImplemented = true)] - Task> engine_forkchoiceUpdatedV2(ForkchoiceStateV1 forkchoiceState, PayloadAttributes? payloadAttributes = null); - [JsonRpcMethod( Description = "Returns an array of execution payload bodies for the list of provided block hashes.", IsSharable = true, @@ -67,11 +31,5 @@ public interface IEngineRpcModule : IRpcModule IsSharable = true, IsImplemented = true)] Task> engine_getPayloadBodiesByRangeV1(long start, long count); - - [JsonRpcMethod( - Description = "Returns PoS transition configuration.", - IsSharable = true, - IsImplemented = true)] - ResultWrapper engine_exchangeTransitionConfigurationV1(TransitionConfigurationV1 beaconTransitionConfiguration); } }