Commit Graph

29 Commits

Author SHA1 Message Date
Joel Smith 1b530599b8
feat: update to Cosmos SDK v0.47.12 (#160)
* Proof of Authority for tendermint consensus

allows validators to have 0 delegated tokens

* Make staking keeper know about wormhole keeper

* Implement IsConsensusGuardian

* Add SECURITY and README updates

* Revert "Add SECURITY and README updates"

This reverts commit 6171558c35.

* Update README

* Fix simapp compilation

* Check self-delegation against provided minimum

* staking/keeper: remove stale comment

this case is now handled properly

* staking: Fix potential division-by-zero

`v.DelegatorShares` can be 0 so don't allow division in that case.

* Refactor Staking Initialization

* Set Wormhole Keeper on Module

* Print to stderr

* Handle Errs on Genesis Init

* Handle Err

* Update Exp Module

* Update gogoproto

* Update Prometheus Version

---------

Co-authored-by: Csongor Kiss <kiss.csongor.kiss@gmail.com>
Co-authored-by: Csongor Kiss <ckiss@jumptrading.com>
Co-authored-by: Chirantan Ekbote <cekbote@jumptrading.com>
2024-11-25 14:54:03 -06:00
mergify[bot] 56f5b59ac4
fix(runtime): allow to properly register non app wiring modules (backport #17284) (#17305)
Co-authored-by: Julien Robert <julien@rbrt.fr>
2023-08-07 12:36:27 +00:00
Julien Robert 8b60d4112b
refactor: migrate to CometBFT in v0.47 (#15060) 2023-02-20 16:36:58 +01:00
mergify[bot] e1f73a2b70
refactor: improve `x/upgrade` app wiring (part of upgrade audit) (backport #14216) (#14306)
Co-authored-by: Julien Robert <julien@rbrt.fr>
2022-12-15 18:18:14 +00:00
mergify[bot] ac05af3630
fix: app config and simapp (v1,v2) fixes (backport #14209) (#14230)
Co-authored-by: Julien Robert <julien@rbrt.fr>
2022-12-09 13:52:49 +01:00
mergify[bot] 932e08c80b
fix: runtime: fix (*App).RegisterMoodules inconsistency in checking/memoizing appModule (#14128) (#14129) 2022-12-02 20:00:16 +00:00
mergify[bot] 3f2266a81a
refactor!: migrate to core appmodule.AppModule extension interfaces (#13794) (#13866)
(cherry picked from commit ec27c5384b76427bf46a194a94ba4b4eed487e4d)

Co-authored-by: Aaron Craelius <aaron@regen.network>
2022-11-15 13:25:12 +01:00
Aaron Craelius bcdf81cbaf
feat: add basic autocli config to every module (#13786)
* feat: add autocli configs to every module

* auto-discover config

* tests + gov, auth config tweaks

* docs

* Update x/auth/autocli.go

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

* Update x/auth/autocli.go

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

* cleanup

Co-authored-by: Julien Robert <julien@rbrt.fr>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
2022-11-09 11:44:42 +00:00
Aaron Craelius 74e9d542d2
feat!: integrate autocli and reflection services with simapp legacy (#13746)
* feat!: integrate autocli and reflection services with simapp legacy

* rename alias

* update UPGRADING.md

Co-authored-by: Julien Robert <julien@rbrt.fr>
2022-11-08 12:32:49 +00:00
Julien Robert 97bd2ab792
refactor: remove unused code (#13725) 2022-11-02 11:50:47 +01:00
Aaron Craelius b9e65b6d41
feat: add autocli app wiring + remote info support (#13281) 2022-11-01 21:34:59 +00:00
Aaron Craelius f3a558c6b4
refactor!: require exported app wiring providers (#13292) 2022-10-10 20:27:44 +00:00
Aleksandr Bezobchuk c60c55616d
feat: gRPC query for operator and chain configuration (#13485) 2022-10-10 19:12:00 +00:00
Julien Robert 92394f2917
feat!: specify module to export (#13437) 2022-10-04 10:06:30 +00:00
Julien Robert b76f338511
refactor: move `simapp.App` to `runtime.AppI` (#13378)
* refactor: move `simapp.App` to `runtime.AppI`

* add changelog

* `go mod tidy`

* fix app legacy build
2022-09-24 11:49:11 +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 52bc0c16d3
refactor: rename depinject imports to cosmossdk.io/depinject (#12479) 2022-07-09 17:46:07 +02:00
Aleksandr Bezobchuk c6315ec1b1
chore: simplify and refactor linting (#12318)
## Description

- Use tools methodology to use canonically versioned tools/binaries (e.g. golangci-lint)
  - This makes it so that all environments and developers use the same versions of tools (no need to rely on hacky docker containers)
- Update makefile
- Address linting errors

---

### 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-06-21 17:49:36 +00:00
Julien Robert aba9bdc24c
feat: decouple `x/capability` from simapp (#12256) 2022-06-17 00:47:38 +02:00
likhita-809 bfb91ab7bc
feat: add x/group app wiring integration tests (#12243)
## Description

ref: #12024 



---

### 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-06-15 05:31:27 +00:00
Marie Gauthier 7688ce6e44
feat: migrate x/genutil to app wiring (#12124)
* Add genutil module.proto and module init

* Update simapp

* Add provideDeliverTx to runtime

* Update x/genutil/module.go

* Update x/genutil/module.go

Co-authored-by: Marko <marbar3778@yahoo.com>
2022-06-10 11:56:06 +02:00
Julien Robert c859589f2f
feat: app wiring setup for tx's and ante/post handlers (#12193)
## Description

Closes: #12056



---

### 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-06-09 23:43:06 +00:00
Facundo Medica 2b7aca73d2
feat: add MsgServiceRouter to Baseapp (and runtime's provideCodecs) (#12168)
## Description

This PR adds a way to provide through depinject BaseApp's MsgServiceRouter, required for `x/auth`. Ref: #12125



---

### 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))
- [ ] 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-06-06 20:58:28 +00:00
Jacob Gadikian 78e2e35f80
chore: sdk.Int to math.Int (#12132)
## Description

When locally working with golangci-lint, we can see that there were many deprecation warnings about sdk.Int.  This PR resolves that and makes 1-2 other linting related changes.  Issue on linting coming next.

This also moves BitCurve to bitCurve.

I expect that this set of changes will require several pull requests, one of them to the settings for the linter. 

It also does a gofumpt, because we had various formatting-related linters fail, too. 


---

### 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
- [ ] 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
- [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-06-03 12:17:02 +00:00
Aaron Craelius dfe29ee2bf
feat(x/auth): app wiring setup (#12019) 2022-05-27 16:54:49 -04:00
Facundo Medica c17f38d224
refactor!: rename container to cosmossdk.io/depinject (#12020)
* chore: rename container to cosmossdk.io/container

* fix imports

* add replace for container

* remove replace

* add replace

* fix replace

* fix replace

* fix replace

* fix replace

* fix replace

* try to fix replace

* rename to depinject

* rename to depinject

* do not use vanity URL for now

* try fix tests

* try fix tests

* try fix tests

* build -> inject

* build -> inject

* go mod tidy

* fix dep vulnerability

* fix dep vulnerability

* fix Dockerfile for liveness-test

* fix codeql error

* try to solve dependency review

* try to solve dependency review

* go mod tidy

* try to fix tests

* another try
2022-05-27 19:34:48 +02:00
Matt Kocubinski 52fdb08d6a
fix: app wiring simulation failures (#12051) 2022-05-26 16:28:47 -04:00
Matt Kocubinski b363e0172e
fix: call SetOrderExportGenesis from SimApp (#12048)
## Description

This was causing sim failures like: 

```
exporting genesis...
2022-05-25T10:36:38-05:00 INFO asserting crisis invariants inv=0/12 module=x/crisis name=gov/module-account
2022-05-25T10:36:38-05:00 INFO asserting crisis invariants inv=1/12 module=x/crisis name=bank/nonnegative-outstanding
2022-05-25T10:36:38-05:00 INFO asserting crisis invariants inv=2/12 module=x/crisis name=bank/total-supply
2022-05-25T10:36:38-05:00 INFO asserting crisis invariants inv=3/12 module=x/crisis name=group/Group-TotalWeight
2022-05-25T10:36:38-05:00 INFO asserting crisis invariants inv=4/12 module=x/crisis name=distribution/nonnegative-outstanding
2022-05-25T10:36:38-05:00 INFO asserting crisis invariants inv=5/12 module=x/crisis name=distribution/can-withdraw
2022-05-25T10:36:38-05:00 INFO asserting crisis invariants inv=6/12 module=x/crisis name=distribution/reference-count
2022-05-25T10:36:38-05:00 INFO asserting crisis invariants inv=7/12 module=x/crisis name=distribution/module-account
2022-05-25T10:36:38-05:00 INFO asserting crisis invariants inv=8/12 module=x/crisis name=staking/module-accounts
2022-05-25T10:36:38-05:00 INFO asserting crisis invariants inv=9/12 module=x/crisis name=staking/nonnegative-power
2022-05-25T10:36:38-05:00 INFO asserting crisis invariants inv=10/12 module=x/crisis name=staking/positive-delegation
2022-05-25T10:36:38-05:00 INFO asserting crisis invariants inv=11/12 module=x/crisis name=staking/delegator-shares
2022-05-25T10:36:39-05:00 INFO asserted all invariants duration=1194.381198 height=50 module=x/crisis
importing genesis...
--- FAIL: TestAppSimulationAfterImport (20.98s)
panic: validator set is empty after InitGenesis, please ensure at least one validator is initialized with a delegation greater than or equal to the DefaultPowerReduction ({824635701280}) [recovered]
	panic: validator set is empty after InitGenesis, please ensure at least one validator is initialized with a delegation greater than or equal to the DefaultPowerReduction ({824635701280})

goroutine 76 [running]:
testing.tRunner.func1.2({0x1b88020, 0xc0035d70b0})
	/home/mkoco/sdk/go1.18.2/src/testing/testing.go:1389 +0x24e
testing.tRunner.func1()
	/home/mkoco/sdk/go1.18.2/src/testing/testing.go:1392 +0x39f
panic({0x1b88020, 0xc0035d70b0})
	/home/mkoco/sdk/go1.18.2/src/runtime/panic.go:838 +0x207
github.com/cosmos/cosmos-sdk/types/module.(*Manager).InitGenesis(_, {{0x28b5990, 0xc0001b2000}, {0x28c2da0, 0xc002494600}, {{0x0, 0x0}, {0x0, 0x0}, 0x0, ...}, ...}, ...)
	/home/mkoco/dev/regen/cosmos-sdk/types/module/module.go:329 +0x4fd
github.com/cosmos/cosmos-sdk/runtime.(*App).InitChainer(_, {{0x28b5990, 0xc0001b2000}, {0x28c2da0, 0xc002494600}, {{0x0, 0x0}, {0x0, 0x0}, 0x0, ...}, ...}, ...)
	/home/mkoco/dev/regen/cosmos-sdk/runtime/app.go:121 +0x12e
github.com/cosmos/cosmos-sdk/simapp.(*SimApp).InitChainer(_, {{0x28b5990, 0xc0001b2000}, {0x28c2da0, 0xc002494600}, {{0x0, 0x0}, {0x0, 0x0}, 0x0, ...}, ...}, ...)
	/home/mkoco/dev/regen/cosmos-sdk/simapp/app.go:504 +0x178
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).InitChain(0xc000fb1340, {{0x0, 0x0, 0x0}, {0x0, 0x0}, 0x0, {0x0, 0x0, 0x0}, ...})
	/home/mkoco/dev/regen/cosmos-sdk/baseapp/abci.go:69 +0x3f5
github.com/cosmos/cosmos-sdk/simapp.TestAppSimulationAfterImport(0xc000abf520)
	/home/mkoco/dev/regen/cosmos-sdk/simapp/sim_test.go:269 +0xd67
testing.tRunner(0xc000abf520, 0x2590ac0)
	/home/mkoco/sdk/go1.18.2/src/testing/testing.go:1439 +0x102
created by testing.(*T).Run
	/home/mkoco/sdk/go1.18.2/src/testing/testing.go:1486 +0x35f
FAIL	github.com/cosmos/cosmos-sdk/simapp	21.018s
FAIL
```

### Root cause

Prior to merge of #11924, SimApp calls [module/NewManager](2b549b807c/simapp/app.go (L344)), which implicitly sets sane default values of [OrderExportGenesis](2b549b807c/types/module/module.go (L239)) from the modules passed as parameters.  Since this usage was deprecated in favor of [RegisterModules](823d2a7f28/simapp/app.go (L354)) in the app wiring work, `OrderExportGenesis` was now `nil`, resulting in empty `genesisData` in [ExportGenesis](823d2a7f28/types/module/module.go (L339))



### Fix

Explicitly set `OrderExportGenesis` with same module order as `OrderInitGenesis` from `SimApp`.

---

### 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
- [ ] 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-05-25 21:34:51 +00:00
Aaron Craelius 1f9871c76c
feat: start app wiring with runtime and x/params modules (#11924)
* feat: start app wiring with runtime and x/params modules

* WIP

* WIP

* docs

* docs, cleanup

* fixing tests

* rollback unrelated changes

* fix

* test fixes

* simplification, tests

* fix tests

* docs

* go mod tidy

* update module path

* codegen

* address middleware removal

* update container alpha 4

* Fix cosmossdk.io/api dependency conflict

- go mod tidy

Co-authored-by: Matt Kocubinski <mkocubinski@gmail.com>
2022-05-24 21:09:24 -04:00