Skip to content

feat(consumer): add configurable batch request size limit#2193

Merged
nimrod-teich merged 1 commit into
mainfrom
feat/limits_batch_request_size
Jan 21, 2026
Merged

feat(consumer): add configurable batch request size limit#2193
nimrod-teich merged 1 commit into
mainfrom
feat/limits_batch_request_size

Conversation

@NadavLevi

@NadavLevi NadavLevi commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

Add a configurable limit for the number of requests allowed within a batch request on the rpcconsumer and rpcsmartrouter side. When a batch exceeds the configured limit, a 429 rate limit error is returned immediately.

  • Add --max-batch-request-size flag (default: 0 = unlimited)
  • Return HTTP 429 with JSON-RPC error when limit exceeded
  • Support both JSON-RPC and Tendermint RPC interfaces

Description

Closes: #XXXX


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...

  • read the contribution guide
  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the main branch
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

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...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

@codecov

codecov Bot commented Jan 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.55556% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
protocol/chainlib/jsonRPC.go 62.50% 3 Missing ⚠️
protocol/chainlib/tendermintRPC.go 62.50% 3 Missing ⚠️
protocol/rpcconsumer/rpcconsumer.go 0.00% 1 Missing ⚠️
protocol/rpcsmartrouter/rpcsmartrouter.go 0.00% 1 Missing ⚠️
Flag Coverage Δ
consensus 8.53% <ø> (ø)
protocol 33.77% <55.55%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
protocol/chainlib/common.go 41.98% <ø> (ø)
protocol/common/cobra_common.go 0.00% <ø> (ø)
protocol/common/return_errors.go 0.00% <ø> (ø)
protocol/rpcconsumer/rpcconsumer.go 0.00% <0.00%> (ø)
protocol/rpcsmartrouter/rpcsmartrouter.go 4.55% <0.00%> (-0.01%) ⬇️
protocol/chainlib/jsonRPC.go 44.23% <62.50%> (+0.31%) ⬆️
protocol/chainlib/tendermintRPC.go 39.76% <62.50%> (+0.36%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jan 20, 2026

Copy link
Copy Markdown

Test Results

    7 files  ±0     85 suites  ±0   34m 21s ⏱️ -35s
3 183 tests +2  3 182 ✅ +2  1 💤 ±0  0 ❌ ±0 
3 266 runs  +2  3 265 ✅ +2  1 💤 ±0  0 ❌ ±0 

Results for commit 42d3836. ± Comparison against base commit 9d5b671.

♻️ This comment has been updated with latest results.

@NadavLevi NadavLevi force-pushed the feat/limits_batch_request_size branch from 519260e to 57b3f32 Compare January 20, 2026 11:17
Add a configurable limit for the number of requests allowed within a batch
request on the rpcconsumer and rpcsmartrouter side. When a batch exceeds
the configured limit, a 429 rate limit error is returned immediately.

- Add --max-batch-request-size flag (default: 0 = unlimited)
- Return HTTP 429 with JSON-RPC error when limit exceeded
- Support both JSON-RPC and Tendermint RPC interfaces
@NadavLevi NadavLevi force-pushed the feat/limits_batch_request_size branch from 57b3f32 to 42d3836 Compare January 20, 2026 13:54
@nimrod-teich nimrod-teich merged commit f7a3e08 into main Jan 21, 2026
32 checks passed
@nimrod-teich nimrod-teich deleted the feat/limits_batch_request_size branch January 21, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants