Skip to content

Conversation

@NadavLevi
Copy link
Collaborator

When combining API categories for batch requests, the Stateful field was incorrectly using addition. This caused batches with 2+ stateful methods to have Stateful > 1, which failed the equality check (== CONSISTENCY_SELECT_ALL_PROVIDERS) and incorrectly used Quorum selection instead of BestResult.

Changed from addition to max() so any batch containing at least one stateful method is correctly treated as stateful (BestResult selection).

Before (bug):

  • 2 stateful methods: 1+1=2, != 1, uses Quorum (wrong)

After (fix):

  • 2 stateful methods: max(1,1)=1, == 1, uses BestResult (correct)

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

When combining API categories for batch requests, the Stateful field
was incorrectly using addition. This caused batches with 2+ stateful
methods to have Stateful > 1, which failed the equality check
(== CONSISTENCY_SELECT_ALL_PROVIDERS) and incorrectly used Quorum
selection instead of BestResult.

Changed from addition to max() so any batch containing at least one
stateful method is correctly treated as stateful (BestResult selection).

Before (bug):
- 2 stateful methods: 1+1=2, != 1, uses Quorum (wrong)

After (fix):
- 2 stateful methods: max(1,1)=1, == 1, uses BestResult (correct)
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
consensus 8.55% <100.00%> (+<0.01%) ⬆️
protocol 33.87% <ø> (+0.05%) ⬆️

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

Files with missing lines Coverage Δ
x/spec/types/api_collection.go 8.60% <100.00%> (+8.60%) ⬆️

... and 2 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
Copy link

Test Results

    7 files  ± 0     85 suites  ±0   31m 20s ⏱️ -26s
3 334 tests +14  3 333 ✅ +14  1 💤 ±0  0 ❌ ±0 
3 527 runs  +14  3 526 ✅ +14  1 💤 ±0  0 ❌ ±0 

Results for commit 7fe44ad. ± Comparison against base commit e4f7444.

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