diff --git a/CHANGELOG.md b/CHANGELOG.md index 466b96afd7..66850fe396 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ * [#1779](https://github.com/crypto-org-chain/cronos/pull/1779) Upgrade rocksdb to `v9.11.2`. +### Bug Fixes + +* [#1801](https://github.com/crypto-org-chain/cronos/pull/1801) Avoid non-empty data from being cleared during restoration from versiondb. + *Apr 9, 2025* ## v1.4.6 diff --git a/integration_tests/test_basic.py b/integration_tests/test_basic.py index 7775a28e22..d618d7957c 100644 --- a/integration_tests/test_basic.py +++ b/integration_tests/test_basic.py @@ -404,6 +404,7 @@ def test_local_statesync(cronos, tmp_path_factory): wait_for_new_blocks(cli, 2) # check grpc works print("distribution", cli.distribution_community(height=height)) + print("balances", cli.balances(cli0.address("validator"))) with pytest.raises(Exception) as exc_info: cli.distribution_community(height=height - 1) diff --git a/versiondb/client/restore.go b/versiondb/client/restore.go index 1572d49600..57d2ecbe51 100644 --- a/versiondb/client/restore.go +++ b/versiondb/client/restore.go @@ -107,10 +107,12 @@ loop: return fmt.Errorf("node height %v cannot exceed %v", item.IAVL.Height, math.MaxInt8) } - ch <- versiondb.ImportEntry{ - StoreKey: storeKey, - Key: item.IAVL.Key, - Value: item.IAVL.Value, + if len(item.IAVL.Value) > 0 { + ch <- versiondb.ImportEntry{ + StoreKey: storeKey, + Key: item.IAVL.Key, + Value: item.IAVL.Value, + } } default: break loop