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

chore: use RosterRetriever in RosterUtils.buildRosterHistory #16923

Conversation

anthony-swirldslabs
Copy link
Contributor

Description:
This fix removes the last meaningful use of the PlatformStateAccessor.getPreviousAddressBook() by making the RosterUtils.buildRosterHistory use the RosterRetriever calls instead of fetching the current/previous AddressBooks directly from the PlatformState.

The RosterRetriever would automatically fetch the data from the RosterState/RosterMap once we start populating these states. Until then, the code will automatically fall back to reading the current/previous ABs from the PlatformState and converting them to rosters.

A few remaining usages of the PlatformStateAccessor.getPreviousAddressBook() are listed in the #16922 and cannot be removed immediately.

Related issue(s):

Fixes #16922

Notes for reviewer:
Tests should pass.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Anthony Petrov <anthony@swirldslabs.com>
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 63.80%. Comparing base (2914165) to head (267338c).
Report is 10 commits behind head on develop.

Files with missing lines Patch % Lines
.../java/com/swirlds/platform/roster/RosterUtils.java 0.00% 4 Missing ⚠️
...rc/main/java/com/hedera/node/app/ServicesMain.java 0.00% 1 Missing ⚠️
...re/src/main/java/com/swirlds/platform/Browser.java 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             develop   #16923   +/-   ##
==========================================
  Coverage      63.80%   63.80%           
  Complexity     20544    20544           
==========================================
  Files           2540     2540           
  Lines          95189    95186    -3     
  Branches        9944     9944           
==========================================
+ Hits           60732    60733    +1     
  Misses         30834    30834           
+ Partials        3623     3619    -4     
Files with missing lines Coverage Δ
...rc/main/java/com/hedera/node/app/ServicesMain.java 27.77% <0.00%> (+0.21%) ⬆️
...re/src/main/java/com/swirlds/platform/Browser.java 0.00% <0.00%> (ø)
.../java/com/swirlds/platform/roster/RosterUtils.java 64.28% <0.00%> (+1.49%) ⬆️

... and 6 files with indirect coverage changes

Impacted file tree graph

Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (2914165) 97954 64165 65.51%
Head commit (267338c) 97951 (-3) 64162 (-3) 65.50% (+0.00%)

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 (#16923) 6 0 0.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
Member

@Neeharika-Sompalli Neeharika-Sompalli left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @anthony-swirldslabs

@anthony-swirldslabs anthony-swirldslabs merged commit 5d5e93b into develop Dec 5, 2024
69 of 70 checks passed
@anthony-swirldslabs anthony-swirldslabs deleted the 16922-useRosterRetrieverInRosterUtilsBuildRosterHistory branch December 5, 2024 18:56
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.

Replace usage of PlatformState in RosterUtils.buildRosterHistory with using the RosterRetriever
3 participants