Skip to content

feat(protocol): add flag to disable batch request retries#2218

Merged
nimrod-teich merged 1 commit into
mainfrom
feat/disable-batch-request-retry-flag
Feb 2, 2026
Merged

feat(protocol): add flag to disable batch request retries#2218
nimrod-teich merged 1 commit into
mainfrom
feat/disable-batch-request-retry-flag

Conversation

@nimrod-teich

Copy link
Copy Markdown
Contributor

Description

Add --disable-batch-request-retry flag to rpcconsumer and rpcsmartrouter
that prevents JSON-RPC batch requests from being retried.

Changes:
- Add IsBatch() method to ChainMessage interface for clean batch detection
- Implement batch detection via type assertion on JsonrpcBatchMessage
- Check flag in retryCondition() of both consumer and smartrouter state machines
- Add defense-in-depth check in RelayProcessor.shouldRetryRelay()
- Add comprehensive tests for the new flag behavior

The flag is enabled by default (batch retries disabled), users can enable
retries with --disable-batch-request-retry=false if needed.

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 Feb 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 8.69565% with 21 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
protocol/chainlib/chainlib_mock.go 0.00% 8 Missing ⚠️
protocol/chainlib/chain_message.go 0.00% 3 Missing ⚠️
...otocol/rpcconsumer/consumer_relay_state_machine.go 0.00% 2 Missing and 1 partial ⚠️
.../rpcsmartrouter/smartrouter_relay_state_machine.go 0.00% 2 Missing and 1 partial ⚠️
protocol/relaycore/relay_processor.go 50.00% 1 Missing and 1 partial ⚠️
protocol/rpcconsumer/rpcconsumer.go 0.00% 1 Missing ⚠️
protocol/rpcsmartrouter/rpcsmartrouter.go 0.00% 1 Missing ⚠️
Flag Coverage Δ
consensus 8.54% <ø> (ø)
protocol 33.88% <8.69%> (+0.02%) ⬆️

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

Files with missing lines Coverage Δ
protocol/chainlib/chainlib.go 50.00% <ø> (ø)
protocol/common/cobra_common.go 0.00% <ø> (ø)
protocol/rpcconsumer/rpcconsumer.go 0.00% <0.00%> (ø)
protocol/rpcsmartrouter/rpcsmartrouter.go 4.54% <0.00%> (-0.01%) ⬇️
protocol/relaycore/relay_processor.go 51.56% <50.00%> (-0.02%) ⬇️
protocol/chainlib/chain_message.go 50.96% <0.00%> (-1.52%) ⬇️
...otocol/rpcconsumer/consumer_relay_state_machine.go 80.23% <0.00%> (-1.43%) ⬇️
.../rpcsmartrouter/smartrouter_relay_state_machine.go 86.95% <0.00%> (-1.28%) ⬇️
protocol/chainlib/chainlib_mock.go 9.12% <0.00%> (-0.16%) ⬇️

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

@nimrod-teich nimrod-teich force-pushed the feat/disable-batch-request-retry-flag branch from b067a45 to bf24bac Compare February 2, 2026 12:13
Add --disable-batch-request-retry flag to rpcconsumer and rpcsmartrouter
that prevents JSON-RPC batch requests from being retried.

Changes:
- Add IsBatch() method to ChainMessage interface for clean batch detection
- Implement batch detection via type assertion on JsonrpcBatchMessage
- Check flag in retryCondition() of both consumer and smartrouter state machines
- Add defense-in-depth check in RelayProcessor.shouldRetryRelay()
- Add comprehensive tests for the new flag behavior

The flag is enabled by default (batch retries disabled), users can enable
retries with --disable-batch-request-retry=false if needed.
@nimrod-teich nimrod-teich force-pushed the feat/disable-batch-request-retry-flag branch from bf24bac to 3152b3c Compare February 2, 2026 12:14
@github-actions

github-actions Bot commented Feb 2, 2026

Copy link
Copy Markdown

Test Results

    7 files  ±0     85 suites  ±0   32m 0s ⏱️ +59s
3 345 tests +8  3 344 ✅ +8  1 💤 ±0  0 ❌ ±0 
3 538 runs  +8  3 537 ✅ +8  1 💤 ±0  0 ❌ ±0 

Results for commit 3152b3c. ± Comparison against base commit 4479425.

@nimrod-teich nimrod-teich merged commit 7fe7354 into main Feb 2, 2026
30 of 31 checks passed
@nimrod-teich nimrod-teich deleted the feat/disable-batch-request-retry-flag branch February 2, 2026 12:50
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