Skip to content

Support query latest state when SS disabled#2762

Merged
yzang2019 merged 2 commits intomainfrom
yzang/fix-historical-query
Jan 26, 2026
Merged

Support query latest state when SS disabled#2762
yzang2019 merged 2 commits intomainfrom
yzang/fix-historical-query

Conversation

@yzang2019
Copy link
Contributor

@yzang2019 yzang2019 commented Jan 26, 2026

Describe your changes and provide context

In previous PR, we removed completely to serve any historical query from SC, because that could cause data inconsistency issues (SC data is not in sync with SS)

However that introduced a bug for validator nodes, since validator nodes have SS disabled, and it still need to be able to serve query with height=latestHeight

This PR fixed both issues by adding the SC back, but only serve from SC when SS is disabled to keep the data still consistent for RPC node.

Testing performed to validate your change

Added unit test

@github-actions
Copy link

github-actions bot commented Jan 26, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJan 26, 2026, 8:05 PM

@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.33%. Comparing base (55e60cb) to head (ba47345).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2762      +/-   ##
==========================================
- Coverage   57.01%   56.33%   -0.69%     
==========================================
  Files        2004     2000       -4     
  Lines      164629   164036     -593     
==========================================
- Hits        93869    92404    -1465     
- Misses      62557    63542     +985     
+ Partials     8203     8090     -113     
Flag Coverage Δ
sei-chain 40.97% <0.00%> (-0.82%) ⬇️
sei-cosmos 48.10% <100.00%> (+0.08%) ⬆️
sei-db 68.72% <ø> (ø)
sei-tendermint 58.98% <ø> (-0.03%) ⬇️

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

Files with missing lines Coverage Δ
sei-cosmos/storev2/rootmulti/store.go 42.02% <100.00%> (+1.28%) ⬆️

... and 53 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +250 to +254
for k, store := range rs.ckvStores {
if store.GetStoreType() != types.StoreTypeIAVL {
stores[k] = store
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
@yzang2019 yzang2019 enabled auto-merge (squash) January 26, 2026 20:17
@yzang2019 yzang2019 requested a review from Kbhat1 January 26, 2026 20:52
@yzang2019 yzang2019 merged commit cfd3327 into main Jan 26, 2026
44 of 45 checks passed
@yzang2019 yzang2019 deleted the yzang/fix-historical-query branch January 26, 2026 20:52
github-actions bot pushed a commit that referenced this pull request Jan 26, 2026
## Describe your changes and provide context
In previous PR, we removed completely to serve any historical query from
SC, because that could cause data inconsistency issues (SC data is not
in sync with SS)

However that introduced a bug for validator nodes, since validator nodes
have SS disabled, and it still need to be able to serve query with
height=latestHeight

This PR fixed both issues by adding the SC back, but only serve from SC
when SS is disabled to keep the data still consistent for RPC node.

## Testing performed to validate your change
Added unit test

(cherry picked from commit cfd3327)
@github-actions
Copy link

Successfully created backport PR for release/v6.3:

cursor bot pushed a commit that referenced this pull request Jan 26, 2026
…abled

Co-authored-by: yiren <yiren@seinetwork.io>
Copy link
Contributor

@arajasek arajasek left a comment

Choose a reason for hiding this comment

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

LGTM

philipsu522 pushed a commit that referenced this pull request Jan 26, 2026
…2765)

Backport of #2762 to `release/v6.3`.

Co-authored-by: Yiming Zang <50607998+yzang2019@users.noreply.github.com>
arajasek pushed a commit that referenced this pull request Jan 27, 2026
## Describe your changes and provide context
In previous PR, we removed completely to serve any historical query from
SC, because that could cause data inconsistency issues (SC data is not
in sync with SS)

However that introduced a bug for validator nodes, since validator nodes
have SS disabled, and it still need to be able to serve query with
height=latestHeight

This PR fixed both issues by adding the SC back, but only serve from SC
when SS is disabled to keep the data still consistent for RPC node.

## Testing performed to validate your change
Added unit test
yzang2019 added a commit that referenced this pull request Feb 25, 2026
In previous PR, we removed completely to serve any historical query from
SC, because that could cause data inconsistency issues (SC data is not
in sync with SS)

However that introduced a bug for validator nodes, since validator nodes
have SS disabled, and it still need to be able to serve query with
height=latestHeight

This PR fixed both issues by adding the SC back, but only serve from SC
when SS is disabled to keep the data still consistent for RPC node.

Added unit test
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.

4 participants