Commit Graph

382 Commits

Author SHA1 Message Date
yihuang 15accd76fc
feat: support alternative query multistore (#13529)
* support customize query multistore

* Update CHANGELOG.md

* fix test

* Update baseapp/abci.go

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>

* Update baseapp/baseapp.go

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>

* Update baseapp/options.go

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2022-10-17 23:40:28 +08:00
yihuang bb54c597de
fix: state listener could observe discarded writes (#13459)
* fix: state listener could observe uncommitted writes

Closes: #13457

don't pass listeners to nested cached store,
only the most inner layer's cache writes should be observed.

* Update CHANGELOG.md

* add unit test

* rename

Co-authored-by: Marko <marbar3778@yahoo.com>
2022-10-06 11:41:56 +00:00
Amaury 90bd3161a1
refactor: Improve and clarify API around `AccountAddressById` (#13460)
* Revert "chore: change id to use uint64 in `AccountAddressByID` (#13411)"

This reverts commit 3d0e214446.

* Add since

* Update CLI command

* make proto-gen

* id->accNum

* No API breaking changes

* improve err msg

* Update CHANGELOG.md

Co-authored-by: Julien Robert <julien@rbrt.fr>

* Update CHANGELOG.md

Co-authored-by: Julien Robert <julien@rbrt.fr>

Co-authored-by: Julien Robert <julien@rbrt.fr>
2022-10-06 11:05:25 +00:00
Facundo Medica 87e46b2f51
refactor: remove dead code in cacheMergeIterator Domain() (#13433) 2022-10-05 08:46:41 +02:00
Julien Robert c3887986ff
chore(deps): bump github.com/cosmos/cosmos-sdk from 0.46.1 to 0.46.2 (#13447) 2022-10-04 16:18:37 +02:00
Julien Robert 9bae8a817f
build(deps): bump go minimum version to go 1.19 (#13397) 2022-09-27 21:02:02 +02:00
Julien Robert 53519ea5b3
refactor: simplify hooks implementation (#13396) 2022-09-27 20:37:26 +02:00
mmsqe dcb0c9c04c
fix: double close (#13400) 2022-09-27 18:16:13 +00:00
Facundo Medica 35e5a3dc2d
chore: add cachekv tests (#13385) 2022-09-26 08:26:43 +00:00
Emmanuel T Odeke abdf61e292
fix: all: remove map iteration non-determinism with keys + sorting (#13377) 2022-09-24 16:20:54 +00:00
Jacob Gadikian b10097fdcf
refactor: remove `storev2alpha1` (#13371) 2022-09-23 21:53:58 +00:00
Aleksandr Bezobchuk b853d3fe8f
chore: store package specification (#13209)
* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

Co-authored-by: Marko <marbar3778@yahoo.com>
2022-09-23 16:46:28 +00:00
Marko 107ffee28e
chore: upstream error on empty version (#13355)
* upstream error on empty version

* fix tests

* revert change
2022-09-21 18:31:19 +02:00
Emmanuel T Odeke 9c2aef342d
chore: all: use golang.org/x/exp/maps.(Keys, Values) where necessary (#13349)
Uses golang.org/x/exp/maps.(Keys, Values) to sort out flagged
potential non-determinism issues due to map iteration which is
randomized in maps.

These were flagged by cosmos/gosec in

* https://github.com/cosmos/cosmos-sdk/security/code-scanning/724
* https://github.com/cosmos/cosmos-sdk/security/code-scanning/725
* https://github.com/cosmos/cosmos-sdk/security/code-scanning/726
* https://github.com/cosmos/cosmos-sdk/security/code-scanning/727
* https://github.com/cosmos/cosmos-sdk/security/code-scanning/728
* https://github.com/cosmos/cosmos-sdk/security/code-scanning/729
* https://github.com/cosmos/cosmos-sdk/security/code-scanning/782
* https://github.com/cosmos/cosmos-sdk/security/code-scanning/813
* https://github.com/cosmos/cosmos-sdk/security/code-scanning/814
* https://github.com/cosmos/cosmos-sdk/security/code-scanning/816

which complained about potential non-determinism in
map iteration in which we only want appends in map iteration loops,
this change instead uses golang.org/x/exp/maps.Keys to retrieve
the keys then sort.Strings which simplifies the helper code.

This change fixes issues in:
* orm/model/ormdb: non-determinism in ExportJSON
* store/internal/proofs
* types/module
* x/auth/keeper
* x/bank
* x/genutil/client/cli

Fixes #13348
2022-09-21 02:08:13 +00:00
Marko 412e2fc86e
feat: configurable fastnode (#13321) 2022-09-20 08:49:18 +00:00
dependabot[bot] 85422881cf
build(deps): Bump github.com/cosmos/gogoproto from 1.4.1 to 1.4.2 (#13291)
Bumps [github.com/cosmos/gogoproto](https://github.com/cosmos/gogoproto) from 1.4.1 to 1.4.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/cosmos/gogoproto/releases">github.com/cosmos/gogoproto's releases</a>.</em></p>
<blockquote>
<h2>v1.4.2</h2>
<h3>Features</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/13">#13</a> Add <code>AllFileDescriptors</code> function.</li>
</ul>
<h3>Improvements</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/8">#8</a> Fix typo in <code>doc.go</code>.</li>
<li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/8">#8</a> Support for merging messages implementing Merger which are embedded by value.</li>
<li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/8">#8</a> Use reflect.Value.String() for String kinds in proto equal.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/cosmos/gogoproto/blob/main/CHANGELOG.md">github.com/cosmos/gogoproto's changelog</a>.</em></p>
<blockquote>
<h2><a href="https://github.com/cosmos/gogoproto/releases/tag/v1.4.2">v1.4.2</a> - 2022-09-14</h2>
<h3>Features</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/13">#13</a> Add <code>AllFileDescriptors</code> function.</li>
</ul>
<h3>Improvements</h3>
<ul>
<li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/8">#8</a> Fix typo in <code>doc.go</code>.</li>
<li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/8">#8</a> Support for merging messages implementing Merger which are embedded by value.</li>
<li><a href="https://github-redirect.dependabot.com/cosmos/gogoproto/pull/8">#8</a> Use reflect.Value.String() for String kinds in proto equal.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="739310d858"><code>739310d</code></a> docs: add changelog (<a href="https://github-redirect.dependabot.com/cosmos/gogoproto/issues/15">#15</a>)</li>
<li><a href="4f8afe8bcd"><code>4f8afe8</code></a> feat: add AllFileDescriptors function (<a href="https://github-redirect.dependabot.com/cosmos/gogoproto/issues/13">#13</a>)</li>
<li><a href="27e5769808"><code>27e5769</code></a> ci: fix proto registry workflow (<a href="https://github-redirect.dependabot.com/cosmos/gogoproto/issues/12">#12</a>)</li>
<li><a href="c3a0399b5e"><code>c3a0399</code></a> feat: cherry-pick improvements from <code>gogo/protobuf</code> (<a href="https://github-redirect.dependabot.com/cosmos/gogoproto/issues/8">#8</a>)</li>
<li><a href="ed9594ccc9"><code>ed9594c</code></a> chore: bump protobuf (<a href="https://github-redirect.dependabot.com/cosmos/gogoproto/issues/9">#9</a>)</li>
<li>See full diff in <a href="https://github.com/cosmos/gogoproto/compare/v1.4.1...v1.4.2">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/cosmos/gogoproto&package-manager=go_modules&previous-version=1.4.1&new-version=1.4.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
2022-09-14 19:19:00 +00:00
Julien Robert 6d0ef15b0a
refactor: migrate to `cosmos/gogoproto` (#13070) 2022-09-08 17:27:48 +00:00
Matt Kocubinski 184235e1a8
refactor: create go.mod for simapp (#13130)
* Add go.mod for simapp

* creating dep check script

* new version of cosmos-sdk

* tests/ must be a module also if it is to test simapp

* maybe add a github action which should fail

* mv tests/mocks -> testutil/mock

* Refactor usages of tests/mocks

* update build command

* fix rosetta tests

* go mod tidy

* use cosmossdk.io/simapp

* Update sim entrypoints

* use simapp as a module

* go mod tidy

* Add replaced for vuln package

* fix vuln dep

* this CI run should fail

* this CI run should succeed

* use absolute path in makefile
2022-09-07 18:14:22 +00:00
Marko e09516f479
chore: bump tendermint version (#13148) 2022-09-05 07:39:12 +00:00
Aleksandr Bezobchuk 0eacc88096
fix: fix Group-TotalWeight invariant (#13116) 2022-09-01 17:19:09 +00:00
adu-crypto d874acee4c
feat: Add a cli cmd to prune old states according to current settings (#12742)
* add PruningCmd and change PruneStores signature

* the mimimum default pruning interval is 10

Co-authored-by: Marko <marbar3778@yahoo.com>
2022-09-01 08:42:23 +00:00
Matt Kocubinski d638ca3c2b
refactor(store): move rollback_test.go to tests/integration (#13117) 2022-09-01 07:32:29 +00:00
Facundo Medica 797bd12af5
refactor!: Remove sdk.Router and refactor baseapp tests (#13005)
* test

* progress-ish

* progress

* progress

* make mocks

* progress

* test

* progress

* progress

* progress

* progress

* progress

* progress

* fix mock tests

* progress

* pretty much done, might need some tidying up

* lint

* re-enable blockgas test

* remove router

* gofumpt

* remove more references of Router

* fix

* remove unused code

* remove unused code

Co-authored-by: Marko <marbar3778@yahoo.com>
2022-08-30 23:50:47 +02:00
yihuang 51d2de582d
fix: rollback command don't actually delete multistore versions (#11361)
* rollback command don't actually delete multistore versions

Closes: #11333

- add unit tests
- use LoadVersionForOverwriting
- update tendermint dependency to 0.35.x release branch

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>

flushMetadata after rollback

Update server/rollback.go

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>

fix build

gofumpt

* fix unit test
2022-08-30 05:50:00 +00:00
dependabot[bot] 6af89d6ce3
build(deps): Bump github.com/golangci/golangci-lint from 1.48.0 to 1.49.0 (#13013)
* build(deps): Bump github.com/golangci/golangci-lint

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.48.0 to 1.49.0.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.48.0...v1.49.0)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* updates

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
2022-08-24 23:13:11 +02:00
dependabot[bot] 4fbd24616a
build(deps): Bump github.com/cosmos/cosmos-sdk in /store/tools/ics23 (#13020)
Bumps [github.com/cosmos/cosmos-sdk](https://github.com/cosmos/cosmos-sdk) from 0.46.0 to 0.46.1.
- [Release notes](https://github.com/cosmos/cosmos-sdk/releases)
- [Changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.46.1/CHANGELOG.md)
- [Commits](https://github.com/cosmos/cosmos-sdk/compare/v0.46.0...v0.46.1)

---
updated-dependencies:
- dependency-name: github.com/cosmos/cosmos-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-24 21:31:50 +02:00
atheeshp 9412bcd82a
feat: x/group tests to mocks (#12864)
## Description

Closes: #12763 



---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
2022-08-22 12:37:05 +00:00
Julien Robert 1dee068932
chore: downgrade to tendermint `v0.34.x` (#12958) 2022-08-20 02:33:07 +02:00
blazeroni 4fc1f73c8e
perf: Amortize clearing unsorted cache entries (Juno genesis fix) (#12885)
This change fixes a bounty by the Juno team.  Juno's invariant checks took 10 hours during their most recent chain halt. This PR cuts that down to 30 seconds.  See https://github.com/CosmosContracts/bounties#improve-speed-of-invariant-checks.

The root problem is deep in the `can-withdraw` invariant check, which calls this repeatedly: https://github.com/cosmos/cosmos-sdk/blob/main/x/distribution/keeper/store.go#L337.  Iterators have a chain of parents and in this case creates an iterator from the `cachekv` store.  For the genesis file, it has a cache of 500,000+ unsorted entries, which are sorted as strings here: https://github.com/cosmos/cosmos-sdk/blob/main/store/cachekv/store.go#L314.  Each delegation from `can-withdraw` uses this cache and many of the cache checks miss or are a very small range.  This means very few entries get removed from the unsorted cache and they have to be re-sorted on the next call.  With a full cache it takes about 180ms on my machine to sort them.

This change introduce a minimum number of entries that will get processed and removed from the unsorted list. It's set at the same value that directs the code to sort them in the first place.  This ensures the unsorted values get removed in a relative short amount of time, and amortizes the cost to ensure an individual check does not have to process the entire cache.

## Benchmarks
On running the benchmarks included in this change produces:
```shell
name                    old time/op    new time/op    delta
LargeUnsortedMisses-32     21.2s ± 9%      0.0s ± 1%   -99.91%  (p=0.000 n=20+17)

name                    old alloc/op   new alloc/op   delta
LargeUnsortedMisses-32    1.64GB ± 0%    0.00GB ± 0%   -99.83%  (p=0.000 n=19+19)

name                    old allocs/op  new allocs/op  delta
LargeUnsortedMisses-32     20.0k ± 0%     41.1k ± 0%  +105.23%  (p=0.000 n=19+20)
```

## Invariant checks results
This is what the invariant checks for Juno look like with this change (on a Hetzner AX101):

```shell
INF starting node with ABCI Tendermint in-process
4:11PM INF Starting multiAppConn service impl=multiAppConn module=proxy
4:11PM INF Starting localClient service connection=query impl=localClient module=abci-client
4:11PM INF Starting localClient service connection=snapshot impl=localClient module=abci-client
4:11PM INF Starting localClient service connection=mempool impl=localClient module=abci-client
4:11PM INF Starting localClient service connection=consensus impl=localClient module=abci-client
4:11PM INF Starting EventBus service impl=EventBus module=events
4:11PM INF Starting PubSub service impl=PubSub module=pubsub
4:11PM INF Starting IndexerService service impl=IndexerService module=txindex
4:11PM INF ABCI Handshake App Info hash= height=0 module=consensus protocol-version=0 software-version=v9.0.0-36-g8fd6f16
4:11PM INF ABCI Replay Blocks appHeight=0 module=consensus stateHeight=0 storeHeight=0
4:12PM INF asserting crisis invariants inv=1/11 module=x/crisis name=gov/module-account
4:12PM INF asserting crisis invariants inv=2/11 module=x/crisis name=distribution/nonnegative-outstanding
4:12PM INF asserting crisis invariants inv=3/11 module=x/crisis name=distribution/can-withdraw
4:12PM INF asserting crisis invariants inv=4/11 module=x/crisis name=distribution/reference-count
4:12PM INF asserting crisis invariants inv=5/11 module=x/crisis name=distribution/module-account
4:12PM INF asserting crisis invariants inv=6/11 module=x/crisis name=bank/nonnegative-outstanding
4:12PM INF asserting crisis invariants inv=7/11 module=x/crisis name=bank/total-supply
4:12PM INF asserting crisis invariants inv=8/11 module=x/crisis name=staking/module-accounts
4:12PM INF asserting crisis invariants inv=9/11 module=x/crisis name=staking/nonnegative-power
4:12PM INF asserting crisis invariants inv=10/11 module=x/crisis name=staking/positive-delegation
4:12PM INF asserting crisis invariants inv=11/11 module=x/crisis name=staking/delegator-shares
4:12PM INF asserted all invariants duration=28383.559601 height=4136532 module=x/crisis
```

## Alternatives
There is another PR which fixes this problem for the Juno genesis file https://github.com/cosmos/cosmos-sdk/pull/12886. However, because of its concurrent nature, it happens to hit a large range relatively early, clearing the unsorted entries and allowing the rest of the checks to not sort it.
2022-08-18 15:13:39 +00:00
Julien Robert 8e9e330d29
build: ensure `GOWORK=off make test` passes (#12951) 2022-08-18 15:20:27 +02:00
Matt Kocubinski 0ed7360921
fix(store): handle nil end in cachekv/iterator (#12945)
## Description

Closes: #12661 

Adds support for nil end semantics to iterators in cachekv store, addressing [this workaround](4176b287d4/osmoutils/store_helper.go (L37-L41)).  

Note that this has the effect of sorting the dirty cache into the BTree cache store in the bounds `[startIndex, end-of-cache-space]`



---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [x] provided a link to the relevant issue or specification
- [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [x] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
2022-08-17 19:37:31 +00:00
Julien Robert d5d6e8bf0a
chore: `go work sync` & `gofumpt` (#12946)
## Description

- Fixes the linting issues introduced in https://github.com/cosmos/cosmos-sdk/pull/12781 (now that golangci is required)
- Run `go work sync`

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
2022-08-17 16:03:28 +00:00
Jacob Gadikian 0943a70215
chore: fix linting issues exposed by fixing golangci-lint (#12895)
Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
2022-08-11 22:00:24 +02:00
Julien Robert 1c16c11d5a
fix: re-add `cosmovisor` in `go.work` to fix `make test` (#12884) 2022-08-10 15:12:23 +02:00
Matt Kocubinski 8f9a88cf22
fix: simulation failures (#12858)
* fix: store compare bug causing simulation failures

- handle err in staking/keeper/InitGenesis SetParams
- handle Params type text render in staking

* fix bug in x/gov simulation operations

Co-authored-by: Marko <marbar3778@yahoo.com>
2022-08-08 17:48:26 -04:00
dependabot[bot] 970582d183
build(deps): Bump github.com/cosmos/iavl in /store/tools/ics23 (#12804)
Bumps [github.com/cosmos/iavl](https://github.com/cosmos/iavl) from 0.19.0 to 0.19.1.
- [Release notes](https://github.com/cosmos/iavl/releases)
- [Changelog](https://github.com/cosmos/iavl/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cosmos/iavl/compare/v0.19.0...v0.19.1)

---
updated-dependencies:
- dependency-name: github.com/cosmos/iavl
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
2022-08-04 09:56:46 +02:00
Emmanuel T Odeke 2f4faa58c1
fix: orm/*, store/*: fix non-determinism from map iteration (#12751)
Reported by informalsystems/gosec's map iteration pass, this
change fixes non-determinism from iterating with a map, whose
definition in the Go spec guarantees that the order of keys
and values presented during iteration will be randomized.

Fixes #12428
Fixes #12430
Fixes #12431
2022-07-27 21:10:32 +02:00
dependabot[bot] b4a5160c32
build(deps): Bump github.com/cosmos/cosmos-sdk in /store/tools/ics23 (#12735)
Bumps [github.com/cosmos/cosmos-sdk](https://github.com/cosmos/cosmos-sdk) from 0.46.0-rc3 to 0.46.0.
- [Release notes](https://github.com/cosmos/cosmos-sdk/releases)
- [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md)
- [Commits](https://github.com/cosmos/cosmos-sdk/compare/v0.46.0-rc3...v0.46.0)

---
updated-dependencies:
- dependency-name: github.com/cosmos/cosmos-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-26 19:10:49 +02:00
Jacob Gadikian 5decd22cd3
chore: use `math.Int` instead of `math.Int` and apply linting (#12702)
* linting round

* fix changelog

* revert docs changes

* Update CHANGELOG.md

* revert an accidental change to security.md

* Update simapp/integration/client/grpc/tmservice/service_test.go

Co-authored-by: Julien Robert <julien@rbrt.fr>
2022-07-26 00:24:47 +02:00
Matt Kocubinski ef8049ae6b
refactor: remove dependency on simapp from store test (#12716)
## Description

Removes a trivial simapp dependency from `store/`.



---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
2022-07-25 14:58:33 +00:00
dependabot[bot] dc03ed1cd7
build(deps): Bump github.com/tendermint/tendermint in /store/tools/ics23 (#12663)
Bumps [github.com/tendermint/tendermint](https://github.com/tendermint/tendermint) from 0.35.8 to 0.35.9.
- [Release notes](https://github.com/tendermint/tendermint/releases)
- [Changelog](https://github.com/tendermint/tendermint/blob/v0.35.9/CHANGELOG.md)
- [Commits](https://github.com/tendermint/tendermint/compare/v0.35.8...v0.35.9)

---
updated-dependencies:
- dependency-name: github.com/tendermint/tendermint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-21 10:41:25 +02:00
Jacob Gadikian d94001c673
chore: Upgrade cosmovisor & ics23 (#12645)
* tidy-all

* Update upgrade_test.go

use correct sdk path

* Update upgrade_test.go

https

* Update CHANGELOG.md

* use main sdk branch for ics23

* Update CHANGELOG.md

Co-authored-by: Julien Robert <julien@rbrt.fr>

* 46-rc3 for ics23

* 46-rc3 for ics23

Co-authored-by: Julien Robert <julien@rbrt.fr>
2022-07-21 09:57:31 +02:00
Roman 6f631156f8
chore(store): upgrade iavl to v0.19.0 (#12626)
## Description

Closes: #XXXX

Upgrading IAVL to v0.19. This version includes the fast index optimization and errors propagated up top.

Currently, SDK panics on any db error, leaving the proper error handling and refactoring to future work.

Similar change in Osmosis fork, ref: https://github.com/osmosis-labs/cosmos-sdk/pull/108

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [x] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [x] provided a link to the relevant issue or specification
- [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [x] added a changelog entry to `CHANGELOG.md`
- [x] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [x] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [x] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
2022-07-20 12:25:10 +00:00
Marko 2c03973194
chore: check if pubkey is nil (#12623) 2022-07-18 21:41:04 -04:00
dependabot[bot] e84b5a48c1
build(deps): Bump github.com/cosmos/iavl in /store/tools/ics23 (#12622)
Bumps [github.com/cosmos/iavl](https://github.com/cosmos/iavl) from 0.17.3 to 0.19.0.
- [Release notes](https://github.com/cosmos/iavl/releases)
- [Changelog](https://github.com/cosmos/iavl/blob/master/CHANGELOG.md)
- [Commits](https://github.com/cosmos/iavl/compare/v0.17.3...v0.19.0)

---
updated-dependencies:
- dependency-name: github.com/cosmos/iavl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-18 22:02:30 +02:00
dependabot[bot] 26b567efaa
build(deps): Bump github.com/cosmos/cosmos-sdk in /store/tools/ics23 (#12621) 2022-07-18 20:05:23 +02:00
Jacob Gadikian 7c43d52b2b
chore: gogo/protobuf v1.3.2 (#12596)
## Description

This helps to prepare for #11453 by removing the ics23 dependency on gogo/protobuf v1.3.3 which does not exist.

It will have an outsized quality of life impact.

For reference the way to do this is:

* keep the replace as-is
* `go get github.com/gogo/protobuf@v1.3.2`

### Affects
* cosmovisor
* ics23
* sdk

### Prerequisite to:

* #11453 (or maybe it helps it happen?  I think after this we won't get those troublesome 1.3.3 imports)

Maybe not exactly a prerequisite, more like something that will reduce the review scope of #11453 and also eliminate this problem for downstream users of the sdk. 

To clarify the purpose here, the command go work sink, does not work because the upstream version 1.3.3 does not exist in gogo/protobuf

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [x] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [x] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
2022-07-18 09:48:02 +00:00
Nathan Dias 901a2047e4
fix: store/rootmulti: fix non-deterministic map iteration (#12487)
## Description

This change fixes non-deterministic map iteration over rs.stores from (*Store).buildCommitInfo by instead sorting the keys then iterating over the sorted slice.

Fixes https://github.com/cosmos/cosmos-sdk/issues/12429

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [x] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [x] provided a link to the relevant issue or specification
- [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [x] added a changelog entry to `CHANGELOG.md`
- [x] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [x] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [x] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
2022-07-12 06:59:31 +00:00
dependabot[bot] fadbf6be71
build(deps): Bump github.com/cosmos/cosmos-sdk in /store/tools/ics23 (#12525)
Bumps [github.com/cosmos/cosmos-sdk](https://github.com/cosmos/cosmos-sdk) from 0.45.0 to 0.45.6.
- [Release notes](https://github.com/cosmos/cosmos-sdk/releases)
- [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md)
- [Commits](https://github.com/cosmos/cosmos-sdk/compare/v0.45.0...v0.45.6)

---
updated-dependencies:
- dependency-name: github.com/cosmos/cosmos-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-11 22:13:00 +02:00
Shi Wenbin 73d50258d7
optimize store.write (#12494) 2022-07-11 11:57:08 -04:00