File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
src/Nethermind/Nethermind.JsonRpc Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -111,5 +111,10 @@ public static class ErrorCodes
111
111
/// Invalid RPC simulate call transaction
112
112
/// </summary>
113
113
public const int InvalidTransaction = - 38014 ;
114
+
115
+ /// <summary>
116
+ /// Too many blocks for simulation
117
+ /// </summary>
118
+ public const int ClientLimitExceededError = - 38026 ;
114
119
}
115
120
}
Original file line number Diff line number Diff line change @@ -143,6 +143,11 @@ public override ResultWrapper<IReadOnlyList<SimulateBlockResult>> Execute(
143
143
return ResultWrapper < IReadOnlyList < SimulateBlockResult > > . Fail (
144
144
$ "Block number out of order { givenNumber } is < than given base number of { header . Number } !", ErrorCodes . InvalidInputBlocksOutOfOrder ) ;
145
145
146
+ // if the no. of filler blocks are greater than maximum simulate blocks cap
147
+ if ( givenNumber - ( ulong ) lastBlockNumber > ( ulong ) _blocksLimit )
148
+ return ResultWrapper < IReadOnlyList < SimulateBlockResult > > . Fail (
149
+ $ "too many blocks",
150
+ ErrorCodes . ClientLimitExceededError ) ;
146
151
147
152
for ( ulong fillBlockNumber = ( ulong ) lastBlockNumber + 1 ; fillBlockNumber < givenNumber ; fillBlockNumber ++ )
148
153
{
You can’t perform that action at this time.
0 commit comments