fix: Use config version from start of record#24592
Open
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Merging to
|
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #24592 +/- ##
=========================================
Coverage 78.15% 78.15%
Complexity 11679 11679
=========================================
Files 2488 2488
Lines 94711 94713 +2
Branches 10232 10231 -1
=========================================
+ Hits 74020 74023 +3
Misses 16948 16948
+ Partials 3743 3742 -1
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
Signed-off-by: Matt Hess <matt.hess@swirldslabs.com>
Signed-off-by: Derek Riley <derek.riley@swirldslabs.com> Signed-off-by: Matt Hess <matt.hess@swirldslabs.com>
Signed-off-by: Artur Kugal <artur.kugal@swirldslabs.com> Signed-off-by: Matt Hess <matt.hess@swirldslabs.com>
1126b44 to
dcbb65c
Compare
imalygin
approved these changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix intermittent wrapped record block hash mismatch by capturing
hapiProtoVersionat block start rather than reading it from the current config at hash computation time.Key Points
BlockRecordManagerImpl.buildWrappedBlockHashesInput()was readinghedera.config.versionfrom the liveConfigProviderat the moment the wrapped record block hash was computed (block end or freeze time)FileUpdatetransaction changedhedera.config.versionmid-block, the hash was computed with the new version while the.rcdfile on disk recorded the old version — causing the replay-based verification to produce a different hashcurrentWrappedBlockHapiProtoVersionfield, captured viacopyHapiProtoVersion()in both block-start paths ofstartUserTransaction(), unconditionallybuildWrappedBlockHashesInput()now uses the captured version instead of querying the config providerTest Coverage
configVersionChangeMidBlockUsesVersionFromBlockStart— swapsConfigProviderfrom configVersion=5 to 6 mid-block, then crosses a block boundary; asserts the disk writer input still hasbuild="5"freezeBlockPersistsWrappedHashStateToBlockInfoUsingVersionFromBlockStart— same config swap during the EPOCH (first-ever) block, then callswriteFreezeBlockWrappedRecordFileBlockHashesToDisk; asserts disk writer input hasbuild="5"and verifiesBlockInfostate persistence