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: Remove inexact-weight TSS implementation #17214

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

Conversation

tinker-michaelj
Copy link
Collaborator

@tinker-michaelj tinker-michaelj commented Jan 4, 2025

Signed-off-by: Michael Tinker <[email protected]>
Signed-off-by: Michael Tinker <[email protected]>
Signed-off-by: Michael Tinker <[email protected]>
@tinker-michaelj tinker-michaelj added this to the v0.59 milestone Jan 4, 2025
@tinker-michaelj tinker-michaelj self-assigned this Jan 4, 2025
Signed-off-by: Michael Tinker <[email protected]>
Copy link

codacy-production bot commented Jan 4, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.22% (target: -1.00%) 92.50%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (f3ec5d1) 95932 65322 68.09%
Head commit (437d47b) 94870 (-1062) 64389 (-933) 67.87% (-0.22%)

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 (#17214) 40 37 92.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 Jan 4, 2025

Codecov Report

Attention: Patch coverage is 87.50000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 64.11%. Comparing base (f3ec5d1) to head (437d47b).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
.../com/hedera/node/app/info/DiskStartupNetworks.java 80.00% 0 Missing and 1 partial ⚠️
...va/com/hedera/node/app/tss/TssBlockHashSigner.java 80.00% 1 Missing ⚠️
...dera/node/app/workflows/handle/HandleWorkflow.java 50.00% 1 Missing ⚠️
...p/workflows/handle/steps/PlatformStateUpdates.java 75.00% 0 Missing and 1 partial ⚠️
...java/com/swirlds/platform/crypto/KeysAndCerts.java 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #17214      +/-   ##
============================================
- Coverage     64.33%   64.11%   -0.23%     
+ Complexity    20942    20715     -227     
============================================
  Files          2555     2537      -18     
  Lines         96169    95087    -1082     
  Branches      10054     9971      -83     
============================================
- Hits          61873    60963     -910     
+ Misses        30655    30520     -135     
+ Partials       3641     3604      -37     
Files with missing lines Coverage Δ
.../src/main/java/com/hedera/hapi/util/HapiUtils.java 61.71% <ø> (+0.82%) ⬆️
...-app/src/main/java/com/hedera/node/app/Hedera.java 52.06% <100.00%> (-5.32%) ⬇️
...rc/main/java/com/hedera/node/app/ServicesMain.java 31.42% <ø> (+0.87%) ⬆️
...com/hedera/node/app/blocks/BlockStreamManager.java 100.00% <ø> (ø)
...a/node/app/blocks/impl/BlockStreamManagerImpl.java 93.58% <100.00%> (-0.34%) ⬇️
...m/hedera/node/app/services/ServiceScopeLookup.java 45.45% <ø> (-2.38%) ⬇️
...om/hedera/node/app/store/ReadableStoreFactory.java 81.39% <ø> (-0.43%) ⬇️
...om/hedera/node/app/store/WritableStoreFactory.java 86.04% <ø> (-2.85%) ⬇️
...n/java/com/hedera/node/app/tss/TssBaseService.java 100.00% <ø> (+50.00%) ⬆️
...va/com/hedera/node/app/tss/TssBaseServiceImpl.java 100.00% <100.00%> (+33.54%) ⬆️
... and 19 more

... and 19 files with indirect coverage changes

Impacted file tree graph

Signed-off-by: Michael Tinker <[email protected]>
Signed-off-by: Michael Tinker <[email protected]>
Signed-off-by: Michael Tinker <[email protected]>
Signed-off-by: Michael Tinker <[email protected]>
Signed-off-by: Michael Tinker <[email protected]>
/**
* Schema removing the states added in {@code 0.56.0} and {@code 0.58.0} for the inexact weights TSS scheme.
*/
@Deprecated(forRemoval = true, since = "0.59.0")
Copy link
Member

Choose a reason for hiding this comment

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

This is not deprecated right ?

version.txt Outdated Show resolved Hide resolved
Comment on lines +833 to +834
if (!Map.of().equals(stateMetadata)) {
stateMetadata.remove(stateKey);
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this ?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1. The if seems unnecessary. The remove call should be unconditional.

Copy link
Collaborator Author

@tinker-michaelj tinker-michaelj Jan 7, 2025

Choose a reason for hiding this comment

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

It's necessary because MerkleStateRoot.getWritableStates() here returns the immutable Map.of() singleton for a service that has not registered any states; and this singleton throws UnsupportedOperationException on receiving remove().

I can go into more detail if you want; but either this or replacing Map.of() with new HashMap<>() at the linked method is necessary.

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.

Overall LGTM! Have two comments though. Thanks @tinker-michaelj

Copy link
Contributor

@rbarkerSL rbarkerSL left a comment

Choose a reason for hiding this comment

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

Approval applies to version.txt

Copy link
Contributor

@anthony-swirldslabs anthony-swirldslabs left a comment

Choose a reason for hiding this comment

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

LGTM, but there's a comment above from @Neeharika-Sompalli that I agree needs fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants