Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use Stake value at the end of the day as weight in StakingNodeInfo #17285

Merged
merged 10 commits into from
Jan 10, 2025

Conversation

Neeharika-Sompalli
Copy link
Member

@Neeharika-Sompalli Neeharika-Sompalli commented Jan 9, 2025

Fixes #17252

All the code changes are behind addressBook.useRosterLifecycle feature flag.
When addressBook.useRosterLifecycle=true,

  • Removes the rescaling of stake to weight between range[0, 500] when addressBook.useRosterLifecycle feature flag is on.
  • Deprecates and doesn't update weight fields in StakingNodeInfo and Node objects.
  • The Roster directly uses the stake from StakingNodeInfo to set as weight in Roster when PREPARE_UPGRADE is handled.

Signed-off-by: Neeharika-Sompalli <[email protected]>
Copy link

codacy-production bot commented Jan 9, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.02% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (02ba8df) 96191 68558 71.27%
Head commit (c66faa2) 96328 (+137) 68637 (+79) 71.25% (-0.02%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#17285) 39 39 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.

Project coverage is 67.41%. Comparing base (02ba8df) to head (c66faa2).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...in/impl/handlers/ReadableFreezeUpgradeActions.java 87.50% 0 Missing and 1 partial ⚠️
...pl/handlers/staking/EndOfStakingPeriodUpdater.java 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #17285      +/-   ##
============================================
- Coverage     67.41%   67.41%   -0.01%     
- Complexity    22064    22094      +30     
============================================
  Files          2585     2588       +3     
  Lines         96408    96613     +205     
  Branches      10071    10092      +21     
============================================
+ Hits          64993    65130     +137     
- Misses        27698    27756      +58     
- Partials       3717     3727      +10     
Files with missing lines Coverage Δ
...ervice/addressbook/impl/ReadableNodeStoreImpl.java 100.00% <100.00%> (ø)
...ode/app/service/addressbook/ReadableNodeStore.java 0.00% <ø> (ø)
...p/workflows/handle/steps/PlatformStateUpdates.java 94.52% <100.00%> (+2.21%) ⬆️
...app/workflows/handle/steps/StakePeriodChanges.java 88.33% <100.00%> (-6.50%) ⬇️
...in/impl/handlers/ReadableFreezeUpgradeActions.java 86.97% <87.50%> (+0.20%) ⬆️
...pl/handlers/staking/EndOfStakingPeriodUpdater.java 99.34% <92.85%> (-0.66%) ⬇️

... and 18 files with indirect coverage changes

Impacted file tree graph

@Neeharika-Sompalli Neeharika-Sompalli self-assigned this Jan 10, 2025
@Neeharika-Sompalli Neeharika-Sompalli added this to the v0.59 milestone Jan 10, 2025
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
@Neeharika-Sompalli Neeharika-Sompalli marked this pull request as ready for review January 10, 2025 16:27
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Copy link
Collaborator

@tinker-michaelj tinker-michaelj left a comment

Choose a reason for hiding this comment

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

LGTM, tyvm @Neeharika-Sompalli !

@Neeharika-Sompalli Neeharika-Sompalli merged commit f7b6f69 into main Jan 10, 2025
48 checks passed
@Neeharika-Sompalli Neeharika-Sompalli deleted the 17252-weight-to-stake branch January 10, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use the exact weight from stake without normalizing to 500 in StakingNodeInfo
3 participants