EVM Node: Allow to limit the maximum size of a JSON RPC API batch

The JSON RPC API is a funny beast, which allow in a single HTTP Request to perform any call to the API. This can be a problem when these calls are computationally significant. In order to mitigate risks when this happens, we introduce a new configuration parameter that allows to set a bound on the size of one batch.

The current behavior is as follows: if a batch is larger than the authorized limit, then all the calls fail. To be compliant with the JSON RPC API specification, we return one failure per call, and they all have the same error. We might want to revisit this to allow at most N calls, where N is the limit authorized.

Manually testing the MR

dune exec -- etherlink/tezt/tests/main.exe --verbose --file etherlink/tezt/tests/evm_sequencer.ml batch_limit alpha latest /dal /threshold_encryption alpha

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR
Edited by Thomas Letan

Merge request reports

Loading