Skip to content

Conversation

@mmsqe
Copy link
Contributor

@mmsqe mmsqe commented Dec 7, 2025

Description

These queries enable debugging reward calculations by allowing user to inspect internal distribution state without exporting genesis at specific heights. User can query delegator-starting-info to get the previous period and stake, then use validator-historical-rewards with that period to retrieve cumulative reward ratios for accurate reward verification.

@github-actions github-actions bot added C:CLI C:x/distribution distribution module related labels Dec 7, 2025
@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 91.46341% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.46%. Comparing base (7e9ad4f) to head (cf5890f).

Files with missing lines Patch % Lines
x/distribution/keeper/grpc_query.go 87.50% 7 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #25650      +/-   ##
==========================================
+ Coverage   70.42%   70.46%   +0.03%     
==========================================
  Files         830      830              
  Lines       54052    54134      +82     
==========================================
+ Hits        38068    38146      +78     
- Misses      15984    15988       +4     
Files with missing lines Coverage Δ
contrib/x/nft/module/module.go 0.00% <ø> (ø)
testutil/configurator/configurator.go 80.42% <ø> (ø)
x/distribution/autocli.go 100.00% <100.00%> (ø)
x/distribution/keeper/grpc_query.go 81.42% <87.50%> (+1.72%) ⬆️

... and 4 files with indirect coverage changes

Impacted file tree graph

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

replace github.com/cosmos/cosmos-sdk => ../
replace (
cosmossdk.io/api => ../api
cosmossdk.io/x/tx => ../x/tx
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

need replace api in systemtest, and we need to avoid dep like

systemtests git:(distr_cli) go mod why cosmossdk.io/api/cosmos/group/v1
# cosmossdk.io/api/cosmos/group/v1
cosmossdk.io/systemtests
github.com/cosmos/cosmos-sdk/codec/types
cosmossdk.io/x/tx/signing
cosmossdk.io/x/tx/signing.test
cosmossdk.io/api/cosmos/group/v1

// Below are the long-lived replace of the SimApp
replace (
cosmossdk.io/api => ../api
cosmossdk.io/x/tx => ../x/tx
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

autocli need latest api to work

}

// ValidatorHistoricalRewards queries historical rewards for a validator at a specific period
func (k Querier) ValidatorHistoricalRewards(ctx context.Context, req *types.QueryValidatorHistoricalRewardsRequest) (*types.QueryValidatorHistoricalRewardsResponse, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

all of these functions should be tested 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C:CLI C:x/distribution distribution module related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants