Skip to content

Commit d832bc1

Browse files
authoredFeb 27, 2025··
Problem: recent bug fixes are not included (#1754)
* Problem: unable to resolve octokit action v2.0.0 (#1750) for more info, https://github.com/crypto-org-chain/cronos/actions/runs/13386690642 * Problem: conflict of index uniqueness constrain violation on trace api (#1753) * Problem: conflict of index uniqueness constrain violation on trace api * test * update deps * bump go * Problem: slices in ReadOptions is freed by gc while referenced in rocksdb (#1751) * Problem: no deallocate read options * doc * sync deps * add doc * Problem: ReadOptions mutated by reference release in iterator fix is not included * deps
1 parent 873900d commit d832bc1

14 files changed

+157
-59
lines changed
 

‎.github/workflows/sims.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7777
- name: Github API Request
7878
id: request
79-
uses: octokit/request-action@v2.0.0
79+
uses: octokit/request-action@main
8080
if: github.event_name == 'issue_comment'
8181
with:
8282
route: ${{ github.event.issue.pull_request.url }}

‎CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
### Bug Fixes
66

77
* [#1748](https://github.com/crypto-org-chain/cronos/pull/1748) Query with GetCFWithTS to compare both timestamp and key to avoid run fixdata multiple times.
8+
* (versiondb) [#1751](https://github.com/crypto-org-chain/cronos/pull/1751) Add missing Destroy for read options to properly hold and release options reference.
9+
* [#1753](https://github.com/crypto-org-chain/cronos/pull/1753) Support legacy global AccountNumber.
10+
* (versiondb) [#1758](https://github.com/crypto-org-chain/cronos/pull/1758) Avoid ReadOptions mutated by reference release in iterator.
811

912
### Improvements
1013

‎flake.lock

+45-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎flake.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
flake = false;
88
};
99
gomod2nix = {
10-
url = "github:obreitwi/gomod2nix/fix/go_mod_vendor";
10+
url = "github:nix-community/gomod2nix";
1111
inputs.nixpkgs.follows = "nixpkgs";
1212
inputs.flake-utils.follows = "flake-utils";
1313
};

‎go.mod

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/crypto-org-chain/cronos/v2
22

3-
go 1.23.1
3+
go 1.23.3
44

55
require (
66
cosmossdk.io/api v0.7.6
@@ -39,7 +39,7 @@ require (
3939
github.com/spf13/cobra v1.8.1
4040
github.com/spf13/pflag v1.0.5
4141
github.com/spf13/viper v1.19.0
42-
github.com/stretchr/testify v1.9.0
42+
github.com/stretchr/testify v1.10.0
4343
golang.org/x/crypto v0.28.0
4444
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142
4545
google.golang.org/grpc v1.67.1
@@ -253,7 +253,7 @@ require (
253253
replace (
254254
cosmossdk.io/store => github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254
255255
cosmossdk.io/x/tx => github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254
256-
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.43.0-beta1.0.20241217090828-cfbca9fe8254
256+
github.com/cosmos/cosmos-sdk => github.com/crypto-org-chain/cosmos-sdk v0.43.0-beta1.0.20250224030921-39d7b26bbb97
257257
)
258258

259259
replace (
@@ -272,11 +272,12 @@ replace (
272272
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
273273
github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240926023215-d2275b4afb9a
274274
// release/v1.4.x
275-
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20241217093037-21bd7ce300e8
275+
github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20250109075157-62042e2252f6
276276
// Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities.
277277
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
278278
github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0
279279
github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0
280+
github.com/linxGnu/grocksdb => github.com/mmsqe/grocksdb v0.0.0-20250224034712-04aa63064718
280281
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
281282
github.com/tidwall/btree => github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c
282283
)

‎go.sum

+8-7
Original file line numberDiff line numberDiff line change
@@ -422,14 +422,14 @@ github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c h1:MOgfS4+F
422422
github.com/crypto-org-chain/btree v0.0.0-20240406140148-2687063b042c/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
423423
github.com/crypto-org-chain/cometbft v0.0.0-20250203071505-1964da4a0cac h1:o09a/x43av8lYlJ0c8ChRU11iGYyqMvbeOz7skV6f6Y=
424424
github.com/crypto-org-chain/cometbft v0.0.0-20250203071505-1964da4a0cac/go.mod h1:khbgmtxbgwJfMqDmnGY4rl2sQpTdzpPb1f9nqnfpy1o=
425-
github.com/crypto-org-chain/cosmos-sdk v0.43.0-beta1.0.20241217090828-cfbca9fe8254 h1:qmTKLerKyvXGxIt4lThZ9QPpZYw9w8e4Bm36CNPI5S8=
426-
github.com/crypto-org-chain/cosmos-sdk v0.43.0-beta1.0.20241217090828-cfbca9fe8254/go.mod h1:JwwsMeZldLN20b72mmbWPY0EV9rs+v/12hRu1JFttvY=
425+
github.com/crypto-org-chain/cosmos-sdk v0.43.0-beta1.0.20250224030921-39d7b26bbb97 h1:Aj5lZUTybx2x4fcHNYqWT4Ih8sql6qZkUFRytqwgcmo=
426+
github.com/crypto-org-chain/cosmos-sdk v0.43.0-beta1.0.20250224030921-39d7b26bbb97/go.mod h1:JwwsMeZldLN20b72mmbWPY0EV9rs+v/12hRu1JFttvY=
427427
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254 h1:NEgy0r3otU/O+0OAjMdEhbn4VotQlg+98hHbD7M23wU=
428428
github.com/crypto-org-chain/cosmos-sdk/store v0.0.0-20241217090828-cfbca9fe8254/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM=
429429
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254 h1:JzLOFRiKsDtLJt5h0M0jkEIPDKvFFyja7VEp7gG6O9U=
430430
github.com/crypto-org-chain/cosmos-sdk/x/tx v0.0.0-20241217090828-cfbca9fe8254/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w=
431-
github.com/crypto-org-chain/ethermint v0.6.1-0.20241217093037-21bd7ce300e8 h1:R07pGqWiqQNJonAA6htHUlniWRYP4ZnZEAVLLWX6E8Y=
432-
github.com/crypto-org-chain/ethermint v0.6.1-0.20241217093037-21bd7ce300e8/go.mod h1:9FNO9k70szJ7CEge4tnJraWu3baTbwNxjpZhZBqlMok=
431+
github.com/crypto-org-chain/ethermint v0.6.1-0.20250109075157-62042e2252f6 h1:TFO18Bi2Rp/N/9T+6xSXXHM5CBY8MKSDdo/o39aeBZU=
432+
github.com/crypto-org-chain/ethermint v0.6.1-0.20250109075157-62042e2252f6/go.mod h1:b/zGbkkYhrshNpuHTk1sCA5Teyo5d3Ex3CpPdq8f+ZA=
433433
github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716 h1:OvD5Rm0B6LHUJk6z858UgwdP72jU2DuUdXeclRyKpDI=
434434
github.com/crypto-org-chain/go-block-stm v0.0.0-20240919080136-6c49aef68716/go.mod h1:iwQTX9xMX8NV9k3o2BiWXA0SswpsZrDk5q3gA7nWYiE=
435435
github.com/crypto-org-chain/go-ethereum v1.10.20-0.20240926023215-d2275b4afb9a h1:IUPD+dg1YQl8cLocxQ/Mbx/ObTgAgcrZlcBhFjsLO40=
@@ -850,8 +850,6 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
850850
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
851851
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
852852
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
853-
github.com/linxGnu/grocksdb v1.9.7 h1:Bp2r1Yti/IXxEobZZnDooXAui/Q+5gVqgQMenLWyDUw=
854-
github.com/linxGnu/grocksdb v1.9.7/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA=
855853
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
856854
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
857855
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
@@ -894,6 +892,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
894892
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
895893
github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A=
896894
github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4=
895+
github.com/mmsqe/grocksdb v0.0.0-20250224034712-04aa63064718 h1:c9jefT+GQBp+6chgOYfDdrtlbYf6dj+davhcPtNEQbY=
896+
github.com/mmsqe/grocksdb v0.0.0-20250224034712-04aa63064718/go.mod h1:C3CNe9UYc9hlEM2pC82AqiGS3LRW537u9LFV4wIZuHk=
897897
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
898898
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
899899
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
@@ -1094,8 +1094,9 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F
10941094
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
10951095
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
10961096
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
1097-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
10981097
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1098+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
1099+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
10991100
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
11001101
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
11011102
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=

‎gomod2nix.toml

+10-10
Large diffs are not rendered by default.

‎integration_tests/configs/upgrade-test-package.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let
2020
(fetchFlake "crypto-org-chain/cronos" "1aea999eef67a0a01b22422bad94b36e45b9759a").default;
2121
# release/v1.3.x
2222
released1_3 =
23-
(fetchFlake "crypto-org-chain/cronos" "e1d819c862b30f0ce978baf2addb12516568639e").default;
23+
(fetchFlake "crypto-org-chain/cronos" "dd3cea2df41732ef030a1f830244e340f3cf6bf0").default;
2424
# release/v1.4.x
2525
released1_4 =
2626
(fetchFlake "crypto-org-chain/cronos" "ce797fa995000530ee53cd1fbeb3c67180648002").default;

‎integration_tests/cosmoscli.py

+5
Original file line numberDiff line numberDiff line change
@@ -1851,6 +1851,11 @@ def restore_versiondb(self, height, format=3):
18511851
"changeset", "restore-versiondb", height, format, home=self.data_dir
18521852
)
18531853

1854+
def changeset_fixdata(self, versiondb_dir, dry_run=False):
1855+
return self.raw(
1856+
"changeset", "fixdata", versiondb_dir, "--dry-run" if dry_run else None
1857+
)
1858+
18541859
def dump_snapshot(self, height, tarball, format=3):
18551860
return self.raw(
18561861
"snapshots", "dump", height, format, home=self.data_dir, output=tarball

‎integration_tests/test_upgrade.py

+22
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import shutil
33
import stat
44
import subprocess
5+
import time
56
from contextlib import contextmanager
67
from datetime import datetime, timedelta
78
from pathlib import Path
@@ -19,6 +20,7 @@
1920
assert_gov_params,
2021
deploy_contract,
2122
edit_ini_sections,
23+
eth_to_bech32,
2224
get_consensus_params,
2325
get_send_enable,
2426
send_transaction,
@@ -291,6 +293,23 @@ def do_upgrade(plan_name, target, mode=None):
291293
assert txs == get_txs(base_port, height)
292294

293295
gov_param = cli.query_params("gov")
296+
297+
c.supervisorctl("stop", "cronos_777-1-node0")
298+
time.sleep(3)
299+
cli.changeset_fixdata(f"{c.base_dir}/node0/data/versiondb")
300+
print(cli.changeset_fixdata(f"{c.base_dir}/node0/data/versiondb", dry_run=True))
301+
c.supervisorctl("start", "cronos_777-1-node0")
302+
wait_for_port(ports.evmrpc_port(c.base_port(0)))
303+
304+
to = "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f"
305+
with pytest.raises(AssertionError) as err:
306+
cli.query_account(eth_to_bech32(to))
307+
assert "crc194dkcxfu88f2aj62nyzjqa8x7vjjtzs0jwcj06 not found" in str(err.value)
308+
receipt = send_transaction(w3, {"to": to, "value": 10, "gas": 21000})
309+
method = "debug_traceTransaction"
310+
params = [receipt["transactionHash"].hex(), {"tracer": "callTracer"}]
311+
tx_bf = w3.provider.make_request(method, params)
312+
294313
cli = do_upgrade("v1.4", cli.block_height() + 15)
295314

296315
assert_evm_params(cli, e0, target_height0 - 1)
@@ -305,6 +324,9 @@ def do_upgrade(plan_name, target, mode=None):
305324
cli = do_upgrade("v1.4.0-rc5-testnet", cli.block_height() + 15)
306325
check_basic_tx(c)
307326

327+
tx_af = w3.provider.make_request(method, params)
328+
assert tx_af.get("result") == tx_bf.get("result"), tx_af
329+
308330

309331
def test_cosmovisor_upgrade(custom_cronos: Cronos, tmp_path_factory):
310332
exec(custom_cronos, tmp_path_factory)

‎nix/build_overlay.nix

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# some basic overlays necessary for the build
2-
final: super: {
2+
final: super:
3+
let
4+
replaceLast =
5+
newVal: l:
6+
let
7+
len = builtins.length l;
8+
in
9+
if len == 0 then [ ] else final.lib.lists.take (len - 1) l ++ [ newVal ];
10+
in
11+
{
12+
go_1_23 = super.go_1_23.overrideAttrs (old: rec {
13+
version = "1.23.4";
14+
src = final.fetchurl {
15+
url = "https://go.dev/dl/go${version}.src.tar.gz";
16+
hash = "sha256-rTRaxCHpCBQpOpaZzKGd1SOCUcP2h5gLvK4oSVsmNTE=";
17+
};
18+
# https://github.com/NixOS/nixpkgs/pull/372367
19+
patches = replaceLast ./go_no_vendor_checks-1.23.patch old.patches;
20+
});
321
rocksdb = final.callPackage ./rocksdb.nix { };
422
golangci-lint = final.callPackage ./golangci-lint.nix { };
523
}

‎nix/go_no_vendor_checks-1.23.patch

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/src/cmd/go/internal/modload/import.go b/src/cmd/go/internal/modload/import.go
2+
index a3105b6b6d..0e10154a70 100644
3+
--- a/src/cmd/go/internal/modload/import.go
4+
+++ b/src/cmd/go/internal/modload/import.go
5+
@@ -345,7 +345,7 @@ func importFromModules(ctx context.Context, path string, rs *Requirements, mg *M
6+
// vendor/modules.txt does not exist or the user manually added directories to the vendor directory.
7+
// Go 1.23 and later require vendored packages to be present in modules.txt to be imported.
8+
_, ok := vendorPkgModule[path]
9+
- if ok || (gover.Compare(MainModules.GoVersion(), gover.ExplicitModulesTxtImportVersion) < 0) {
10+
+ if ok || (gover.Compare(MainModules.GoVersion(), gover.ExplicitModulesTxtImportVersion) < 0) || os.Getenv("GO_NO_VENDOR_CHECKS") == "1" {
11+
mods = append(mods, vendorPkgModule[path])
12+
dirs = append(dirs, dir)
13+
roots = append(roots, vendorDir)
14+
diff --git a/src/cmd/go/internal/modload/vendor.go b/src/cmd/go/internal/modload/vendor.go
15+
index b2cb44100e..05bf3829d5 100644
16+
--- a/src/cmd/go/internal/modload/vendor.go
17+
+++ b/src/cmd/go/internal/modload/vendor.go
18+
@@ -159,7 +159,7 @@ func checkVendorConsistency(indexes []*modFileIndex, modFiles []*modfile.File, m
19+
panic(fmt.Errorf("not in workspace mode but number of indexes is %v, not 1", len(indexes)))
20+
}
21+
index := indexes[0]
22+
- if gover.Compare(index.goVersion, "1.14") < 0 {
23+
+ if gover.Compare(index.goVersion, "1.14") < 0 || (os.Getenv("GO_NO_VENDOR_CHECKS") == "1" && len(vendorMeta) == 0) {
24+
// Go versions before 1.14 did not include enough information in
25+
// vendor/modules.txt to check for consistency.
26+
// If we know that we're on an earlier version, relax the consistency check.

0 commit comments

Comments
 (0)
Please sign in to comment.