Closed imalygin closed 3 weeks ago
I cannot reproduce it locally, tried both 0.50 and 0.51 versions, and a couple different snapshots that previously failed validation.
UPD: I found a way to reproduce it now.
This appeared to be a bug in MerkleDbDataSource
. When all elements are removed from a virtual map, the final flush to disk looks like this:
The assumption is all these leaf records will be deleted from the data source. However, MerkleDb just checks if first/last leaf path is -1, and does nothing in this case. It results in the leaves to be preserved in data files, and this is exactly what the validation tool detects.
The fix is pretty straightforward: drop the check for first/last leaf paths and delete the leaf records regardless. With this check removed, MerkleDb needs to make sure no new data file is created, if both deleted and dirty leaf streams are empty.
Such a change will not make the validation tool pass on the old state snapshots, but it will prevent similar failures in the future.
Description
Node08 consistently fails
ValidateLeafIndexHalfDiskHashMap.validateInde
validation. It occurs every round. Here is an example https://github.com/hashgraph/hedera-state-validator/actions/runs/9603442996/job/26486697813With the following error message:
This validation fails for all
SCHEDULES_BY_*
maps.This failure means that in one of the buckets in the
HalfDiskHashMap
contains an entry such that if you take a path from this entry and use this path to lookup a key usingpathToDiskLocationLeafNodes
, you'll get a record with a different key.Steps to reproduce
Download the validator:
This validator is built from 13929-0-50 branch in
hedera-state-validator
repo andhedera-services
repo.Download the state for Node08:
Run the following command:
Additional context
Interestingly enough, it happens only on a single node.
Hedera network
mainnet
Version
v0.50
Operating system
None