Commit Graph

178 Commits

Author SHA1 Message Date
Dev Ojha 61dd71ed87
perf: Speedup to params simulation (#9481)
## Description

In Osmosis' simulation, we were observing that a large percent of the time was spent within SimulateParamChangeProposalContent, in particular within the composed key function. This is from a trace of our simulator running for 10 minutes:

<img width="931" alt="Screenshot 2021-06-08 at 2 32 28 PM" src="https://user-images.githubusercontent.com/6440154/121238788-16cdd000-c85e-11eb-8251-94537e69f8ce.png">

~This change lowers the number of calls to ComposedKey() by a factor of 3, and speeds up the underlying ComposedKey function. (sprintf is not particularly efficient for string concatenation, https://dev.to/pmalhaire/concatenate-strings-in-golang-a-quick-benchmark-4ahh ). After these change, the effect of ComposedKey() can no longer be seen in the profiler outputs.~

~This change does not change the result of the simulator on a given seed.~

See https://github.com/cosmos/cosmos-sdk/pull/9481#issuecomment-857119210 for description of changes.

---

### 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/master/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/master/docs/building-modules)
- [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/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
- [ ] 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-17 07:42:07 +00:00
Robert Zaremba 7bca49e2d2
refactor(client): add client/Context.Codec and deprecate JSONCodec (#9498)
* chore(types): add sdk.Context.Codec and deprecate JSONCodec

* Use clientContext.Codec rather than JSONCodec everywhere

* update tests to use clientContext.Codec

* added a note that EncodingConfig.Marshaler will be renamed to Codec

* update changelog

* fix tests to use clientCtx.WithCodec instead of WithJSONCodec

* fix genutil build

* Update simapp/params/encoding.go

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

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
2021-06-11 11:49:39 +00:00
Ryan Christoffersen cb66c99eab
chore: add markdownlint to lint commands (#9353)
* add markdownlint config

* update make lint commands

* update markdownlint config

* run make lint-fix

* fix empty link

* resuse docker container

* run lint-fix

* do not echo commands

Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com>
2021-05-27 15:31:04 +00:00
Amaury 56c0595f32
Remove migration scripts <=0.38 (#9291)
* Remove migration scripts <=0.38

* Add changelog

* remove more

* remove more stuff

* Fix test

* Relase wording

* Add comment

* Include migratio wording
2021-05-11 14:01:13 +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
Amaury d19791be89
Rename clientCtx.JSONMarshaler to JSONCodec (#9251)
* Rename clientCtx.JSONMarshaler to JSONCodec

* change md files

* Fix lint
2021-05-03 14:45:47 +00:00
Federico Kunze e25f80d34c
gov, params: refactor tests (#9137)
* gov, params: refactor tests

* wrap up params tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-04-30 08:41:25 +00:00
Robert Zaremba be4a965599
codec: Rename codec and marshaler interfaces (#9226)
* codec: Rename codec and marshaler interfaces, ref: 8413

* codec: remove BinaryBare

* changelog update

* Update comments and documentation

* adding doc string comments

* Update CHANGELOG.md

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

* Update codec/codec.go

Co-authored-by: Marko <marbar3778@yahoo.com>

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
2021-04-29 10:46:22 +00:00
Aaron Craelius 3c65c3dacd
Make integration test suites reusable by apps (#6711)
* WIP on refactoring new integration tests.

* godocs

* godocs

* Fix ineff assign

* Updates

* Updates

* fix test

* refactor crisis, distr testsuites

* fix import issue

* refactor x/auth

* refactor x/authz

* refactor x/evidence

* refactor x/feegrant

* refactor x/genutil

* refactor x/gov

* refactor x/mint

* refactor x/params

* refactor x/{auth_vesting, slashing, staking}

* fix lint

* fix tests & lint

* fix lint

* fix tests

* lint

* lint

* fix lint memory

* add missing `norace` build flag

* update feegrant cfg

* fix lint

Co-authored-by: atheesh <atheesh@vitwit.com>
Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
2021-04-23 14:49:49 -04:00
Alessio Treglia f2ee972e31
various linter fixes (#8666) 2021-02-23 08:46:01 +00:00
MD Aleem 81cc5c1194
gRPC gateway issue with colons in the account url path (#8649)
* add allow_colon_final_segments flag

* add test

* Update x/auth/client/rest/rest_test.go

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-02-22 11:30:45 +00:00
Amaury 73e38e4009
Use service Msgs in CLI tx commands (#8512)
* Use service Msgs in CLI tx commands

* Update comment

* Gracefully support amino signing

* CLI to use svc msg

* Fix lint

* Use fq method name in events

* Update tests

* Fix quering events

* Add docs

* Fix test build

* Fix events

* Fix search for events

* Handle old andd new event quering

* Use merge events

* Better encCfg

* Add page in search

* Fix tests

* Update test and comments

* Update x/auth/legacy/legacytx/stdsign.go

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

* Fix conflict for weighted vote

* Make CopyTx actually run

* Fix CopyTx

* Fix test

* Add changelog entry

* Remove useless code

* Add msgs tests

* Remove testing proto Msg via CLI

* Fix lint

* Fix test

* Implement GetSignBytes on ServiceMsg

* Fix %T

Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-02-18 18:00:19 +00:00
Amaury dfc8dd813e
Add in-place store migrations (#8485)
* Add 1st version of migrate

* Put migration logic into Configurator

* add test to bank store migration

* add test for configurator

* Error if no migration found

* Remove RunMigrations from Configurator interface

* Update spec

* Rename folders

* copy-paste from keys.go

* Fix nil map

* rename function

* Update simapp/app.go

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Update simapp/app_test.go

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Adderss reviews

* Fix tests

* Update testutil/context.go

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Update docs for ConsensusVersion

* Rename to forVersion

* Fix tests

* Check error early

* Return 1 for intiial version

* Use MigrationKeeper

* Fix test

* Revert adding marshaler to Configurator

* Godoc updates

* Update docs

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: Aaron Craelius <aaron@regen.network>
2021-02-10 17:49:31 +00:00
Andrei Ivasko d37c590e90
Limit context background (#8093)
* limit context background

* update

* fixed minor issues

* fixed TestStatusCommand

* Fix keyring import from older versions. (#8436)

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>

* Add changelog (#8490)

* fix: tendermint subcommands should not create missing files (#8481)

If the user specifies an incorrect `--home`, then the old behaviour
would automatically populate it with fresh values, but we should
fail instead.

* limit context background

* update

* fixed minor issues

* fixed TestStatusCommand

* statik.go

* replaced static.go

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
Co-authored-by: Michael FIG <mfig@agoric.com>
2021-02-03 09:47:25 +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
Marie Gauthier 1b1dbf8ab7
x/params docs general audit & cleanup (#8295)
* Update doc.go

* Update spec/

* More updates

* Update README

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-01-15 13:30:17 +00:00
Robert Zaremba a3ae6e3704
Combine client.ReadTxCommandFlags with GetClientContextFromCmd (#8155)
* Update codebase to simplify clientCtx loading from cmd

* make ReadTxCommandFlags and ReadQueryCommandFlags private

* fix build error

* fix conflicts
2020-12-14 22:09:51 +00:00
Alessio Treglia f51f5e6784
testutil: new TempFile function, simplify WriteToNewTempFile (#8123)
Files returned by WriteToNewTempFile are cleaned up
automatically at the end of a test case execution.
WriteToNewTempFile now relies on the TB.TempDir()
function provided by the testing std package.

TempFile returns a temporary file that can be used
within a test case and is automatically removed
at the end of the test execution.
2020-12-09 18:27:20 +00:00
Robert Zaremba fe41718047
Robert/api clientctx (#8107)
* rename clientCtx.PrintOutput to PrintObject

* rename clientCtx.PrintOutputLegacy to PrintObjectLegacy

* Changelog update

* Rename PrintObject to PrintProto
2020-12-08 20:17:40 +00:00
Aleksandr Bezobchuk 5291a8ff31
Refactor Logging using Zerolog (#8072)
* init commit

* server: use flags

* server: godoc++

* updates

* baseapp: update logging

* logging updates

* x/bank: update logging

* logging updates

* lint++

* logging updates

* logging updates

* logging updates

* logging updates

* cl++
2020-12-03 23:17:21 +00:00
Amaury 1b3ce2c1d1
CLI `migrate` command for x/{upgrade,params} proposals (#7875)
* Add v038 upgrade types

* Add migrate x/upgrade

* remove nolint

* Add ParameterChangeProposal

* Revert change

* Don't register crypto twice

Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-11-24 23:32:32 +00:00
Marie Gauthier 1cc8af8d9b
[docs]: update building modules section to reflect ADR31 (#7702)
* Revert "Revert "Update old ref of RegisterQueryService""

This reverts commit 03e4c56de53938ccbf025a441e54b9842f7c4544.

* Update intro, module-manager and messages-and-queries

* Update messages-and-queries

* Update handler

* Update structure

* Add doc related to RegisterMsgServiceDesc

* Update docs/building-modules/handler.md

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Update docs/building-modules/handler.md

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Update docs/building-modules/handler.md

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Update docs/building-modules/messages-and-queries.md

* Update handler.md

* Rename handler.md to msg-services.md

* Update legacy msgs wording

* Update messages-and-queries.md

* Update docs/building-modules/msg-services.md

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

* Update docs/building-modules/intro.md

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

* Remove handler mention from intro.md

* Update docs/building-modules/messages-and-queries.md

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

* Update docs/building-modules/messages-and-queries.md

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

* Update docs/building-modules/msg-services.md

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

* Update docs/building-modules/keeper.md

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

* Update docs/building-modules/msg-services.md

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

* Address review comments

* Use tag

* Update docs/building-modules/intro.md

Co-authored-by: Cory <cjlevinson@gmail.com>

* Update docs/building-modules/intro.md

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

* Update docs/building-modules/messages-and-queries.md

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

* Update docs/building-modules/messages-and-queries.md

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

* Update docs/building-modules/messages-and-queries.md

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

* Update docs/core/transactions.md

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

* Update docs/building-modules/messages-and-queries.md

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

* Update docs/building-modules/messages-and-queries.md

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

* Update docs/building-modules/messages-and-queries.md

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

* Update docs/building-modules/messages-and-queries.md

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

* Remove framework related explanation from docs

* Update docs/building-modules/messages-and-queries.md

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

* Update docs/building-modules/module-manager.md

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

* Update docs/building-modules/module-manager.md

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

* Update docs/building-modules/msg-services.md

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

* Update docs/building-modules/msg-services.md

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

* Update docs/building-modules/msg-services.md

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

* Update docs/building-modules/msg-services.md

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

* Update docs/building-modules/msg-services.md

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

* Update docs/building-modules/msg-services.md

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

* Update docs/building-modules/msg-services.md

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

* Update docs/core/baseapp.md

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

* Update docs/core/baseapp.md

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

* Update beginblock-endblock.md

* Update docs/core/baseapp.md

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

* Update docs/core/transactions.md

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

* Add deprecated notice

* Update tx-lifecycle.md

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Cory <cjlevinson@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-17 20:41:43 +00:00
yihuang 54201d11e6
cli: convert coins to smallest unit registered (#7777)
* cli: convert coins to smallest unit registered

fixes: #7623

- test order of decimal operations
- support both int and decimal coins, truncate when normalizing to
  base unit

* Update types/coin_test.go

* Update types/coin_test.go

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Amaury <amaury.martiny@protonmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-16 11:34:54 +00:00
Anil Kumar Kammari 51ac6f876b
Rename RegisterGRPCRoutes (#7696)
* Rename

* Fix missing

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-28 11:39:49 +00:00
Robert Zaremba 9bd42ace6b
simapp: rename MakeEncodingConfig to MakeTestEncodingConfig (#7681)
* simapp: rename MakeEncodingConfig to MakeTestEncodingConfig

* Updating the Changelog

+ Adding DEPRECATED attribute.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-27 11:33:48 +00:00
Aaron Craelius 228728cce2
Refactor RegisterQueryServices -> RegisterServices (#7518)
* Refactor RegisterQueryServices -> RegisterServices

* Fix tests
2020-10-12 16:31:51 +00:00
Anil Kumar Kammari d55c1a2665
Change `address` from bytes to bech32 strings (#7242)
* init

* Fix bank proto messages

* missing conversions

* remove casttype for addresses

* Fix tests

* Fix consaddress

* more test fixes

* Fix tests

* fixed tests

* migrate missing proto declarations

* format

* Fix format

* Fix alignment

* Fix more tests

* Fix ibc merge issue

* Fix fmt

* Fix more tests

* Fix missing address declarations

* Fix staking tests

* Fix more tests

* Fix config

* fixed tests

* Fix more tests

* Update staking grpc tests

* Fix merge issue

* fixed failing tests in x/distr

* fixed sim tests

* fixed failing tests

* Fix bugs

* Add logs

* fixed slashing issue

* Fix staking grpc tests

* Fix all bank tests :)

* Fix tests in distribution

* Fix more tests in distr

* Fix slashing tests

* Fix statking tests

* Fix evidence tests

* Fix gov tests

* Fix bug in create vesting account

* Fix test

* remove fmt

* fixed gov tests

* fixed x/ibc tests

* fixed x/ibc-transfer tests

* fixed staking tests

* fixed staking tests

* fixed test

* fixed distribution issue

* fix pagination test

* fmt

* lint

* fix build

* fix format

* revert tally tests

* revert tally tests

* lint

* Fix sim test

* revert

* revert

* fixed tally issue

* fix tests

* revert

* fmt

* refactor

* remove `GetAddress()`

* remove fmt

* revert fmt.Striger usage

* Fix tests

* Fix rest test

* disable interfacer lint check

* make proto-format

* add nolint rule

* remove stray println

Co-authored-by: aleem1314 <aleem.md789@gmail.com>
Co-authored-by: atheesh <atheesh@vitwit.com>
2020-09-25 10:25:37 +00:00
Alessio Treglia 7ada179aef
enable -race on go test (#7305)
Introduce 'norace' build tag that is used to
filter out test files containing test cases
or test suites that, if run with the -race
flag on would cause race conditions.

Supersede #7300.
2020-09-15 10:43:46 +01:00
Alessio Treglia 46a8e94740
run make format && go mod tidy (#7298) 2020-09-14 12:42:09 +01:00
colin axnér ec74416276
x/ibc: move solo machine sequence to client state (#7271)
* update proto

* move solo machine sequence to client state

Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-09-09 12:14:11 -03:00
Anil Kumar Kammari 64b6bb5270
rename RegisterCodec to RegisterLegacyAminoCodec (#7243)
* rename RegisterCodec to RegisterLegacyAminoCodec

* Add changelog

* gofmt

* rename codec.New() to codec.NewLegacyAmino()

* Add change log

* Update CHANGELOG.md

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

* Fix

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
2020-09-07 14:47:12 +00:00
Federico Kunze 2f25c9a0d8
x/ibc: solo machine signature format (#7237)
* x/ibc: solo machine signature format

* update tests and verification

* diversifier updates

* update tests

* fix lint

* Update x/ibc/light-clients/solomachine/types/header_test.go

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

* Apply suggestions from code review

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

* update test

* misbehaviour sign bytes

* consensus state tests

* fix tests

* more fixes

Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-09-07 12:46:48 +00:00
dauTT b52ffa08e1
Implement ADR 026 (#7029)
* Add allow_governance_override_after_expiry flag to tendermint NewCreateClientCmd

* 1) Add LatestTimestamp to ClientState struct by adding a new attribute latest_timestamp to the message ClientState in proto/ibc/tendermint/tendermint.proto
2) Autogenerate x/ibc/07-tendermint/types/tendermint.pb.go by running 'make proto-gen'. Strangely, as a side effect x/distribution/types/genesis.pb.go, x/evidence/types/genesis.pb.go were also modified by the command 'make proto-gen'
3) Add Expired() function

* Fix tests

* 1) Add allow_governance_override_after_expiry flag to tendemint clientStatus
2) Add allow_governance_override_after_misbehaviour flag to tendermint ClientStatus

* Cosmetic changes

* Fix tests

* Add Unfreeze function

* Add new ClientUpdateProposal type

* Add minor fixes

* Add NewClientUpdateProposalHandler unit tests

* Fix proto-lint-docker

* Delete x/ibc/07-tendermint/tendermint_test.go

* Follow convention to put signer last in msg function signature

* 1) Add GetLatestTimestamp function  to ClientStatus interface
2) Change Expired() signature to Expired(now time.Time)

* 1) Add override flag to UpdateClient function
2) Fix tests

* Refactor HandleClientUpdateProposal

* 1) Extend exported Header interface with MarshalBinaryBare and UnmarshalBinaryBare methods
2) Move ClientUpdateProposal message to from ibc.proto to client.proto
3) Refactoring code
4) Add override flag to UpdateClient method
5) Fix tests

* 1) Uncomment tests and clean up code
2) Add basic validation of the header (ValidateBasic) when the override flag is true

* Cosmetic changes

* Add TODO comments

* Fix header MarshalBinaryBare, UnmarshalBinaryBare by using protobuf encoding/decoding

* Fix proto comments

* Fix override logic

* undo gettimestamp for solo machine and localhost

* add update after proposal func, some major refactoring in progress, various issues addressed

* fix tendermint proposal update handling

* run make proto-gen

* remove timestamp from tendemint client

* fix build issue for tm types

* apply various review comments

* add tests for 02-client functionality

* self review fixes

* typo

* update tests slightly

* update tendermint proposal handling tests

* Update x/ibc/02-client/keeper/proposal.go

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

* Update x/ibc/07-tendermint/types/proposal_handle.go

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

* Update x/ibc/07-tendermint/types/proposal_handle.go

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

* apply most of @fedekunze and some of @AdityaSripal suggestions

* convert test to bools

* update docs and increase code cov

* fix build

* fix typo, remove omitempty

* add switch

* apply @fedekunze latest suggestions

* fix lint

* Update x/ibc/02-client/keeper/proposal_test.go

Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Colin Axner <colinaxner@berkeley.edu>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Aditya <adityasripal@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-04 20:59:22 +00:00
atheeshp c1b975eecb
Register grpc routes for x/{slashing, params} (#7223)
* Register grpc routes for x/{slashing, params}

* added todos

* review changes

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-09-04 15:07:02 +00:00
Marie 7f59723d88
Make JSONMarshaler methods require proto.Message (#7054)
* Make JSONMarshaler require proto.Message

* Use &msg with MarshalJSON

* Use *LegacyAmino in queriers instead of JSONMarshaler

* Revert ABCIMessageLogs String() and coins tests

* Use LegacyAmino in client/debug and fix subspace tests

* Use LegacyAmino in all legacy queriers and adapt simulation

* Make AminoCodec implement Marshaler and some godoc fixes

* Test fixes

* Remove unrelevant comment

* Use TxConfig.TxJSONEncoder

* Use encoding/json in genutil cli migrate/validate genesis cmds

* Address simulation related comments

* Use JSONMarshaler in cli tests

* Use proto.Message as respType in cli tests

* Use tmjson for tm GenesisDoc

* Update types/module/simulation.go

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

* Update types/module/module_test.go

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

* Add godoc comments

* Remove unused InsertKeyJSON

* Fix tests

Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-08-26 09:39:38 +00:00
atheeshp 78194e1cdd
gRPC gateway init (#7019)
* WIP: grpc server setup

* add register grpc routes

* updated go mod

* updated grpc for all modules

* added pb file for grpc gateway

* udpated gw file

* added a test for grpc route

* fixed conflicts

* added grpc server

* grpc tests added

* cleanup

* Fix gateway forward issue

* Add godoc

* updated tests

* fix lint

* fix tests

* fix tests

* fix tests

* fixed test

* Add grpc headers

* Fix error handling

* Fix tests - hacky

* Fix lint

* remove debug logs

* Fix review comments

* move grpc tests into a separate file

* Fix protobuf version

* Update x/capability/module.go

* Fix godoc

* Fix review suggestions

* Fix codec

* Add query params test for gateway request

* Fix gofmt

Co-authored-by: anilCSE <anil@vitwit.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-08-25 15:44:13 +00:00
Amaury Martiny 3d969a1ffd
Implement gRPC Simulate endpoint (#7035)
* Implement simulate endpoint

* Add GetProtoTx()

* Add signing in test

* Add txBuilderFromProto

* Remove stray println

* Update to master

* Merge master

* Fix tests

* Make tests pass

* Integrate in router

* Make proto-gen

* Fix lint

* Really fix lint

* Refactor to fix import cycles

* Rename builder -> wrapper

* Update proto/cosmos/base/reflection/v1beta1/reflection.proto

* Fix after merge

* t->w

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-08-24 14:41:08 +00:00
Aditya 97df8b605c
Verify Client on Connection Handshake (#7057)
* verify client state

* add client state to msgs and retrieve in handler

* fix connection msgs

* fixed handshake tests

* fix tests

* fix sim tests

* revert pb edit

* add ValidateClient tests

* Apply suggestions from code review

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

* fix tests

* fixed msgs test

* use ibctesting for client state consts

* Apply suggestions from code review

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

* address rest of comments

* rename to ValidateSelfClient and update spec

* lint

* Update x/ibc/02-client/keeper/keeper_test.go

* Update x/ibc/02-client/keeper/keeper_test.go

* complete rest of review

* improve cov

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-08-20 22:05:41 +00:00
Cory f02b0b5745
Protobuf audit: base package, module packages, tx/Msg's (#7059)
* proto audits auth, bank, crisis, distribution

* audit module proto files

* audit base proto package

* make protogen

* golint

* fix gov genesis test

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

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

* update coin metadata protos & documentation

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-08-19 07:36:41 +00:00
Alexander Bezobchuk 7d2062b674
x/bank: gRPC Params Route (#7070)
* update x/bank proto gRPC query service

* fix path

* update keeper

* add godoc

* add test

* lint++
2020-08-17 13:55:04 +00:00
SaReN 77124da21a
Add cli test for query Account (#6973)
Closes: #7007

Ref: #6571

Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-08-17 13:47:31 +01:00
Marko 8de96d16f9
tendermint: update to rc3 (#6892)
* modify light imports

* change abci.header to tmproto.header

* use rc

* rc

* fix import

* Merge PR #6893: fix key imports

* fix rc2

* tendermint: update 3 (#6899)

* tendermint: update 4 (#6919)

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

* tendermint: update 5 (#6923)

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

* bump to latest master

* tendermint: update (#6972)

Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: Cory Levinson <cjlevinson@gmail.com>

* Update x/ibc/07-tendermint/types/test_utils.go

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

* address comment

* go mod

* bring back things

* fix test

* update tm proto files

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: Cory Levinson <cjlevinson@gmail.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
2020-08-14 13:58:53 -04:00
atheeshp f87624e9de
Add Grpc gateway annotations (#6918)
* grpc for bank module

* edit module.go

* added annotations for x/auth query proto

* generated gw file

* added grpc gateway for x/staking query proto

* added annotations for evidence

* added annotations for gov query proto

* added annotations

* added annotations for slashing module

* updated annotations

* added annotations for staking module

* added annotations for upgrade query

* annotations added for x/ibc/channel query proto

* added annotations for ibc/connection query proto

* updated annotations

* updated annotations

* annotation changes

* ommitted ibc module

* updated go.mod

* fixed lint issue

* review changes

* review changes

* review changes

* review changes

* go sum changes

* updated annotations

* annotation changes

* Fix proto lint issues

* review changes

* review changes

* review changes

* discussion changes

* review changes

* grpc for bank module

* edit module.go

* added annotations for x/auth query proto

* generated gw file

* added grpc gateway for x/staking query proto

* added annotations for evidence

* added annotations for gov query proto

* added annotations

* added annotations for slashing module

* updated annotations

* added annotations for staking module

* added annotations for upgrade query

* annotations added for x/ibc/channel query proto

* added annotations for ibc/connection query proto

* updated annotations

* updated annotations

* annotation changes

* ommitted ibc module

* updated go.mod

* fixed lint issue

* review changes

* review changes

* review changes

* review changes

* go sum changes

* updated annotations

* annotation changes

* Fix proto lint issues

* review changes

* review changes

* review changes

* discussion changes

* review changes

* fixed conflicts

* review changes

* updated gw files

* lint

* lint

* lint

* added missing annotations

* review changes

* review changes

* review changes

* review changes

Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
2020-08-14 10:05:35 +00:00
Aaron Craelius 816c5a37bd
Enable proto JSON generally and remove HybridCodec (#6859)
* Remove HybridCodec

* WIP on fixing proto JSON issues

* WIP on fixing proto JSON issues

* WIP on fixing proto JSON issues

* WIP on fixing proto JSON issues

* WIP on fixing proto JSON issues

* Test fixes

* Delete hybrid_codec.go

* Fixes

* Fixes

* Fixes

* Test fixes

* Test fixes

* Test fixes

* Lint

* Sim fixes

* Sim fixes

* Revert

* Remove vesting account JSON tests

* Update CHANGELOG.md

* Lint

* Sim fixes

* Sim fixes

* Docs

* Migrate more amino usages

* Remove custom VoteOption String() and json marshaling

* Fix tests

* Add comments, update CHANGELOG.md

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-08-13 13:20:02 +00:00
Cory 61a97ef347
Audit / Refactor proto packages layout (#6905)
* create base proto package, move ValAddresses to staking

* move tx, crypto, query proto packages into base; mark module level packages as beta

* new cosmos/base/abci.proto file, refactor some message names

* add comments to TxResponse

* refactor RegisterInterface calls to new proto package names

* fix bug in merge commit

* move missing module proto packages to beta, move cosmos.kv to cosmos.base.kv

* add tx.proto files, holding proto messages for module Msgs

* rm old generated pb.go files

* cosmos/base/base.proto -> cosmos/base/coin.proto

* mark genutil proto package as beta

* Fix conflicts

* Restructure proto files

* Re put signing

* Fix test

* Update slashing genesis

* Ignore confio proto files

* Fix interface register

* Make proto-gen

* Fix lint

* Put tx service into tx.v1beta1

* Use v1beta1 in interface registry

* Remove to cosmos.base.store

* Remove extra confio in buf

Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-08-11 11:49:45 +00:00
Aaron Craelius 7de8ef75b3
Require proto.Message in client.Context.PrintOutput (#6999)
* Enable proto JSON json for cli tx & query

* WIP on tests

* Test fixes, cleanup

* Cleanup

* Address review comments

* Update client/context.go

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

* Fixes

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Anil Kumar Kammari <anil@vitwit.com>
2020-08-11 03:19:49 -04:00
dauTT 20c80cfd44
Rename *codec.Codec to *codec.LegacyAmino (#6991)
* Rename *codec.Codec to *codec.LegacyAmino

* Implement requested changes

Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-08-10 19:41:21 +00:00
Amaury Martiny 6e3c268a72
Protobuf audit: Queries (#6967)
* Add required fields for queries, p1

* Add comments

* Remove required

* More modules

* 2 to go

* Finish all modules

* Fix typo

* Fix test

* Make proto-gen

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-08-10 08:12:59 +00:00
SaReN 95cf3c95a6
Remove old tx code from rest (#6939)
* Cleanup rest txs

* Remove nolint

* Update x/ibc to use WriteGeneratedTxResponse

* Update marshaler usages

* Fix PostProcessResponse test

* Update PostProcessResponse
2020-08-05 18:08:13 +00:00