Commit Graph

47 Commits

Author SHA1 Message Date
Amaury 5cd741a878
revert: Turn staking power reduction into an on-chain param (#9495)
<!--
The default pull request template is for types feat, fix, or refactor.
For other templates, add one of the following parameters to the url:
- template=docs.md
- template=other.md
-->

## Description

Closes: #9447

This PR partially reverts #8505. Namely:
- it removes PowerReduction as a staking on-chain param
- however, it keeps #8505's API changes regarding adding a `powerReduction` function argument to staking functions. This allows us to rely less on global variables in said functions.

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

---

### 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/master/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/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/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)
2021-06-14 14:45:15 +00:00
Robert Zaremba b36664df4a
update spec and fix code snippets (#9334)
* update spec and fix code snippets

* updating authz.Grant documentation

* Update proto/cosmos/authz/v1beta1/tx.proto

Co-authored-by: Ryan Christoffersen <12519942+ryanchrypto@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ryan Christoffersen <12519942+ryanchrypto@users.noreply.github.com>

* rename messages to services

* Update proto/cosmos/authz/v1beta1/tx.proto

Co-authored-by: Ryan Christoffersen <12519942+ryanchrypto@users.noreply.github.com>

* update snippets

* Apply suggestions from code review

Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>

* authz: update service docs to emphasis the service methods

* authz spec: rollback to use message oriented spec

* Apply suggestions from code review

Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>

* Update MsgGrant type doc

Co-authored-by: Ryan Christoffersen <12519942+ryanchrypto@users.noreply.github.com>
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
2021-05-19 20:22:06 +00:00
Tyler 53fe03eca6
x/upgrade gRPC methods for VersionMap (#9073)
* setup version map query

* query methods

* grpc methods

* cleanup

* grpc for VersionMap

* swagger update

* swagger sync

* cleanup

* reset docs

* clean

* grpc with field

* daily

* -add grpc methods
-add optional field to get specific module from version map
-added cli test for version map query from cli

* -consolidate grpc test to one test function
-return better errors in grpc methods

* consolidate tests

* swagger update

* this breaks

* Try stringer on individual msgs

* change map to slice in proto

* cleanup

* add comments to proto fields

* cleanup

* regen proto files

* jsoncodec

* rename gRPC methods

* * add fetch method for module version slice
* add method to return version given a module name
* remove sorting functions

* lint

* Update proto/cosmos/upgrade/v1beta1/query.proto

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Update proto/cosmos/upgrade/v1beta1/upgrade.proto

Co-authored-by: Aaron Craelius <aaron@regen.network>

* fix up comments and regen proto/swagger

* Update x/upgrade/client/cli/query.go

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* conform to pr 6711

* lint

Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com>
Co-authored-by: Amaury M <1293565+amaurym@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
2021-05-19 17:04:38 +00:00
Amaury 321aed823c
v043 audit changes for `types/` (#9290) 2021-05-17 12:57:24 +00:00
likhita-809 e96839de2f
x/staking v0.43 Audit updates (#9267)
* update staking specs

* use gosimple code in x/staking/client/testutil/suite.go

* small fixes

* add godoc to methods in msg_server and grpc_query

* changes to godoc and small fixes

* remove unnecessary lines

* remove mentions of serviceMsg and avoid having slash after Msg
2021-05-10 12:41:24 +00:00
Robert Zaremba 9038dfe3b6
authz: Update MsgGrant proto (#9280)
* adding GetAuthorization test

* update MsgGrant proto

* update comment
2021-05-10 09:28:08 +00:00
Robert Zaremba 3e4d81c3d3
Fix proto format (#9279)
* makefile: fix proto-format

* reformat all proto files

* regenerating proto

* remove dangling semicolon
2021-05-07 21:33:17 +00:00
Amaury 5725659684
x/gov v0.43 Audit updates (#9258)
* Update gov tx usage

* Update proto

* make proto-gen

* Add deposit test

* Rename test function

* More audits

* Update x/gov/keeper/internal_test.go

* Update x/gov/spec/01_concepts.md

Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
2021-05-07 12:00:19 +00:00
Amaury 56ab4e4c93
Cleanup remains of ServiceMsg (#9236)
* Remove ServiceMsgClientConn from CLI

* Cleanup Operations

* Remove some legacytx.LegacyMsg

* Update CL

* Remove mentions of ServiceMsg

* Simply reflection MsgDescriptor

* Simplify more

* Add code comment

Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>
2021-05-07 09:31:20 +00:00
Robert Zaremba 59810f3286
x/authz: audit updates (#9042)
* x/authz: audit updates

* audit with Aaron

* authz: Update Authorization.Accept method

* authz: add event proto definitions

* update query service

* authz: use typed events

* refactore and rename query authorizations

* remve Authorization infix from proto services

* renames wip

* refactoring

* update tests

* fix compilation

* fixing gRPC query tests

* fix simulation tests

* few renames

* more refactore

* add missing file

* moving export genesis to keeper

* Update docs

* update tests

* rename event Msg attribute to MsgTypeURL

* Upate Authorization interface

* rollback Makefile changes

* fix tests

* Apply suggestions from code review

Co-authored-by: Aaron Craelius <aaron@regen.network>

* renames

* refactore authz/exported

* lint fix

* authz/types refactore

* comment update

* conflict updates

* Apply suggestions from code review

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* authz: move storage keys to keeper

* review updates

* docs update

* Update x/authz/client/cli/query.go

Co-authored-by: Aaron Craelius <aaron@regen.network>

* move codec to the root package

* authz CMD info update

* comment update

* update imports and build flags

* fix functional tests

* update proto comment

* fix tests

* fix test

Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
2021-05-06 18:23:48 +00:00
Anil Kumar Kammari 2eeb464939
Update `memo` usage docs (#9265)
* Update `memo` usage docs

* update doc

Co-authored-by: Aaron Craelius <aaron@regen.network>

* update doc

Co-authored-by: Aaron Craelius <aaron@regen.network>

Co-authored-by: Aaron Craelius <aaron@regen.network>
2021-05-06 08:47:02 +00:00
MD Aleem 1e1c812de2
x/feegrant remove height base expiration (#9206)
* remove height from proto files

* remove PrepareForExport

* fix basic fee

* fix periodic fee

* fix errors

* fix error

* fix errors

* add tests

* review changes

* fix errors

* fix tests

* fix lint error

* Update x/feegrant/types/basic_fee.go

Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>

* fix errors

* fix keeper tests

* Update x/feegrant/keeper/keeper_test.go

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>

* review changes

* review changes

* fix tests

* run make proto-gen

* fix errors

* Update x/feegrant/keeper/keeper_test.go

Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>

* Update x/feegrant/keeper/keeper_test.go

* update ADR

* add test

* review changes

* review changes

Co-authored-by: technicallyty <48813565+technicallyty@users.noreply.github.com>
Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-05-05 16:29:22 +00:00
technicallyty d3bcc15b11
x/feegrant API Audit changes (#9194)
* -add comments to proto fields
-add comments to msg and query server
-remove decorator from docs
-add coments to msgs.go
-remove decorator from godoc

* Update x/feegrant/spec/04_events.md

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>

* refactor and add to docs
*refactor proto msg names and functions
*add docs pertaining to auth's ante handler for deducted fees

* lint

* update comment

* gofmt

Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com>
Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-05-03 12:34:48 +00:00
Cory 603e89541f
Add support for permanent locked vesting accounts (#8520)
* add basics for permanent locked vesting account support

* remove sdk.Msg support for PermanentLockedVestingAccount

* add tests for PermanentLockedVestingAccount

* remove unecessary tests

* drop unecessary create vesting acct msgs

* Update x/auth/vesting/types/vesting_account.go

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Update x/auth/vesting/types/vesting_account.go

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Update x/auth/vesting/types/vesting_account.go

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Update x/auth/vesting/types/vesting_account_test.go

Co-authored-by: Aaron Craelius <aaron@regen.network>

* Review changes

* Factorize init function

* Factorize more

* Comments

* Fix build after rename

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
2021-04-21 16:18:28 +00:00
Sunny Aggarwal 10b2b08ece Merge branch 'master' into powerreduction_param 2021-04-10 16:26:50 -04:00
atheeshp 7a3a156b4f
feegrant filtered msgs (#8604)
* WIP: add filtered message

* updated `Accept` interface method

* fix tests

* add cli tests for filtered fee allowance

* fix tests

* review changes

* rename `filteredFeeAllowance` message

* review changes

* review changes

* review changes

* review changes

* review changes

* update errors

* remove validation

* fix conflicts

* add `ctx` to `Accept` method

* fix test

* add gas consumption

* review changes

* review changes

* revert

* review changes

* improve error handling

* fix test

* Merge branch 'master' of github.com:cosmos/cosmos-sdk into atheesh/feegrant-filtered-msgs

* review changes

* update gas

* update type

* review changes

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-09 16:49:24 +00:00
Hanjun Kim 9b41ba7fb5
Use Docker to generate swagger files (#9064)
* use docker for proto-swagger-gen

fixes #7933

* fix deprecated commands and flags

see https://docs.buf.build/faq/ for detail

* run proto-gen and proto-swagger-gen

* add changelog entry
2021-04-07 10:31:39 +00:00
Sunny Aggarwal ca34808fdc merged master 2021-04-06 20:18:20 -04:00
Frojdi Dymylja 29ff333007
cosmos-reflection: extend to support writing by reflection clients (#8965)
Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2021-04-07 00:33:54 +01:00
Sunny Aggarwal 05e2e45010 merged in master 2021-04-06 19:19:59 -04:00
Ian Norden feed37dc56
ADR-038 Part 1: WriteListener, listen.KVStore, MultiStore and KVStore updates (#8551)
* StoreKVPair protobuf message definition and generated go types

* store WriteListener

* update MultiStore, CacheWrap, CacheWrapper interfaces

* adjust KVStores to fit new CacheWrapper interface

* new ListenKVStore

* adjust multistores to fit new MultiStore interface and enable wrapping returned KVStores with the new ListenKVStore

* typo fixes in adr

* ListenKV Store test

* update server mock KVStore and MultiStore

* multistore unit test; fix multistore constructor

* update changelog

* fix bug identified in CI

* improve codecov, minor fixes/adjustments

* review fixes

* review updates; flip set to delete in KVStorePair, updated proto-docs from running 'make proto-gen'
2021-03-30 16:13:51 -04:00
Amaury 1fa2c22d8a
Prefer sending tx_bytes to Simulate gRPC endpoint (#8926)
* First run

* Remove dead code

* Make test pass

* Proto gen

* Fix lint

* Add changelog

* Fix tests

* Fix test

* Update x/auth/tx/service.go

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>

* Remove protoTxProvider

* Add grpc-gateway test

* Add comment

* move to api breaking

* lesser diff

* remove conflict

* empty commit to rerun CI

* empty commit to rerun CI

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-03-25 10:52:54 +00:00
MD Aleem a78f777ea8
add reverse iteration to pagination (#8875)
* WIP

* add tests

* add tests

* fix lint

* fix pagination

* add proto message doc

* fix filtered_pagination

* fix test

* cleanup

* add reverse flag to pagination

* changelog

* Update client/flags/flags.go

* Update CHANGELOG.md

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2021-03-23 09:28:20 +00:00
Sunny Aggarwal be27ec1d29 started fixing merge conflicts 2021-03-21 18:33:14 -04:00
technicallyty c6af0ed87e
x/upgrade: remove support for time based upgrades (#8849)
* remove time based upgrades

* cleanup

* cleanup evidence of time based upgrades

* cleanup docs referring to time based upgrades

* forgot one

* added line to changelog deprecated section

* Update proto/cosmos/upgrade/v1beta1/upgrade.proto

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* update changelog line to correct section

* update buf config to allow reserved fields

Co-authored-by: technicallyty <48813565+tytech3@users.noreply.github.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
2021-03-14 01:03:01 +00:00
MD Aleem adf5f625c1
add orderBy parameter to TxsByEvents (#8815)
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
2021-03-12 18:47:10 +00:00
Amaury 6520997668
Supply by denom Migrations (#8780)
* Add back supply proto

* Add migration for supply

* Fix lint

* Update x/bank/spec/01_state.md

* Fix test

* Proto gen

* Update x/bank/spec/01_state.md

* Make proto gen

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
2021-03-05 14:11:19 +00:00
Robert Zaremba a18f0b111a
Enable secp256r1 (#8786)
* enable secp256r1 in antehandlers

* Add sig verification benchamrk to find a sigverify fee

* adjust the gas fee

* enable secp256r1 in antehandlers

* Add sig verification benchamrk to find a sigverify fee

* adjust the gas fee

* Update the secp256r1 fee factor

* Update changelog

* regenerate docs
2021-03-04 21:31:42 +00:00
colin axnér da064e13d5
Remove IBC from the SDK (#8735) 2021-03-04 13:11:34 +00:00
Robert Zaremba c66f1f7efe
crypto: add secp256r1 (#8559)
* Optimize secp256k1 hashing

* Add ADR-028 related functions

* Update ed25519

* fix errors/handle

* fix build

* fix build

* Add tests and update function names

* wip

* Use LengthPrefix for composed addresses

* add tests for NewComposed

* add module hash function

* fix append

* rollback ed25519 ADR-28 update

* rollback ed25519 ADR-28 test

* Adding Module tests and convert tests to test suite

* convert store_key_test.go to test suite

* rollback test check comment

* any.pb.go update

* generated proto files

* wip

* renames

* wip2

* add String method to PBBytes

* wip3

* add pubkey tests

* adding cryptotypes.PrivKey methods

* re-enable test

* fix equals test

* fix ecdsa object receiver

* add ProtoMarshaler implementation and tests

* move code to init and add interface registry

* add bytes tests

* merge Unmarshal with UnmarshalAmino

* implement ProtoMarshaler to ecdsaSK

* remove bytes.go

* add private key marshaling tests

* break tests into 2 suites

* add signature tests

* remove TODO

* remove bytes.proto

* adding changelog

* Update CHANGELOG.md

* Update crypto/keys/ecdsa/ecdsa_privkey.go

* Update crypto/keys/ecdsa/ecdsa_pubkey.go

* comments: add dot (.) at the end

* update comments

* update commented code

* rename files

* remove Amino methods

* use 2 spaces in protocgen.sh

* rollback changes in protocgen.sh

* add MessageName

* rework ecdsa proto structure

* move ecdsa to internal package

* add secp256r1 proto

* refactore proto definition for secp256r1

* fix err check

* update comments

* create const for fieldSize+1

* simplify the PubKey.String test

* Apply suggestions from code review

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>

* Update doc comments: SDK Interface -> sdk.Interface

* rename init.go to doc.go

* Add PubKey.Type() test

* Revert "Update doc comments: SDK Interface -> sdk.Interface"

This reverts commit 01f2b4f5efcd79a452483bcda152db54a8fbfee2.

* Use cryptotypes.Address instead of tmcrypto

* Revert "Use cryptotypes.Address instead of tmcrypto"

This reverts commit 15b866ae67bdb7ca4872f4089fcab19f9e2e3608.
This issue will be solved in https://github.com/cosmos/cosmos-sdk/issues/8775

* add link to ANSI X9.62

* move init.go -> doc.go

* use proto.MessageName()

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
2021-03-04 12:29:48 +00:00
colin axnér 1c6e267964
Remove IBC logic from x/upgrade (#8673)
* add zeroed custom fields check to tm client

* remove custom fields function from x/upgrade and fix tests

* use []byte in x/upgrade, move abci to 02-client

* remove x/ibc from types

* whoops, delete testing files

* fix upgrade tests

* fix tm tests

* fix tests

* update CHANGELOG

* revert proto breakage, use reserved field cc @amaurym

* add IBC Upgrade Proposal type

* remove IBC from upgrade types

* add IBC upgrade logic to 02-client

* fix all tests for x/upgrade

* Add CLI for IBC Upgrade Proposal

* Update x/ibc/core/02-client/types/proposal_test.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* add gRPC for upgraded client state

* test fixes

* add HandleUpgradeProposal tests

* update docs and remove unnecessary code

* self review bug and test fixes

* neatness

* construct empty rest handler

* fix tests

* fix stringer tests

* Update docs/core/proto-docs.md

Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>

* add key in ibc store tracking ibc upgrade heights

Add a new Key to the IBC client store to track the IBC Upgrade Height. This allows IBC upgrades to correctly remove old IBC upgrade states

* update abci and tests

* revert key storage after discussion with @AdityaSripal

Revert using a key to track IBC upgrades. By clearing any IBC state using an old plan in ScheduleUpgrade, IBC upgrades do not need to be tracked by IBC. This reduces code complexity and reduces potential for bugs.

* clear IBC states on cancelled upgrades

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2021-03-01 16:28:54 +00:00
Federico Kunze 149bed48fd
bank: name and symbol metadata fields (#8677)
* bank: name and symbol metadata fields

* cli test

* changelog
2021-02-24 20:06:04 -03:00
Riccardo Montagnin c2be53a447
auth: query all accounts stored via gRPC (#8522)
* Added the ability to query all accounts stored using gRPC

* Added CHANGELOG entry

* Fixed linting errors

* Update CHANGELOG.md

Co-authored-by: Amaury <amaury.martiny@protonmail.com>

* Update proto/cosmos/auth/v1beta1/query.proto

Co-authored-by: Amaury <amaury.martiny@protonmail.com>

* Run make proto-all

* Merged origin/master

* Applied suggestions

* Added CLI command

* Updated CHANGELOG

* Fixed merge conflicts

Co-authored-by: Amaury <amaury.martiny@protonmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-02-22 14:21:46 +00:00
MD Aleem 7df79b55f0
x/authz: Add DelegateAuthorization, UndelegateAuthorization (#8472)
* add proto msgs

* add delegate authorization

* add delegate authorization tests

* add delegate authorization to cli

* fix lint

* add cli tests

* made max_tokens optional

* add tests

* add table tests

* resolve conflicts

* add undelegate authorization

* proto-gen

* fix errors

* fix lint

* resolve conflicts

* fix imports

* add allow & deny lists to delegate authorization

* refactor authorizations

* proto-docs

* fix lint

* review changes

* golint

* proto lint

* review changes

* add staking authorization

* review changes

* fix protos

* review changes

* review changes

* clean docs

* proto-docs

* proto-gen

* proto-docs
2021-02-20 06:57:57 +00:00
colin axnér 47dd07d4ff
Modify IBC client governance unfreezing to reflect ADR changes (#8405)
* update proto files

* make proto-gen

* update clienttypes

* update localhost and solo machine

* refactor tm client proposal handling

* copy metadata

* self review fixes

* update 02-client keeper tests

* fix 02-client type tests

* fix localhost and solomachine tests

* begin updating tm tests

* partially fix tm tests

* increase codecov

* add more tests

* add changelog

* update specs

* add docs

* fix test

* modify adr

* allow modified chain-ids

* add CLI command

* fix typos

* fix lint

* Apply suggestions from code review

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* update docs, rm example

* Update docs/ibc/proposals.md

Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>

* update height checks to reflect chain-id changes cc @AdityaSripal

* Apply suggestions from code review

Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>

* Apply suggestions from code review

Co-authored-by: Aditya <adityasripal@gmail.com>

* address most of @AdityaSripal suggestions

* update docs per review suggestions

* Update x/ibc/core/02-client/types/proposal.go

* add proposal handler

* register proposal type

* register proposal on codec

* fix routing

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
Co-authored-by: Aditya <adityasripal@gmail.com>
2021-02-16 15:31:40 +00:00
Robert Zaremba adbf5a71e6
adr-028 address generation (#8415)
* Optimize secp256k1 hashing

* Add ADR-028 related functions

* Update ed25519

* fix errors/handle

* fix build

* fix build

* Add tests and update function names

* wip

* Use LengthPrefix for composed addresses

* add tests for NewComposed

* add module hash function

* fix append

* rollback ed25519 ADR-28 update

* rollback ed25519 ADR-28 test

* Adding Module tests and convert tests to test suite

* convert store_key_test.go to test suite

* rollback test check comment

* Rename assert.Panic and add comment

* add note to ed25519 about SDK support with regards to ADR-28

* Update ed25519 TestAddress

* Adding Deprecated notes for ed25519.PrivKey

* Update crypto/keys/ed25519/ed25519.go

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>

* Update types/address/hash_test.go

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>

* solve linter issues

* linter: remove gocritic

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
2021-02-15 15:32:51 +00:00
antstalepresh 404dc4f356 Merge branch 'master' of github.com:sikkatech/cosmos-sdk into gov_split_vote_weighted_vote 2021-02-06 01:03:32 +10:00
Amaury 896eee213a
docs: Update x/staking spec (#8395)
* Finish updating state

* Add messages

* Update events

* proto-gen

* Update proto/cosmos/staking/v1beta1/staking.proto

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>

* progo-gen

* Update Msg with slash

* Rerun proto docs

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-02-01 12:35:18 +00:00
atheeshp d97e7907f1
Add fee grant module (#8061)
* Add docs

* Add BasicFeeAllowance implementation

* Add expiration structs and complete basic fee

* Add delegation messages, add validation logic

* Add keeper and helper structs

* Add alias and handler to top level

* Add delegation module

* Add basic querier

* Add types tests

* Add types tests

* More internal test coverage

* Solid internal test coverage

* Expose Querier to top level module

* Add FeeAccount to auth/types, like StdTx, SignDoc

* Fix all tests in x/auth

* All tests pass

* Appease the Golang Linter

* Add fee-account command line flag

* Start on DelegatedDeductFeeDecorator

* Cleanup the Decorator

* Wire up delegation module in simapp

* add basic test for decorator (no delegation)

* Table tests for deduct fees

* Table tests over all conditions of delegated fee decorator

* Build full ante handler stack and test it

* Start genesis

* Implement Genesis

* Rename package delegation to subkeys

* Clarify antes test cases, handle empty account w/o fees

* Allow paying delegated fees with no account

* Pull mempool into delegated ante, for control on StdFee

* Use custom DelegatedTx, DelegatedFee for subkeys

* Revert all changes to x/auth.StdTx

* Appease scopelint

* Register DelegatedTx with codec

* Address PR comments

* Remove unnecessary DelegatedMempoolFeeDecorator

* Cleaned up errors in querier

* Clean up message sign bytes

* Minor PR comments

* Replace GetAllFees... with Iterator variants

* PrepareForExport adjusts grant expiration height

* Panic on de/serialization error in keeper

* Move custom ante handler chain to tests, update docs

* More cleanup

* More doc cleanup

* Renamed subkeys module to fee_grant

* Rename subkeys/delegation to fee grant in all strings

* Modify Msg and Keeper methods to use Grant not Delegate

* Add PeriodicFeeAllowance

* Update aliases

* Cover all accept cases for PeriodicFeeAllowance

* Et tu scopelint?

* Update docs as requested

* Remove error return from GetFeeGrant

* Code cleanup as requested by PR

* Updated all errors to use new sdk/errors package

* Use test suite for keeper tests

* Clean up alias.go file

* Define expected interfaces in exported, rather than importing from account

* Remove dependency on auth/ante

* Improve godoc, Logger

* Cleaned up ExpiresAt

* Improve error reporting with UseGrantedFee

* Enforce period limit subset of basic limit

* Add events

* Rename fee_grant to feegrant

* Ensure KeeperTestSuite actually runs

* Move types/tx to types

* Update alias file, include ante

* I do need nolint in alias.go

* Properly emit events in the handler. Use cosmos-sdk in amino types

* Update godoc

* Linting...

* Update errors

* Update pkg doc and fix ante-handler order

* Merge PR #5782: Migrate x/feegrant to proto

* fix errors

* proto changes

* proto changes

* fix errors

* fix errors

* genesis state changed to proto

* fix keeper tests

* fix test

* fixed tests

* fix tests

* updated expected keepers

* updated ante tests

* lint

* deleted alias.go

* tx updated to proto tx

* remove explicit signmode

* tests

* Added `cli/query.go`

* Added tx.go in cli

* updated `module.go`

* resolve errors in tx.go

* Add fee payer gentx func

* updated tx

* fixed error

* WIP: cli tests

* fix query error

* fix tests

* Unused types and funcs

* fix tests

* rename helper func to create tx

* remove unused

* update tx cfg

* fix cli tests

* added simulations

* Add `decoder.go`

* fix build fail

* added init genesis code

* update tx.go

* fixed LGTM alert

* modified cli

* remove gogoproto extensions

* change acc address type to string

* lint

* fix simulations

* Add gen simulations

* remove legacy querier

* remove legacy code

* add grpc queries tests

* fix simulations

* update module.go

* lint

* register feegrant NewSimulationManager

* fix sims

* fix sims

* add genesis test

* add periodic grant

* updated cmd

* changed times

* updated flags

* removed days as period clock

* added condition for period and exp

* add periodic fee cli tests

* udpated tests

* fix lint

* fix tests

* fix sims

* renaming to `fee_grant`

* review changes

* fix test

* add condition for duplicate grants

* fix tests

* add `genTxWithFeeGranter` in tests

* fix simulation

* one of changes & test fixes

* fix test

* fix lint

* changed package name `feegrant` to `fee_grant`

* review comments

* review changes

* review change

* review changes

* added fee-account in flags

* address review changes

* read fee granter from cli

* updated create account with mnemonic

* Address review comments

* move `simapp/ante` file to `feegrant/ante`

* update keeper logic to create account

* update docs

* fix tests

* update `serviceMsgClientConn` from `msgservice`

* review changes

* add test case for using more fees than allowed

* eliminate panic checks from keeper

* fix lint

* change store keys string to bytes

* fix tests

* review changes

* review changes

* udpate docs

* make spend limit optional

* fix tests

* fix tests

* review changes

* add norace tag

* proto-docs

* add docs

Co-authored-by: Ethan Frey <ethanfrey@users.noreply.github.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: aleem1413 <aleem@vitwit.com>
Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-01-29 19:54:51 +00:00
MD Aleem c95de9c417
implement x/authz module (#7629)
* WIP: Msg authorization module added

* fixing errors

* fixed errors

* fixed module.go

* Add msg_tests

* fixes compile issues

* fix test

* fix test

* Add msg types tests

* Fix Getmsgs

* fixed codec issue

* Fix syntax issues

* Fix keeper

* fixed proto issues

* Fix keeper tests

* fixed router in keeper

* Fix query proto

* Fix cli txs

* Add grpc query client implementation

* Add grpc-keeper test

* Add grpc query tests
Add revoke and exec authorization cli commands

* Fix linting issues

* Fix cli query

* fix lint errors

* Add Genesis state

* Fix query authorization

* Review changes

* Fix grant authorization handler

* Add cli tests

* Add cli tests

* Fix genesis test

* Fix issues

* update module to use proto msg services

* Add simultion tests

* Fix lint

* fix lint

* WIP simulations

* WIP simulations

* add msg tests

* Fix simulation

* Fix errors

* fix genesis import export

* fix sim tests

* fix sim

* fix test

* Register RegisterMsgServer

* WIP

* WIP

* Update keeper test

* change msg_authorization module name to authz

* changed type conversion for serviceMsg

* serviceMsg change to any

* Fix issues

* fix msg tests

* fix errors

* proto format

* remove LegacyQuerierHandler

* Use MsgServiceRouter

* fix keeper-test

* fix query authorizations

* fix NewCmdSendAs

* fix simtests

* fix error

* fix lint

* fix lint

* add tests for generic authorization

* fix imports

* format

* Update error message

* remove println

* add query all grants

* Add pagination for queries

* format

* fix lint

* review changes

* fix grpc tests

* add pagination to cli query

* review changes

* replace panic with error

* lint

* fix errors

* fix tests

* remove gogoproto extensions

* update function doc

* review changes

* fix errors

* fix query flags

* fix grpc query test

* init service-msg

* remove unsed field

* add proto-codec for simulations

* fix codec issue

* update authz simulations

* change msgauth to authz

* add check for invalid msg-type

* change expiration flag to Unix

* doc

* update module.go

* fix sims

* fix grant-authorization sims

* fix error

* fix error

* add build flag

* fix codec issue

* rename

* review changes

* format

* review changes

* go.mod

* refactor

* proto-gen

* Update x/authz/keeper/grpc_query_test.go

Co-authored-by: Amaury <amaury.martiny@protonmail.com>

* Update x/authz/keeper/grpc_query_test.go

Co-authored-by: Amaury <amaury.martiny@protonmail.com>

* Update x/authz/keeper/grpc_query_test.go

Co-authored-by: Amaury <amaury.martiny@protonmail.com>

* Fix review comments

* fix protogen

* Follow Msg...Request style for msg requests

* update comment

* Fix error codes

* fix review comment

* improve msg validations

* Handle error in casting msgs

* rename actor => grantStoreKey

* add godoc

* add godoc

* Fix simulations

* Fix cli, cli_tests

* Fix simulations

* rename to GetOrRevokeAuthorization

* Move events to keeper

* Fix fmt

* Update x/authz/client/cli/tx.go

Co-authored-by: Amaury <amaury.martiny@protonmail.com>

* rename actor

* fix lint

Co-authored-by: atheesh <atheesh@vitwit.com>
Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: MD Aleem <72057206+aleem1413@users.noreply.github.com>
Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
2021-01-25 16:41:30 +00:00
Sunny Aggarwal b125fccfd2 MsgWeightedVote -> MsgVoteWeighted 2021-01-24 20:54:25 -05:00
Sunny Aggarwal 56ed27ad9c use @aaronc's suggested proto upgrade method 2021-01-24 20:25:43 -05:00
Federico Kunze 48006b435d x/bank: client denom metadata gRPC (#8317)
* deps: bump tendermint to v0.34.2

* x/bank: denom metadata gRPC

* cli: add cmd and tests

* gRPC test'

* changelog

* fix test

* Apply suggestions from code review

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: Aditya <adityasripal@gmail.com>

* fix panic

* use cmd.Context()

* update tests

* Update x/bank/types/errors.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* test fix

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-01-19 17:08:09 -05:00
Federico Kunze 01eec66d28
x/bank: client denom metadata gRPC (#8317)
* deps: bump tendermint to v0.34.2

* x/bank: denom metadata gRPC

* cli: add cmd and tests

* gRPC test'

* changelog

* fix test

* Apply suggestions from code review

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: Aditya <adityasripal@gmail.com>

* fix panic

* use cmd.Context()

* update tests

* Update x/bank/types/errors.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* test fix

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-01-18 18:15:16 +00:00
Marko ce5db9e4bd
fix proto generation (#8361)
* fix proto generation

* merge grpc_gateway into gocosmos_out

* change env variable names
2021-01-18 12:41:34 -03:00
Aaron Craelius 2521964d50
Update gogo proto deps with v1.3.2 security fixes (#8350)
* Update gogo proto deps with v1.3.2 security fixes

* Regenerate proto files
2021-01-15 19:45:34 +00:00
MD Aleem ed7bd245b8
Add script to generate proto-docs (#8238)
* init protobuf-docs

* update template

* update docs/core/README.md

* update proto files

* update template

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-12-31 16:10:13 +00:00