-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
129 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/Nethermind/Nethermind.Merge.Plugin/Data/ExecutionPayloadV4.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
using Nethermind.Core.Specs; | ||
|
||
namespace Nethermind.Merge.Plugin.Data; | ||
|
||
/// <summary> | ||
/// Represent an object mapping the <c>ExecutionPayloadV4</c> structure of the beacon chain spec. | ||
/// </summary> | ||
public class ExecutionPayloadV4: ExecutionPayloadV3 | ||
{ | ||
public override bool ValidateFork(ISpecProvider specProvider) => | ||
specProvider.GetSpec(BlockNumber, Timestamp).IsEip7547Enabled; | ||
} |
26 changes: 26 additions & 0 deletions
26
src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.InclusionList.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited | ||
// SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
using System.Threading.Tasks; | ||
using Nethermind.Consensus; | ||
using Nethermind.Consensus.Producers; | ||
using Nethermind.Core.Crypto; | ||
using Nethermind.JsonRpc; | ||
using Nethermind.Merge.Plugin.Data; | ||
using Nethermind.Merge.Plugin.Handlers; | ||
|
||
namespace Nethermind.Merge.Plugin; | ||
|
||
public partial class EngineRpcModule : IEngineRpcModule | ||
{ | ||
private readonly IAsyncHandler<byte[], GetPayloadV3Result?> _getPayloadHandlerV4; | ||
Check failure on line 16 in src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.InclusionList.cs GitHub Actions / Build (release, Nethermind)
Check failure on line 16 in src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.InclusionList.cs GitHub Actions / Build (release, Nethermind)
Check failure on line 16 in src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.InclusionList.cs GitHub Actions / Build (debug, Nethermind)
|
||
|
||
public Task<ResultWrapper<ForkchoiceUpdatedV1Result>> engine_forkchoiceUpdatedV4(ForkchoiceStateV1 forkchoiceState, PayloadAttributes? payloadAttributes = null) | ||
=> ForkchoiceUpdated(forkchoiceState, payloadAttributes, EngineApiVersions.Cancun); | ||
|
||
public Task<ResultWrapper<PayloadStatusV1>> engine_newPayloadV4(ExecutionPayloadV4 executionPayload, byte[]?[] blobVersionedHashes, Hash256? parentBeaconBlockRoot) => | ||
NewPayload(new ExecutionPayloadV3Params(executionPayload, blobVersionedHashes, parentBeaconBlockRoot), EngineApiVersions.Cancun); | ||
|
||
public async Task<ResultWrapper<GetPayloadV3Result?>> engine_getPayloadV4(byte[] payloadId) => | ||
await _getPayloadHandlerV4.HandleAsync(payloadId); | ||
} |
33 changes: 33 additions & 0 deletions
33
src/Nethermind/Nethermind.Merge.Plugin/IEngineRpcModule.InclusionList.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = "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<ResultWrapper<ForkchoiceUpdatedV1Result>> engine_forkchoiceUpdatedV4(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<ResultWrapper<PayloadStatusV1>> engine_newPayloadV4(ExecutionPayloadV4 executionPayload, byte[]?[] blobVersionedHashes, Hash256? parentBeaconBlockRoot); | ||
|
||
[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<ResultWrapper<GetPayloadV3Result?>> engine_getPayloadV4(byte[] payloadId); | ||
} |