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

fix: app and services to stop querying the platform for the roster #16771

Open
wants to merge 106 commits into
base: main
Choose a base branch
from

Conversation

MiroslavGatsanoga
Copy link
Collaborator

@MiroslavGatsanoga MiroslavGatsanoga commented Nov 25, 2024

Description:

Remove Platform.getRoster() calls from Services code.

Related issue(s):

Fixes #16721

Checklist

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

@MiroslavGatsanoga MiroslavGatsanoga added this to the v0.58 milestone Nov 25, 2024
@MiroslavGatsanoga MiroslavGatsanoga self-assigned this Nov 25, 2024
Copy link

codacy-production bot commented Nov 25, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 87.50%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (ca2e9a8) 95732 65125 68.03%
Head commit (8f5b304) 95734 (+2) 65125 (+0) 68.03% (+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 (#16771) 8 7 87.50%

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 Nov 25, 2024

Codecov Report

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

Project coverage is 64.27%. Comparing base (ca2e9a8) to head (8f5b304).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...-app/src/main/java/com/hedera/node/app/Hedera.java 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             develop   #16771      +/-   ##
=============================================
- Coverage      64.28%   64.27%   -0.01%     
+ Complexity     20886    20884       -2     
=============================================
  Files           2549     2549              
  Lines          95969    95971       +2     
  Branches       10041    10042       +1     
=============================================
- Hits           61690    61689       -1     
- Misses         30653    30655       +2     
- Partials        3626     3627       +1     
Files with missing lines Coverage Δ
...rc/main/java/com/hedera/node/app/ServicesMain.java 30.06% <ø> (ø)
...a/com/hedera/node/app/platform/PlatformModule.java 100.00% <ø> (ø)
...edera/node/app/throttle/ThrottleServiceModule.java 100.00% <100.00%> (ø)
...n/java/com/hedera/node/app/tss/TssBaseService.java 50.00% <ø> (ø)
...va/com/hedera/node/app/tss/TssBaseServiceImpl.java 66.56% <ø> (+0.10%) ⬆️
...app/workflows/standalone/TransactionExecutors.java 91.07% <100.00%> (ø)
...-app/src/main/java/com/hedera/node/app/Hedera.java 57.18% <60.00%> (-0.20%) ⬇️

... and 3 files with indirect coverage changes

Impacted file tree graph

@MiroslavGatsanoga MiroslavGatsanoga force-pushed the 16721-services-stop-querying-platform-for-roster branch from 0a177a5 to 20a5ea8 Compare November 25, 2024 14:07
Neeharika-Sompalli and others added 24 commits November 25, 2024 18:05
Signed-off-by: Neeharika-Sompalli <[email protected]>
… initializing states api

Signed-off-by: Miroslav Gatsanoga <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Neeharika-Sompalli <[email protected]>
Signed-off-by: Michael Tinker <[email protected]>
Signed-off-by: Michael Tinker <[email protected]>
Signed-off-by: Michael Tinker <[email protected]>
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 @MiroslavGatsanoga

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.

Thanks @MiroslavGatsanoga!

Replacing rosterEntries.size() with networkInfo.addressBook().size() is definitely correct, and this PR doesn't need to update the canAdopt predicate.

But we don't want to go back to out-of-band RosterService state modifications in AbstractEmbeddedHedera; and in fact that should not be necessary.

Can you merge branch 17056-roster-lifecycle-pr-checks and verify that the AbstractEmbeddedHedera diff in this PR can be removed?

@@ -1004,8 +1007,13 @@ private void initializeDagger(@NonNull final State state, @NonNull final InitTri
.round();
final var initialStateHash = new InitialStateHash(initialStateHashFuture, roundNum);

final var activeRoster = tssBaseService.chooseRosterForNetwork(
state, trigger, serviceMigrator, version, configProvider.getConfiguration(), platform.getRoster());
Roster activeRoster;
Copy link
Collaborator

@tinker-michaelj tinker-michaelj Jan 3, 2025

Choose a reason for hiding this comment

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

⚠️ This will work in CI because now all PR checks run with an override of addressBook.useRosterLifecycle=true.

But in production environments up to 0.58, there will be no active roster, and this will lead to a NPE when constructing StateNetworkInfo below.

We may want to delay this PR until we have been able to make useRosterLifecycle=true the default.

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.

The app and services stop querying the platform for the address book or roster.
6 participants