Skip to content

Conversation

@AlfredoG87
Copy link
Contributor

@AlfredoG87 AlfredoG87 commented Dec 20, 2025

Reviewer Notes

  • Now CN version for downloading API Protobuf definition supports Tag name, and not only commit hash.
  • Necessary changes to support HAPI 0.69.0 version of protobuf
  • For StreamingHasher: removed masking of NoSuchAlgorithmException under a RuntimeException, since is on the construction, it should fail under the right exception at the class that is instantiating it, and either force recovery or fail, leaving this decision to the instantiating class.
  • Improving BlockProof Selection condition to only use Tss Based proof by checking hasSignedBlockProof and verifying there is a single one.
  • Changed the Simulator to always produce deterministic blocks, so the rootHashOfAllBlockHashesTree always matches between runs, this is needed for E2E Testing scenarios.
  • S3ArchivePluginTest: Improved Flaky test by giving a tiny bit more time.
  • VerificationSession interface now has 2 methods, a void processBlockItems and a finalizeVerification that returns the VerificationNotification result, making use of the end_of_block message that is now received and not relaying on block_proofs alone. This achieves division of processing and hashing block_items, and requesting a block_proof verification.
  • Verification plugin now calculates the root of all previous block hashes when starting from genesis, loads and writes them to disk so full history node can recover fast from restart, and provides previousBlockHash and rootHashOfAllPreviousBlocks when available and enabled. Otherwise (when not available) Verification will rely on the information provided by the BlockFooter as true.
  • Added UTs for AllBlocksHahserHandler

Related Issue(s)

#1906

@AlfredoG87 AlfredoG87 added this to the 0.26.0 milestone Dec 20, 2025
@AlfredoG87 AlfredoG87 added the Feature Enhancement Enhancing an existing feature driven by business requirements. Typically backwards compatible. label Dec 20, 2025
@AlfredoG87 AlfredoG87 self-assigned this Dec 20, 2025
@AlfredoG87 AlfredoG87 marked this pull request as ready for review December 22, 2025 22:18
@AlfredoG87 AlfredoG87 requested review from a team as code owners December 22, 2025 22:18
Copy link
Contributor

@jsync-swirlds jsync-swirlds left a comment

Choose a reason for hiding this comment

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

Still working through this, but there are a few comments below to start with.

Copy link
Contributor

@jsync-swirlds jsync-swirlds left a comment

Choose a reason for hiding this comment

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

A few small items and an API design concern.

Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
… since is on the construction, it should fail under the right exception at the class that is instantiating it, and either force recovery or fail, leaving this decision to the instantiating class.

Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
…by checking hasSignedBlockProof and verifying there is a single one.

Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
…ashes when starting from genesis.

- Changed the Simulator to always produce deterministic blocks, so the rootHashOfAllBlockHashesTree always matches between runs, this is needed for E2E Testing scenarios.
- Improved Flaky test by giving a tiny bit more time.
- VerificationSession interface now has 2 methods, a void processBlockItems and a finalizeVerification that returns the VerificationNotification result, making use of the end_of_block message that is now received and not relaying on block_proofs alone.

Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
…kStreamingHasher into class: AllBlocksHasherHandler that handles initialization and lifecycle managing.

Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
… edge case.

Made needed changes in classes to fix bugs found during testing phase.

Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
…d it to used the intermeadiate hashes instead of all the previous hasher to buildd the StreamingHasher, also fixed the StreamingHasherm to accept leafCount to be able to resume correct state from saved snapshot.

Made the saving of the hasher snapshot independent and saving automatically every X amount of time.

Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
…Hash and the rootOfAllPreviousBlockHash when is created as opposed to when the block is finalized, also, removed the finalizeBlock method, and rely on the blockItems, so far the BlockItemsMessgae comes with endOfBlock, so it's been used internally and returned to the previous design of the VerificationSession with fewer changes

Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
…UnparsedBlockItem, to avoid accidental use

Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
- Moved .proto to PBJ Default location /src/main/proto, outside of the java classes

Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
jjohannes
jjohannes previously approved these changes Jan 13, 2026
jsync-swirlds
jsync-swirlds previously approved these changes Jan 15, 2026
Copy link
Contributor

@jsync-swirlds jsync-swirlds left a comment

Choose a reason for hiding this comment

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

Just a couple items to clean up.
Could be done in a follow-up if desired.

Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
@AlfredoG87 AlfredoG87 dismissed stale reviews from jsync-swirlds and jjohannes via 47f01dc January 15, 2026 19:29
@AlfredoG87
Copy link
Contributor Author

Just a couple items to clean up. Could be done in a follow-up if desired.

@jsync-swirlds addressed most of them and deferred one for the next task, where is more appropiate, I would have choose to deffer all if I had enough approvals, but for now, I don't so I addressed 👍

Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
@AlfredoG87 AlfredoG87 merged commit d54150d into main Jan 16, 2026
22 of 27 checks passed
@AlfredoG87 AlfredoG87 deleted the hashing-hapi-69 branch January 16, 2026 17:10
@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 86.78571% with 37 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...lock/node/verification/AllBlocksHasherHandler.java 89.36% 10 Missing and 5 partials ⚠️
...cation/session/impl/ExtendedMerkleTreeSession.java 65.21% 4 Missing and 4 partials ⚠️
...k/node/verification/VerificationServicePlugin.java 76.66% 4 Missing and 3 partials ⚠️
...k/simulator/generator/CraftBlockStreamManager.java 87.23% 6 Missing ⚠️
...ication/session/impl/DummyVerificationSession.java 83.33% 0 Missing and 1 partial ⚠️
@@             Coverage Diff              @@
##               main    #1993      +/-   ##
============================================
+ Coverage     78.99%   79.89%   +0.90%     
- Complexity     1241     1302      +61     
============================================
  Files           130      131       +1     
  Lines          5952     6179     +227     
  Branches        646      667      +21     
============================================
+ Hits           4702     4937     +235     
+ Misses          955      939      -16     
- Partials        295      303       +8     
Files with missing lines Coverage Δ Complexity Δ
...ro/block/node/verification/VerificationConfig.java 100.00% <100.00%> (ø) 1.00 <1.00> (ø)
...erification/session/HapiVersionSessionFactory.java 91.30% <100.00%> (+8.69%) 10.00 <1.00> (+1.00)
...rg/hiero/block/common/hasher/HashingUtilities.java 80.58% <100.00%> (+0.77%) 15.00 <1.00> (ø)
...org/hiero/block/common/hasher/StreamingHasher.java 100.00% <100.00%> (+100.00%) 11.00 <0.00> (+11.00)
...enerator/itemhandler/AbstractBlockItemHandler.java 83.33% <100.00%> (ø) 6.00 <3.00> (ø)
...ator/generator/itemhandler/BlockFooterHandler.java 100.00% <100.00%> (ø) 5.00 <2.00> (+1.00)
...ator/generator/itemhandler/EventHeaderHandler.java 100.00% <100.00%> (ø) 5.00 <0.00> (ø)
...enerator/itemhandler/TransactionResultHandler.java 100.00% <100.00%> (ø) 7.00 <2.00> (ø)
...ication/session/impl/DummyVerificationSession.java 88.88% <83.33%> (+2.22%) 2.00 <1.00> (ø)
...k/simulator/generator/CraftBlockStreamManager.java 88.53% <87.23%> (-0.36%) 43.00 <9.00> (+6.00) ⬇️
... and 3 more

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Enhancement Enhancing an existing feature driven by business requirements. Typically backwards compatible.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants