Skip to content

feat: add limit for batch request and response size #249

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

mmsqe
Copy link
Contributor

@mmsqe mmsqe commented Jun 26, 2025

Description

  • align batch-request-limit config to enforces the maximum number of requests per batch and prevents abuse by oversized batch requests
  • align batch-response-max-size config to allow server should reject the batch or truncate the response, returning an error or partial result indicating the response size limit was exceeded.

Closes: #241, for test info


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

Reviewers Checklist

All items are required.
Please add a note if the item is not applicable
and please add your handle next to the items reviewed
if you only reviewed selected items.

I have...

  • added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • confirmed all author checklist items have been addressed
  • confirmed that this PR does not change production code
  • reviewed content
  • tested instructions (if applicable)
  • confirmed all CI checks have passed

Copy link
Member

@vladjdk vladjdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, thank you for the contribution.

Similar to other PRs, could you add a more thorough description here and in the issue of the problem and your solution? The reference was helpful for context, but the PR you referenced is different from the changes you made here.

@mmsqe mmsqe changed the title feat: add limit for eth_call return value feat: add limit for batch request and response size Jun 28, 2025
@mmsqe mmsqe requested a review from vladjdk June 30, 2025 01:38
@@ -369,10 +369,6 @@ func (b *Backend) DoCall(
if err != nil {
return nil, err
}
length := len(res.Ret)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you removed this by mistake in the latest commits :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert the space, no change for this file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, I see, the restriction is now happening on the geth side. Lgtm!

@@ -369,7 +369,6 @@ func (b *Backend) DoCall(
if err != nil {
return nil, err
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add back the code here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: no response too large limit for batch call
3 participants