Skip to content

Commit 4877b46

Browse files
committed
Revert "check requests type validity (#8175)"
This reverts commit 081fdc4.
1 parent 292214d commit 4877b46

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Nethermind/Nethermind.Core/ExecutionRequest/ExecutionRequestExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ public static int GetRequestsByteSize(this IEnumerable<ExecutionRequest> request
3737
public static Hash256 CalculateHashFromFlatEncodedRequests(byte[][]? flatEncodedRequests)
3838
{
3939
// make sure that length is 3 or less elements
40-
if (flatEncodedRequests is null)
40+
if (flatEncodedRequests is null || flatEncodedRequests.Length > MaxRequestsCount)
4141
{
42-
throw new ArgumentException("Flat encoded requests must be an array");
42+
throw new ArgumentException("Flat encoded requests must be an array of 3 or less elements");
4343
}
4444

4545
using SHA256 sha256 = SHA256.Create();

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// SPDX-FileCopyrightText: 2023 Demerzel Solutions Limited
22
// SPDX-License-Identifier: LGPL-3.0-only
33

4-
using System;
54
using System.Collections.Generic;
65
using System.Linq;
76
using Nethermind.Core;
@@ -49,6 +48,12 @@ public ValidationResult ValidateParams(IReleaseSpec spec, int version, out strin
4948
return ValidationResult.Fail;
5049
}
5150

51+
if (ExecutionRequests.Length > ExecutionRequestExtensions.MaxRequestsCount)
52+
{
53+
error = $"Execution requests must have less than {ExecutionRequestExtensions.MaxRequestsCount} items";
54+
return ValidationResult.Fail;
55+
}
56+
5257
// verification of the requests
5358
for (int i = 0; i < ExecutionRequests.Length; i++)
5459
{

0 commit comments

Comments
 (0)