Commit Graph

7753 Commits

Author SHA1 Message Date
Aleksandr Bezobchuk 10f846217d
atlas: x/auth v0.39.1 (#7996) 2020-12-10 10:40:42 -05:00
Aleksandr Bezobchuk 9104a72d50
x/bank: update atlas manifest (#8137) 2020-12-10 16:12:09 +01:00
Alessio Treglia 056f416d2b
use testutil in test cases (#8130)
Also replace defer calls with
testing.T.Cleanup()
2020-12-10 12:56:55 +00:00
Anil Kumar Kammari e321317c20
add page flags for staking validators (#8103)
* add page flags for staking validators

* add test

* fix test

* add build flag

Co-authored-by: aleem1413 <aleem@vitwit.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-12-10 12:26:44 +00:00
Jonathan Gimeno c0f3039fc3
make it exit gracefully. (#8101)
* make it exit gracefully.

* add kig message

* git update error code

* exit with error code

* exit with 0

* Update server/start.go

Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-12-10 11:37:57 +00:00
Emmanuel T Odeke 02fb3a3a32
go.mod: update cosmos/go-bip39 to v1.0.0 (#8127)
Updates cosmos/go-bip39 to version v1.0.0 which
features performance upgrades that bring 12+ searches
down from 24.3us to 1.4us (so 108.33ns per fetch)
after PR https://github.com/cosmos/go-bip39/pull/2.
2020-12-10 09:04:17 +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
colin axnér af401359eb
fix ibc-transfer receiving denom bug (#8119)
* fix receiving denom bug

* Update x/ibc/applications/transfer/keeper/relay.go

* add testing sending 2 hops and back one

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2020-12-09 15:02:59 +00:00
Amaury 58491a5660
Add UnpackInterfaces to BroadcastReq (#8118)
* add test case for decoding & re-encoding a full transaction using amino

* drop equal assertion for tx and txRequest

* Fix BroadcastReq UnpackInterfaces

* Remove unrelated files

* order imports

* sort imports again

Co-authored-by: Cory Levinson <cjlevinson@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-12-09 11:05:12 +00:00
Robert Zaremba 1ec6c640b9
ADR template: add Further Discussions (#8108)
* ADR template: add Further Discussions

* language update

* Update docs/architecture/adr-template.md

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

Co-authored-by: Amaury <amaury.martiny@protonmail.com>
2020-12-09 10:36:48 +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
Riccardo Montagnin e843878920
Recover private validator key (#8099)
* Recover private validator key
Added the ability to recover the private validator key from a given mnemonic when initializing the node

* Added CHANGELOG entry

* Reverted dependencies

* Added tests

* Fixed mnemonic checking as suggested and added tests

* Run make format and fixed go.sum checksum

* Run make format

* fix imports

* fix TestInitializeNodeValidatorFilesFromMnemonic

* Update CHANGELOG.md

Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
2020-12-08 17:22:43 +00:00
Cyrus Goh 0cc39cc027
docs: docs-staging → master (#8084)
* Fix package-lock

* Fix package-lock

* update package-lock

* bump docs theme to 1.0.171

* Fix typo, chinese character in URL
* update dead doc links

* bump docs theme to 1.0.172

* [favicons] add favicons

* makefile: change build-docs target for shells other than bash

* docs: set master as default version

* docs: add v0.40.x to versions

* bump vuepress-theme-cosmos 1.0.175

* docs: fix broken url in cn/basics/app-anatomy.md

* bump docs theme to 1.0.176

* add versions to config.js

* docs: bump docs theme to 1.0.177

* docs: bump docs theme to 1.0.178

* docs: tweak config.js versions with label and key

Co-authored-by: Denis Fadeev <denis@fadeev.org>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: vms <vince19972@gmail.com>
Co-authored-by: Helder Moreira <helder@tendermint.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-12-08 12:53:33 +00:00
Emmanuel T Odeke e38a6df9cd
x/ibc/light-clients: simplify max time comparison (#8089)
The prior code that tried to get the newest/larger time
between the too performed:
* 2 time.Time.UnixNano() retrievals: 2 multiplications, 2 additions
* 1 math.Max comparison
* 1 time.Unix(0, minTime) creation

but really this code could just use native operations on:
time.Time.After() simply.

This now becomes a single operation, single comparison for the same effect.
2020-12-08 13:47:20 +01:00
Robert Zaremba b219c54c2d
Move and update codec.MarshalAny functions to codec.Marshaler interface (#8080)
* Changelog update

* Rename codec.MarshalAny

* move codec.MarshalInterface to codec.Marshaler

* fix tests

* Update amino_codec for compliance with MarshalerInterface

* update tests and comments

* add tests

* change order of args in UnmarshalInterface to a canonical one

* uplift MarshalInterface to take ProtoMessage as an argument

* wip

* add nil check

* make tests working

* tests cleanup

* add support for *JSON methods

* Update changelog

* linter fixes

* fix test types

* update evidence genesis_test

* adding test

* review updates

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-12-08 09:27:08 +00:00
Sunny Aggarwal da6b7f7755
removed gov docs bug (#8105) 2020-12-07 21:33:27 +00:00
Emmanuel T Odeke 291d966fe9
x/ibc/core/23-commitment/types: fix MerkleProof.Empty comparisons (#8092)
* x/ibc/core/23-commitment/types: fix MerkleProof.Empty comparisons

Fixes invalid pointer creation, reduces on unnecessary allocations
inside MerkleProof.Empty, and changes the method to a pointer; the
invalid pointer creation was symptomatic of broad use of values.

With this change we have improvements whose benchmarks produce:

```shell
name     old time/op    new time/op    delta
Empty-8     311ns ± 5%     232ns ± 5%  -25.49%  (p=0.000 n=20+19)

name     old alloc/op   new alloc/op   delta
Empty-8     56.0B ± 0%      8.0B ± 0%  -85.71%  (p=0.000 n=20+20)

name     old allocs/op  new allocs/op  delta
Empty-8      3.00 ± 0%      1.00 ± 0%  -66.67%  (p=0.000 n=20+20)
```

Fixes #8091

* Move Empty godoc to right place + add comments for blank*
2020-12-07 20:57:15 +00:00
MD Aleem d4a919b714
change TmService's validator pubkey type to any (#8060)
* change validator pubkey type to any

* add test for vslidator pubkey

* change address to string

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
2020-12-07 13:51:38 +00:00
Aditya 971d253214
Implement Connection-specified delay (#8069)
* start with initialization and metadata

* start by fixing delay period during connection handshake

* fix connection handshake tests

* add delay period logic to packet verification

* proto format

* fix err issue

* appease linter

* document upgrade special case

* Update x/ibc/light-clients/07-tendermint/types/client_state.go

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

* Update x/ibc/light-clients/07-tendermint/types/store.go

* add sanity check

* fix build

* fix tests

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Colin Axner <colinaxner@berkeley.edu>
2020-12-07 12:13:06 +00:00
Mark Jackson de114773ee
fix typo (#8097)
Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-12-07 11:26:09 +00:00
dependabot[bot] 29091c14e8
build(deps): bump vuepress-theme-cosmos from 1.0.177 to 1.0.178 in /docs (#8098)
Bumps [vuepress-theme-cosmos](https://github.com/cosmos/vuepress-theme-cosmos) from 1.0.177 to 1.0.178.
- [Release notes](https://github.com/cosmos/vuepress-theme-cosmos/releases)
- [Commits](https://github.com/cosmos/vuepress-theme-cosmos/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-12-07 11:17:09 +00:00
Emmanuel T Odeke a8c3b4414d
x/bank/keeper: fix a missing gRPC error in AllBalances (#8085)
* x/bank/keeper: fix a missing gRPC error in AllBalances

Fixes an incoherent return which had:
    (non-nil value, non-nil-non-grpc error)
to
    (nil value, non-nil-gRPC error)

and it is a follow-up of PR #7814.

* types/query: fix pagination test (#8096)

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-12-07 01:32:59 -08:00
colin axnér c8a9da1d27
increase ibc basic genesis validation (#8081)
* increase client basic genesis validation

* add connection/channel genesis validation

* fix tests

* apply @AdityaSripal suggestion

Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-12-05 21:10:15 +00:00
dependabot[bot] c6b8e5f709
build(deps): bump vuepress-theme-cosmos from 1.0.176 to 1.0.177 in /docs (#8075)
Bumps [vuepress-theme-cosmos](https://github.com/cosmos/vuepress-theme-cosmos) from 1.0.176 to 1.0.177.
- [Release notes](https://github.com/cosmos/vuepress-theme-cosmos/releases)
- [Commits](https://github.com/cosmos/vuepress-theme-cosmos/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-12-04 16:40:50 +00:00
Anil Kumar Kammari 4a233b8dcf
Rename GRPCRouter (#8079)
* rename GRPCRouter

* Update store/types/store.go

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

* Fix gofmt

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
2020-12-04 15:06:50 +00:00
Frojdi Dymylja 7ec3bcd23a
fix: bank gRPC error status codes (#7814)
Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-12-04 12:19:29 +00:00
Amaury 1b00c01b70
Audit through legacy endpoints to find breaking changes (#8037)
* Add error msg on staking

* Add tests for legacy staking and gov

* Add test for encode

* Fix broadcast too

* Add comments

* update changelog

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-12-03 23:33:32 +00:00
dependabot[bot] 379c2ad630
build(deps): bump vuepress-theme-cosmos from 1.0.175 to 1.0.176 in /docs (#8052)
Bumps [vuepress-theme-cosmos](https://github.com/cosmos/vuepress-theme-cosmos) from 1.0.175 to 1.0.176.
- [Release notes](https://github.com/cosmos/vuepress-theme-cosmos/releases)
- [Commits](https://github.com/cosmos/vuepress-theme-cosmos/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-12-03 23:24:53 +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
SaReN 183593ff6d
Update signbatch multisig to work online (#7801)
* add test for signbatch multisig

* update test

* fix sign batch multisig

* update offline usage

* address comments

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-12-03 09:48:17 +00:00
Robert Zaremba 6040d1b88b
fix: Metadata is not initialized in x/bank InitGenesis #7951 (#8065)
* fix: Metadata is not initialized in x/bank InitGenesis #7951

* remove commented code

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2020-12-03 08:39:11 +00:00
Aleksandr Bezobchuk bac31becb3
evidence: fix query command (#8066)
* evidence: fix query command

* evidence: add CLI tests

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-12-02 18:08:16 +00:00
MD Aleem b6c8d5ea9f
Add tx broadcast gRPC endpoint (#7852)
* WIP tx/broadcast grpc endpoint

* fix lint

* fix proto lint

* Update service.proto

* resolve conflicts

* update service.proto

* Update service.proto

* review changes

* proto lint

* Switch to txraw

* Add check breaking at the end

* Fix broadcast

* Send Msg on SetupSuite

* Remove proto-check-breaking

* 1 validator in test

* Add grpc server tests for broadcast

* Fix grpc server tests

* Add some changes

* Add ress comments

* Add table tests for tx service

* Add test for mode

* Add simulate tests

* Add build flag back

* Revert custom stringer for enum

* Remove stray logs

* Use /txs/{hash}

Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2020-12-02 17:50:40 +00:00
vincent f57828c091
Fix CryptoCdc inconsistent (#7987)
* simple fix

* refactor crypto

* just use codec/legacy.Cdc

* revert armor

* add changelog entry

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2020-12-02 14:50:50 +01:00
MD Aleem a51eac4f15
Fix QueryByEvents with multiple events and empty pagination request (#8029)
* fix pagination issue

* Fix querying with multiple events

* reuse ParsePagination

* update tests

* change event type to array

* fix test

* review changes

* add test case for escape params

* review changes

* resolve conflicts

* fix test

* fix test

Co-authored-by: anilCSE <anil@vitwit.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-12-01 04:18:35 +00:00
Alessio Treglia 513dabaec8
client/keys: support export of unarmored private key (#8043)
The --unarmored-hex and --unsafe flags are added to
the keys export command. Users must use both to
export private keys material. The output would be in
hexadecimal format and unarmored.

See #8042 for scope and motivations.

introduce new UnsafeKeyring interface.

Unsafe operations are supported by UnsafeKeyring types.
By doing so, we try to make the client developer aware
of the risks.

Co-authored-by: Sunny Aggarwal <sunnya97@protonmail.ch>
2020-11-30 20:55:39 +00:00
Aleksandr Bezobchuk 6476b09b64
multistore: fix SetInitialVersion (#8048) 2020-11-30 12:22:05 -05:00
Amaury 7ad2aab2c4
Add panic handler on queries (#8039)
* Add test that panics

* Add panic in abci query

* Move proto gen files to correct place

* Add panic handler in grpc server

* Fix test

* Fix build

* Use %v

* Better panic message

* Fix tests

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2020-11-30 16:59:35 +00:00
colin axnér bcb3240d06
Use generated client identifiers (#8034)
* add client identifier generation

* update proto and start fixing tests

* fix ibc tests

* fix auth rest test

* update spec

* fix lint

* add parsing tests and fix bugs

* fix regexp

* add godoc

* address @AdityaSripal review suggestions for identifier parsing

* address rest of @AdityaSripal's review comments

* remove unnecessary comment

* typos

* fix lint

* Apply suggestions from code review

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

* add more heigh tests as per @AdityaSripal suggestion

Co-authored-by: Aditya <adityasripal@gmail.com>
2020-11-30 15:52:45 +00:00
Sunny Aggarwal a648325f88
Merge pull request #7491 from sikkatech/sunny/change-pubkey-adr
ADR034: Account Rekeying
2020-11-27 12:09:13 -05:00
Sunny Aggarwal a77eb251f1
Merge branch 'master' into sunny/change-pubkey-adr 2020-11-27 12:07:03 -05:00
Amaury b6bd4f5c2e
docs: Remove legacy Msg/queriers in "Basics" section (#7782)
* docs: Remove legacy Msg/queriers in Basics

* Service

* Update links

* Update to rc2

* Update refs

* Use TM hashes

* REformulate

* Remove deep copy

* Update docs/DOCS_README.md

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

Co-authored-by: Cory <cjlevinson@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-27 12:57:14 +00:00
colin axnér ed9fc058f1
Add an IBC prefix to transfer escrow addresses (#7967)
* add IBC prefix to escrow addresses

* use ADR 028 AddressHash construction

* remove extra space

* apply @AdityaSripal suggestion; prefix from ibc -> ibc-transfer-escrow-prefix

* Use alternative 1 proposed by @andrey-kuprianov

* anticpate necessary build fix

* add escrow address issue link into module.go

* Update x/ibc/applications/transfer/types/keys.go

Co-authored-by: Andrey Kuprianov <59489470+andrey-kuprianov@users.noreply.github.com>

* Update x/ibc/applications/transfer/types/keys.go

Co-authored-by: Andrey Kuprianov <59489470+andrey-kuprianov@users.noreply.github.com>

* apply @andrey-kuprianov review suggestions

Deduplicate code into a helper function as suggested. Add unit tests for max transfer channels test.

Co-authored-by: Andrey Kuprianov <59489470+andrey-kuprianov@users.noreply.github.com>
2020-11-26 13:44:54 +00:00
yihuang 512b533242
cli: ParseCoin doesn't do normalize (#7954)
follow up on https://github.com/cosmos/cosmos-sdk/pull/7777
ParseCoin need to be treated similarly.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-25 18:02:10 +00:00
MD Aleem c58a8923a0
gRPC-gateway routes as alternative to legacy tendermint REST endpoints (#7965)
* WIP

* WIP setup

* WIP setup testsuite

* add node_info

* add GetLatestBlock,GetBlockByHeight grpc endpoints

* add GetValidatorSetByHeight, GetLatestValidatorSet

* fix lint

* fix tests

* proto format

* Update Makefile

* review changes

* Makefile format

* handle nil pagination

* rename query.go to service.go

* format Makefile

* format Makefile

* review changes

* review changes

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-25 15:58:11 +00:00
Amaury a9dd334c34
Fix legacy querying tx ("unregistered type" bug) (#7992)
* Add tests for query txs

* Add test for IBC

* Refactor checkSignModeError

* Fix lint

* Add successful IBC test

* Remove logs

* break

* Remove known errors

* Update error message

* Better comments

* Revert variable renaming

* Fix lint

* Add mention of gRPC as TODO
2020-11-25 12:02:31 +00:00
Alessio Treglia 9c47612b5d
Makefile: use docker run --rm whenever possible (#8026)
Remove terminated containers once their execution
has finished. This saves the users a bit of disk
space.

Closes: #8023
2020-11-25 11:23:37 +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
Sunny Aggarwal dc9d36bfbd
Merge branch 'master' into sunny/change-pubkey-adr 2020-11-24 13:07:48 -05:00
Sunny Aggarwal b5442e1d5e
Update adr-034-account-rekeying.md 2020-11-24 13:06:58 -05:00