Skip to content

fix(batch): treat batch responses with partial success as valid#2202

Merged
nimrod-teich merged 3 commits into
mainfrom
fix/batch-partial-error-no-retry
Jan 28, 2026
Merged

fix(batch): treat batch responses with partial success as valid#2202
nimrod-teich merged 3 commits into
mainfrom
fix/batch-partial-error-no-retry

Conversation

@nimrod-teich

Copy link
Copy Markdown
Contributor

Previously, batch requests that returned with some errors in sub-requests (e.g., Solana skipped slots) would be classified as "node errors" and trigger unnecessary retries. This was wasteful since the response was already received from the provider.

Now, CheckResponseErrorForJsonRpcBatch only returns an error if ALL sub-requests failed. If at least one sub-request succeeded (has a result), the batch response is treated as valid and won't trigger retries.

This prevents unnecessary retry loops for batch requests with expected partial failures like Solana's skipped slots.

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

Previously, batch requests that returned with some errors in sub-requests
(e.g., Solana skipped slots) would be classified as "node errors" and
trigger unnecessary retries. This was wasteful since the response was
already received from the provider.

Now, CheckResponseErrorForJsonRpcBatch only returns an error if ALL
sub-requests failed. If at least one sub-request succeeded (has a result),
the batch response is treated as valid and won't trigger retries.

This prevents unnecessary retry loops for batch requests with expected
partial failures like Solana's skipped slots.
@codecov

codecov Bot commented Jan 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
consensus 8.53% <ø> (ø)
protocol 33.82% <100.00%> (+0.07%) ⬆️

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

Files with missing lines Coverage Δ
.../chainproxy/rpcInterfaceMessages/jsonRPCMessage.go 39.85% <100.00%> (+16.19%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go Outdated
Comment thread protocol/chainlib/chainproxy/rpcInterfaceMessages/jsonRPCMessage.go Outdated
@github-actions

github-actions Bot commented Jan 27, 2026

Copy link
Copy Markdown

Test Results

    7 files  ±0     85 suites  ±0   30m 39s ⏱️ - 2m 48s
3 192 tests +9  3 191 ✅ +9  1 💤 ±0  0 ❌ ±0 
3 275 runs  +9  3 274 ✅ +9  1 💤 ±0  0 ❌ ±0 

Results for commit 4d63fe0. ± Comparison against base commit f0e3d53.

♻️ This comment has been updated with latest results.

Add a configurable flag to control batch request error detection:
- BatchNodeErrorOnAny=false (default): batch is an error only if ALL
  sub-requests failed. Partial success is not considered an error.
- BatchNodeErrorOnAny=true (strict): batch is an error if ANY
  sub-request failed.

This allows operators to toggle between lenient and strict batch
error handling depending on their use case.
@nimrod-teich nimrod-teich merged commit 2ae0fd6 into main Jan 28, 2026
29 checks passed
@nimrod-teich nimrod-teich deleted the fix/batch-partial-error-no-retry branch January 28, 2026 12:16
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