Commit Graph

128 Commits

Author SHA1 Message Date
healthyyyoung
709c0c186b
chore: replace strings.SplitN(arg, sep, 2) with strings.Cut(arg, sep) (#24147)
Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io>
2025-04-03 17:15:34 +00:00
Tyler
cfda49b436
fix: prune cmd should disable async pruning (#24090) 2025-03-27 18:43:27 +00:00
Alex | Interchain Labs
7fd79df4e1
chore: fix all linting (#24101) 2025-03-21 15:04:36 -07:00
healthyyyoung
f6fa4f25bd
refactor(store): use map.Copy for cleaner map handling (#24076)
Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io>
2025-03-20 22:22:52 +00:00
Devon Bear
f08c8cce31
fix(store/v1): Do not panic on prune in Commit (#18897) 2023-12-27 09:47:28 -08:00
Marko
20337d9053
fix: prevent nil lastcommitid hash (#18563) 2023-11-28 15:27:42 +01:00
Marko
35955817c1
chore: prep store v1.0.0 (#18318)
Co-authored-by: Julien Robert <julien@rbrt.fr>
2023-11-01 08:20:56 +01:00
Julien Robert
c452721442
style: add gci linter (#16758)
Co-authored-by: Jacob Gadikian <faddat@users.noreply.github.com>
2023-06-29 09:46:37 +00:00
mergify[bot]
2100a73dce
fix: StateSync Restore by excluding memory store (backport #16449) (#16451)
Co-authored-by: Chill Validation <92176880+chillyvee@users.noreply.github.com>
2023-06-07 23:28:47 +00:00
cool-developer
3e18f4088b
feat: update store module for new iavl (#15568)
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
2023-06-06 19:08:35 +00:00
Marko
d1a337eb78
refactor(Store): remove abci query req and res deps from store (#16321) 2023-05-30 15:50:23 +00:00
Aleksandr Bezobchuk
6cee22df52
feat!: Comet v0.38 Integration (#15519)
Co-authored-by: marbar3778 <marbar3778@yahoo.com>
Co-authored-by: cool-developer <51834436+cool-develope@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Matt Kocubinski <mkocubinski@gmail.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
2023-05-24 16:09:19 +00:00
cool-developer
56705deb22
feat(store): add working hash (#15712)
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
2023-04-13 09:18:36 +00:00
khanh-notional
d5a618db6a
feat: More flexibility for CacheMultiStoreWithVersion (#15683)
## Description
Closes: [cosmos/gaia#2313](https://github.com/cosmos/gaia/issues/2313)

The gaia v9 upgrade causes node to errors out when querying historical states before the upgrade. This is because we added a new module store in the upgrade which is the `provider module store`. Thus, every times we load the multi store for querying at a height prior to the upgrade, we try to load the `provider module store` and fail since it has not existed before the upgrade.

I make changes to `CacheMultiStoreWithVersion` so that if we fail to load any module store at a given height, we check if that module store has existed at that height or not (using `getCommitInfo()`), we can ignore the error if the store hasn't existed at that given height.

---

### 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/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)
2023-04-10 20:30:28 +00:00
Mark Rushakoff
22bfecfe38
style: fix linting issues in store module (#15724)
## Description

- Return an exported type rather than an unexported type, from an exported function
- Assign error values to _
- Add reason to nolint directive
- Remove ineffectual assignment
- Remove checked cast to same type as value

---

### 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] 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~~
- [ ] ~~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 all author checklist items have been addressed
- [ ] confirmed that this PR does not change production code
2023-04-06 21:58:52 +00:00
Jacob Gadikian
b009a75eea
style: make lint-fix everything (#15631)
Co-authored-by: Julien Robert <julien@rbrt.fr>
2023-03-30 17:27:39 +00:00
Marko
1f2875d445
style: gofumpt linting (#15605) 2023-03-30 06:27:38 +00:00
Aleksandr Bezobchuk
ee9774af27
feat: auto-set block timestamp for historical queries (#15448) 2023-03-28 15:10:26 +00:00
Ergels Gaxhaj
6f3f2c9b16
refactor!: ADR-038 go-plugin system (#14207)
Co-authored-by: HuangYi <huang@crypto.com>
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
2023-03-14 18:09:30 +00:00
Julien Robert
fd76793378
chore: remove unnecessary condition (#15277) 2023-03-06 20:06:52 +00:00
Chill Validation
183dde8d00
fix: snapshot recover from exporter error (#13935)
Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Emmanuel T Odeke <emmanuel@orijtech.com>
Co-authored-by: Marko <marko@baricevic.me>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2023-03-06 16:44:26 +00:00
Facundo Medica
4a6a1e3cb8
refactor: fix lint issues + gofumpt (#15062) 2023-02-19 10:31:49 +00:00
Julien Robert
a7ac29e3f4
chore: rename log pkg and add zerolog (#14955) 2023-02-08 11:32:22 +00:00
Marko
281017ae90
refactor: use cosmos-sdk/log throughout (#14909)
## Description

removes the dependency of tendermint/utils/log from countless locations. This is in effort of reducing Tendermint's lib usage in the sdk 

this is nonbreaking as the interface is the same. To eliminate tm/utils/log in the sdk we need a few more things. Once we have fully removed the tendermint logger, I would propose we break the interface and define our own for our use case, when we pass the logger to tendermint in the node.New() function we can wrap our logger for its use case 

---

### 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/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)
2023-02-07 10:54:48 +00:00
Aleksandr Bezobchuk
1344ff137d
fix: exclude mem store from commit info (#14931) 2023-02-06 23:09:21 -05:00
Julien Robert
6978710699
refactor: migrate store and api to CometBFT (#14899) 2023-02-04 14:53:15 +01:00
yihuang
b266522c88
feat: add config iavl-lazy-loading to enable lazy loading of iavl store (#14189)
Co-authored-by: Marko <marbar3778@yahoo.com>
2023-01-31 21:52:32 +00:00
khanh-notional
40ca1550da
chore: Add check for uneven stores' height (#14410) 2023-01-31 01:54:29 +00:00
Likhita Polavarapu
7559d9ecd3
refactor: create go.mod for store (#14746)
Co-authored-by: Marko <marbar3778@yahoo.com>
2023-01-25 13:31:56 +00:00
Marko
f3dd51029a
refactor: remove global metrics in store (#14439) 2022-12-30 14:46:29 +01:00
Jacob Gadikian
1bb0629846
chore: iavl-v0.20-alpha1 and cosmos-db (#14411)
Co-authored-by: marbar3778 <marbar3778@yahoo.com>
2022-12-28 21:42:00 +01:00
khanh-notional
829c487de8
chore: Enforce order of store commits in root store (#14385)
Co-authored-by: Marko <marbar3778@yahoo.com>
2022-12-28 15:52:34 +00:00
Jacob Gadikian
be8c5a09c2
chore: lint tests (#14268) 2022-12-18 23:48:31 +00:00
Marko
f08ba9eafa
refactor: don't rely on sdk/codec in streaming (#14155) 2022-12-09 16:35:13 +00:00
Marko
390262f56b
refactor: remove reliance on sdk/types/errors from store (#14090)
* Move snapshotstore under store

* add changelog entry

* errors store

* remove dep on sdk/types/errors

* clean up

* fix var

* undo some changes, clean up fmt.Errorf usage

* remove pkg/errors
2022-12-03 13:11:33 +00:00
yihuang
1f91ee2ee9
fix: state listener observe writes at wrong time (#13516)
* fix: state listener observe writes at wrong time

Closes: #13457

Currently state listener is notified when the cache store write, which happens in commit event only, which breaks the current design.
The solution (as discussed in the issue) is to listen state writes on rootmulti store only.

It also changes the file streamer to output single data file for the writes in the whole block, since we can't distinguish writes from different stage of abci events.

It adds new config items for file streamer:
- streamers.file.output-metadata
- streamers.file.stop-node-on-error
- streamers.file.fsync

* synchronous abci call, and format doc

* fix comment

* update file streamer readme and fix typos

* typo

* fix: state listener observe writes at wrong time

Closes: #13457

Currently state listener is notified when the cache store write, which happens in commit event only, which breaks the current design.
The solution (as discussed in the issue) is to listen state writes on rootmulti store only.

It also changes the file streamer to output single data file for the writes in the whole block, since we can't distinguish writes from different stage of abci events.

It adds new config items for file streamer:
- streamers.file.output-metadata
- streamers.file.stop-node-on-error
- streamers.file.fsync

synchronous abci call, and format doc

fix comment

update file streamer readme and fix typos

typo

* improve UX of file streamer, make it immediately usable after enabled

- set default value to write_dir.
- make write_dir based on home directory by default.
- auto-create the directory if not exists.

* get homePage from opts

Co-authored-by: Marko <marbar3778@yahoo.com>
2022-12-02 15:43:21 +01:00
Marko
2e3d38f01c
refactor: move snapshotstore under store (#14048)
* Move snapshotstore under store

* add changelog entry

* fix build

* move snapshot proto package

* make proto-gen

* Update CHANGELOG.md

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

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2022-11-29 23:40:14 +00:00
Matt Kocubinski
8c6181aacf
reuse helper fn and add comment (#14075) 2022-11-29 20:37:31 +00:00
Emmanuel T Odeke
5a1fa2ee02
fix: store/rootmulti: correctly dispatch exporter closing while in a loop (#14027) 2022-11-29 17:45:56 +00:00
mmsqe
b63adac6f4
fix: app-hash mismatch if upgrade migration commit is interrupted (#13530)
* avoid append commit when upgrade get interrupted

* add commitStores test

* add change doc

* Update store/rootmulti/store.go

Co-authored-by: yihuang <huang@crypto.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
2022-10-24 16:02:51 +00:00
Marko
04db139e8a
chore: move pruning to store (#13609)
* move pruning to store

* add changelog entry

Co-authored-by: Julien Robert <julien@rbrt.fr>
2022-10-24 14:02:17 +02:00
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
mmsqe
dcb0c9c04c
fix: double close (#13400) 2022-09-27 18:16:13 +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
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
Marko
412e2fc86e
feat: configurable fastnode (#13321) 2022-09-20 08:49:18 +00:00
Julien Robert
6d0ef15b0a
refactor: migrate to cosmos/gogoproto (#13070) 2022-09-08 17:27:48 +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