Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EVM-779 Debug Transaction endpoint - throttling #1818

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

igorcrevar
Copy link
Contributor

@igorcrevar igorcrevar commented Aug 16, 2023

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 flag

This 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

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

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.

[{
	"jsonrpc":"2.0",
	"method":"debug_traceTransaction",
	"params":[
        "0x09e60436fc2344c03ef2c721dcb179d2e9cb4cecf535f1217f25abe24ea37dc6",
        {
            "timeout": "30s",
            "disableStack": false,
            "disableStorage": false,
            "enableMemory": true,
            "enableReturnData": true
        }
	],
	"id":1
}]

@igorcrevar igorcrevar added the feature New update to Polygon Edge label Aug 16, 2023
@igorcrevar igorcrevar requested a review from a team August 16, 2023 08:22
@igorcrevar igorcrevar self-assigned this Aug 16, 2023
@igorcrevar igorcrevar merged commit 689e360 into develop Aug 16, 2023
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New update to Polygon Edge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants