Skip to content

feat: Virtual values as a OneOf in protobuf schema #20317

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

Merged
merged 10 commits into from
Jul 29, 2025

Conversation

thenswan
Copy link
Contributor

@thenswan thenswan commented Jul 23, 2025

Description:
This PR changes Virtual Values, so they are represented as a OneOf in protobuf schema, hence changes in virtual_map_state.proto:

  • Add VirtualLeaf;
  • Add QueueState;
  • Add VirtualMapValue;
  • Update state validator (tested with state generated using :app:run).

Related issue(s):
Fixes #20288

Checklist

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

Signed-off-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
@thenswan thenswan requested a review from artemananiev July 23, 2025 14:55
@thenswan thenswan self-assigned this Jul 23, 2025
@thenswan thenswan added this to the v0.65 milestone Jul 23, 2025
@lfdt-bot
Copy link

lfdt-bot commented Jul 23, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

Copy link

codacy-production bot commented Jul 23, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.03% (target: -1.00%) 77.45%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (34c268b) 101956 76545 75.08%
Head commit (0c3b701) 101939 (-17) 76500 (-45) 75.04% (-0.03%)

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 (#20317) 102 79 77.45%

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

@artemananiev artemananiev added the Platform Tickets pertaining to the platform label Jul 23, 2025
thenswan added 2 commits July 24, 2025 18:22
Signed-off-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
Signed-off-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

❌ Patch coverage is 71.56863% with 29 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...java/com/swirlds/state/merkle/MerkleStateRoot.java 0.00% 11 Missing ⚠️
...main/java/com/swirlds/state/merkle/StateUtils.java 45.45% 6 Missing ⚠️
...tate/merkle/disk/OnDiskWritableSingletonState.java 50.00% 4 Missing ⚠️
...java/com/swirlds/state/merkle/VirtualMapState.java 92.30% 2 Missing ⚠️
...m/swirlds/state/merkle/disk/OnDiskQueueHelper.java 85.71% 0 Missing and 2 partials ⚠️
...ds/state/merkle/disk/OnDiskWritableQueueState.java 81.81% 0 Missing and 2 partials ⚠️
...ds/state/merkle/disk/OnDiskReadableQueueState.java 50.00% 0 Missing and 1 partial ⚠️
...irlds/state/merkle/disk/OnDiskWritableKVState.java 90.90% 0 Missing and 1 partial ⚠️

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #20317      +/-   ##
============================================
- Coverage     71.17%   71.14%   -0.04%     
+ Complexity    24044    24032      -12     
============================================
  Files          2647     2645       -2     
  Lines        102051   102034      -17     
  Branches      10576    10581       +5     
============================================
- Hits          72633    72590      -43     
- Misses        25460    25488      +28     
+ Partials       3958     3956       -2     
Files with missing lines Coverage Δ Complexity Δ
.../com/swirlds/state/merkle/disk/OnDiskIterator.java 84.00% <100.00%> (ø) 7.00 <0.00> (ø)
...irlds/state/merkle/disk/OnDiskReadableKVState.java 81.25% <100.00%> (+1.25%) 5.00 <2.00> (+1.00)
...tate/merkle/disk/OnDiskReadableSingletonState.java 100.00% <100.00%> (ø) 2.00 <1.00> (ø)
...irlds/state/merkle/disk/OnDiskSingletonHelper.java 100.00% <100.00%> (+40.00%) 2.00 <2.00> (ø)
...ds/state/merkle/disk/OnDiskReadableQueueState.java 88.88% <50.00%> (ø) 3.00 <0.00> (ø)
...irlds/state/merkle/disk/OnDiskWritableKVState.java 84.61% <90.90%> (+2.79%) 8.00 <5.00> (+2.00)
...java/com/swirlds/state/merkle/VirtualMapState.java 81.91% <92.30%> (-0.39%) 32.00 <0.00> (ø)
...m/swirlds/state/merkle/disk/OnDiskQueueHelper.java 75.00% <85.71%> (-3.95%) 7.00 <5.00> (+1.00) ⬇️
...ds/state/merkle/disk/OnDiskWritableQueueState.java 87.50% <81.81%> (-3.81%) 5.00 <0.00> (ø)
...tate/merkle/disk/OnDiskWritableSingletonState.java 68.75% <50.00%> (-2.68%) 3.00 <2.00> (ø)
... and 2 more

... and 18 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.

thenswan added 2 commits July 24, 2025 20:22
Signed-off-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
Signed-off-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
@artemananiev artemananiev marked this pull request as ready for review July 24, 2025 21:58
@artemananiev artemananiev requested a review from a team as a code owner July 24, 2025 21:58
@artemananiev artemananiev requested a review from timo0 July 24, 2025 21:58
Signed-off-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
artemananiev
artemananiev previously approved these changes Jul 25, 2025
Signed-off-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
thenswan added 2 commits July 29, 2025 14:53
Signed-off-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
Signed-off-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
Copy link
Contributor

@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 @thenswan !

Copy link
Contributor

@jasperpotts jasperpotts left a comment

Choose a reason for hiding this comment

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

Approve with a few comments/questions but none blocking

@thenswan thenswan merged commit 8f05938 into main Jul 29, 2025
47 of 50 checks passed
@thenswan thenswan deleted the 20288-virtual-values-as-a-oneof-in-protobuf-schema branch July 29, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Virtual values should be represented as a OneOf in protobuf schema
9 participants