Skip to content

Commit

Permalink
Problem: memory leak in versiondb (backport: crypto-org-chain#1491) (c…
Browse files Browse the repository at this point in the history
…rypto-org-chain#1493)

* Problem: no free slice data in HasAtVersion

* run test_tx_inclusion

* less upgrade test
  • Loading branch information
mmsqe authored Jun 28, 2024
1 parent 6169d92 commit af0bd9c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

## UNRELEASED

### Improvements

* (versiondb) [#1491](https://github.com/crypto-org-chain/cronos/pull/1491) Free slice data in HasAtVersion.

*Jun 18, 2024*

## v1.3.0-rc2

### Improvements

* (rpc) [#1467](https://github.com/crypto-org-chain/cronos/pull/1467) Avoid unnecessary tx decode in tx listener.

### Bug Fixes

* [#1466](https://github.com/crypto-org-chain/cronos/pull/1466) Fix handling of pending transactions related APIs.

*May 21, 2024*

## v1.3.0-rc1

### State Machine Breaking

* [#1407](https://github.com/crypto-org-chain/cronos/pull/1407) Add end-to-end encryption module.
Expand All @@ -12,13 +32,11 @@
* (e2ee)[#1415](https://github.com/crypto-org-chain/cronos/pull/1415) Add batch keys query for e2ee module.
* (e2ee)[#1421](https://github.com/crypto-org-chain/cronos/pull/1421) Validate e2ee key when register.
* [#1437](https://github.com/crypto-org-chain/cronos/pull/1437) Update cometbft and cosmos-sdk dependencies.
* (rpc) [#1467](https://github.com/crypto-org-chain/cronos/pull/1467) Avoid unnecessary tx decode in tx listener.

### Bug Fixes

* (rpc) [#1444](https://github.com/crypto-org-chain/cronos/pull/1444) Avoid nil pointer error when query blocks before feemarket module gets enabled.
* [#1439](https://github.com/crypto-org-chain/cronos/pull/1439) Add back default prepare proposal logic.
* [#1466](https://github.com/crypto-org-chain/cronos/pull/1466) Fix handling of pending transactions related APIs.

*May 3, 2024*

Expand Down
5 changes: 1 addition & 4 deletions integration_tests/configs/upgrade-test-package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ let
shortRev = builtins.substring 0 7 rev;
};
}).defaultNix;
# v0.6.10
releasedGenesis = import (builtins.fetchTarball "https://github.com/crypto-org-chain/cronos/archive/v0.6.10.tar.gz") { };
# v0.7.0
released_0 = (fetchFlake "crypto-org-chain/cronos" "799ac47e293403bd57580d2ff96bb8d9851c3cde").default;
# v0.8.0
Expand All @@ -20,8 +18,7 @@ let
current = pkgs.callPackage ../../. { };
in
pkgs.linkFarm "upgrade-test-package" [
{ name = "genesis"; path = releasedGenesis; }
{ name = "v0.7.0"; path = released_0; }
{ name = "genesis"; path = released_0; }
{ name = "v0.7.0-hotfix"; path = released_1; }
{ name = "v1.0.0"; path = released_2; }
{ name = "v1.1.0"; path = released_3; }
Expand Down
1 change: 1 addition & 0 deletions integration_tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ def test_contract(cronos):
origin_cmd = None


@pytest.mark.unmarked
@pytest.mark.parametrize("max_gas_wanted", [80000000, 40000000, 25000000, 500000, None])
def test_tx_inclusion(cronos, max_gas_wanted):
"""
Expand Down
5 changes: 0 additions & 5 deletions integration_tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,6 @@ def do_upgrade(
wait_for_block(c.cosmos_cli(), target + 2, timeout=480)
wait_for_port(ports.rpc_port(c.base_port(0)))

target0 = cli.block_height() + 15
print("upgrade v0.7.0 height", target0)
do_upgrade("v0.7.0", target0, "block", method="submit-proposal")
cli = c.cosmos_cli()

target1 = cli.block_height() + 15
print("upgrade v0.8.0 height", target1)
gas_prices = "5000000000000basetcro"
Expand Down
1 change: 1 addition & 0 deletions versiondb/tsrocksdb/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func (s Store) HasAtVersion(storeKey string, key []byte, version *int64) (bool,
if err != nil {
return false, err
}
defer slice.Free()
return slice.Exists(), nil
}

Expand Down

0 comments on commit af0bd9c

Please sign in to comment.