Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
if: steps.changed-files.outputs.only_changed == 'false'
run: |
nix profile install ./nix#go_1_22
go tool covdata textfmt -i=integration_tests/coverage -o profile.txt
go tool covdata textfmt -i=coverage -o profile.txt
- name: Upload coverage report
if: steps.changed-files.outputs.only_changed == 'false'
uses: codecov/codecov-action@v4
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## UNRELEASED

### Bug Fixes

* [#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.

### Improvements

* [#1747](https://github.com/crypto-org-chain/cronos/pull/1747) Skip batch initialization and flush when fixdata with dry-run.

*Feb 3, 2025*

## v1.4.3
Expand Down Expand Up @@ -31,6 +41,7 @@
### Improvements

* [#1712](https://github.com/crypto-org-chain/cronos/pull/1712) Upgrade rocksdb to `v9.8.4`.
* [#1747](https://github.com/crypto-org-chain/cronos/pull/1747) Skip batch initialization and flush when fixdata with dry-run.

*Dec 2, 2024*

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ TESTS_TO_RUN ?= all

run-integration-tests:
@make gen-bindings-contracts
@nix-shell ./integration_tests/shell.nix --run ./scripts/run-integration-tests
@./scripts/run-integration-tests

.PHONY: run-integration-tests

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ require (
cloud.google.com/go/storage v1.41.0 // indirect
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/depinject v1.0.0 // indirect
cosmossdk.io/x/tx v0.13.6-0.20241003112805-ff8789a02871 // indirect
cosmossdk.io/x/tx v0.13.7 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/DataDog/datadog-go v4.8.3+incompatible // indirect
Expand Down
2 changes: 1 addition & 1 deletion gomod2nix.toml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions integration_tests/pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[pytest]
addopts = --ignore=contracts
python_files = integration_tests/*.py
4 changes: 2 additions & 2 deletions scripts/run-integration-tests
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ echo "build test contracts"
cd ../integration_tests/contracts
HUSKY_SKIP_INSTALL=1 npm install
npm run typechain
cd ..
cd ../..
TESTS_TO_RUN="${TESTS_TO_RUN:-all}"
if [[ "$TESTS_TO_RUN" == "all" ]]; then
echo "run all tests"
Expand All @@ -18,4 +18,4 @@ else
echo "run tests matching $TESTS_TO_RUN"
cmd="pytest -vv -s --session-timeout=1800 --timeout=1800 -m '$TESTS_TO_RUN'"
fi
nix-shell --run "$cmd"
nix-shell ./integration_tests/shell.nix --run "$cmd"
17 changes: 11 additions & 6 deletions versiondb/tsrocksdb/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@
return err
}
}

if dryRun {
return nil
}

Check warning on line 246 in versiondb/tsrocksdb/store.go

View check run for this annotation

Codecov / codecov/patch

versiondb/tsrocksdb/store.go#L245-L246

Added lines #L245 - L246 were not covered by tests
return s.Flush()
}

Expand All @@ -252,8 +254,11 @@
return err
}

batch := grocksdb.NewWriteBatch()
defer batch.Destroy()
var batch *grocksdb.WriteBatch
if !dryRun {
batch = grocksdb.NewWriteBatch()
defer batch.Destroy()
}

prefix := storePrefix(storeName)
readOpts := grocksdb.NewDefaultReadOptions()
Expand All @@ -262,14 +267,14 @@
realKey := cloneAppend(prefix, pair.Key)

readOpts.SetTimestamp(pair.Timestamp)
oldValue, err := s.db.GetCF(readOpts, s.cfHandle, realKey)
oldValue, oldTimestamp, err := s.db.GetCFWithTS(readOpts, s.cfHandle, realKey)
if err != nil {
return err
}

clean := bytes.Equal(oldValue.Data(), pair.Value)
clean := bytes.Equal(oldValue.Data(), pair.Value) && bytes.Equal(oldTimestamp.Data(), pair.Timestamp)
oldValue.Free()

oldTimestamp.Free()
if clean {
continue
}
Expand Down
Loading