EVM-779 Debug Transaction endpoint - throttling #1818
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Implement throttling for debug (transaction) endpoint(s). There should be some limit of number of requests per seconds allowed for those.
By default this limit is set to 5. It can be changed by
--requests-per-second-debug
server flagThis functionality has been added because debug endpoints are heavy in processing/memory consumption and that can lead to node crashing. By implementing throttling, clients can limit the frequency of these resource-intensive calls, helping to ensure the stability and uptime of the node.
Changes include
Checklist
Testing
Manual tests
Start cluster, deploy smart contract(s) and transaction that calls some of those sc.
0x09e60436fc2344c03ef2c721dcb179d2e9cb4cecf535f1217f25abe24ea37dc6
is hash of that transaction and that is the tx you want to debug.Try to execute following endpoint request more than five times. First five times you should retrieve answer, sixth time you should retrieve error.