Skip to content

Commit 6cb8492

Browse files
committed
Revert "requests validation hotfix (#8156)"
This reverts commit 471d181.
1 parent 4877b46 commit 6cb8492

File tree

2 files changed

+2
-51
lines changed

2 files changed

+2
-51
lines changed

src/Nethermind/Nethermind.Merge.Plugin.Test/EngineModuleTests.V4.cs

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -200,39 +200,6 @@ public async Task NewPayloadV4_reject_payload_with_bad_authorization_list_rlp()
200200
Assert.That(response.Data.Status, Is.EqualTo("INVALID"));
201201
}
202202

203-
[Test]
204-
public async Task NewPayloadV4_reject_payload_with_bad_execution_requests()
205-
{
206-
ExecutionRequestsProcessorMock executionRequestsProcessorMock = new();
207-
using MergeTestBlockchain chain = await CreateBlockchain(Prague.Instance, null, null, null, executionRequestsProcessorMock);
208-
IEngineRpcModule rpc = CreateEngineModule(chain);
209-
Hash256 lastHash = (await ProduceBranchV4(rpc, chain, 10, CreateParentBlockRequestOnHead(chain.BlockTree), true, withRequests: true))
210-
.LastOrDefault()?.BlockHash ?? Keccak.Zero;
211-
212-
Block TestBlock = Build.A.Block.WithNumber(chain.BlockTree.Head!.Number + 1).TestObject;
213-
ExecutionPayloadV3 executionPayload = ExecutionPayloadV3.Create(TestBlock);
214-
215-
// must reject if execution requests types are not in ascending order
216-
var response = await rpc.engine_newPayloadV4(
217-
executionPayload,
218-
[],
219-
TestBlock.ParentBeaconBlockRoot,
220-
executionRequests: [Bytes.FromHexString("0x0001"), Bytes.FromHexString("0x0101"), Bytes.FromHexString("0x0101")]
221-
);
222-
223-
Assert.That(response.ErrorCode, Is.EqualTo(ErrorCodes.InvalidParams));
224-
225-
//must reject if one of the execution requests size is <= 1 byte
226-
response = await rpc.engine_newPayloadV4(
227-
executionPayload,
228-
[],
229-
TestBlock.ParentBeaconBlockRoot,
230-
executionRequests: [Bytes.FromHexString("0x0001"), Bytes.FromHexString("0x01"), Bytes.FromHexString("0x0101")]
231-
);
232-
233-
Assert.That(response.ErrorCode, Is.EqualTo(ErrorCodes.InvalidParams));
234-
}
235-
236203
[TestCase(30)]
237204
public async Task can_progress_chain_one_by_one_v4(int count)
238205
{
@@ -280,7 +247,7 @@ private async Task<IReadOnlyList<ExecutionPayload>> ProduceBranchV4(IEngineRpcMo
280247
ExecutionPayloadV3? getPayloadResult = await BuildAndGetPayloadOnBranchV4(rpc, chain, parentHeader,
281248
parentBlock.Timestamp + 12,
282249
random ?? TestItem.KeccakA, Address.Zero);
283-
PayloadStatusV1 payloadStatusResponse = (await rpc.engine_newPayloadV4(getPayloadResult, [], Keccak.Zero, executionRequests: withRequests ? ExecutionRequestsProcessorMock.Requests : new byte[][] { })).Data;
250+
PayloadStatusV1 payloadStatusResponse = (await rpc.engine_newPayloadV4(getPayloadResult, [], Keccak.Zero, executionRequests: withRequests ? ExecutionRequestsProcessorMock.Requests : new byte[][] { [], [], [] })).Data;
284251
payloadStatusResponse.Status.Should().Be(PayloadStatus.Valid);
285252
if (setHead)
286253
{

src/Nethermind/Nethermind.Merge.Plugin/Data/IExecutionPayloadParams.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,7 @@ public ValidationResult ValidateParams(IReleaseSpec spec, int version, out strin
5151
if (ExecutionRequests.Length > ExecutionRequestExtensions.MaxRequestsCount)
5252
{
5353
error = $"Execution requests must have less than {ExecutionRequestExtensions.MaxRequestsCount} items";
54-
return ValidationResult.Fail;
55-
}
56-
57-
// verification of the requests
58-
for (int i = 0; i < ExecutionRequests.Length; i++)
59-
{
60-
if (ExecutionRequests[i] == null || ExecutionRequests[i].Length <= 1)
61-
{
62-
error = "Execution request data must be longer than 1 byte";
63-
return ValidationResult.Fail;
64-
}
65-
66-
if (i > 0 && ExecutionRequests[i][0] <= ExecutionRequests[i - 1][0])
67-
{
68-
error = "Execution requests must not contain duplicates and be ordered by request_type in ascending order";
69-
return ValidationResult.Fail;
70-
}
54+
return ValidationResult.Invalid;
7155
}
7256

7357
}

0 commit comments

Comments
 (0)