Commit Graph

2691 Commits

Author SHA1 Message Date
Aaron Craelius 9e7eb0da00
Add MsgServer to Configurator for ADR 031 wiring (#7584)
* Add MsgServer to Configurator for ADR 031 wiring

* Add docs, wire up evidence & staking

* Add integration test

* Add comments

* Doc strings

* Update types/module/configurator.go

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

* Update types/module/configurator.go

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

* Wire up vesting

* Update CHANGELOG.md

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Cory <cjlevinson@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-19 17:46:10 +00:00
Jun Kimura ba2799ec6d
fix sequence checks in solomachine (#7586)
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-10-19 13:35:52 +00:00
Robert Zaremba 8eaf2ececc
Refactor x/staking Validation and Delegation tests based on MsgCreateValidator.Pubkey type change. (#7526)
* testing: refactore Validation and Delegation handling of x/staking

This Changeset introduces set of improvements for writing tests.

The idea is to create a testing subpackage which will provide functions
to make tests more dev-friendly and wrap higher level use-cases.
Here is a show-up of of creating a service for staking module
for tests.

This PR also changes the `x/staking/types.MsgCreateValidator.Pubkey` from string
to types.Any. This change motivated the other change to show the pattern I'm describing here.

* add validator checks

* type change fixes

* use deprecated

* adding test slashing

* new network comment update

* working on tests

* Fix TestMsgPkDecode test

* Add UnpackInterfaces to MsgCreateValidator

* Fix tests

* Convert bech32 pubkey to proto

* Fix test

* fix v039/migrate_test/TestMigrate

* fix tests

* testslashing: rename Service to Helper

* file rename

* update TestMsgDecode

Co-authored-by: blushi <marie.gauthier63@gmail.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Cory Levinson <cjlevinson@gmail.com>
2020-10-19 13:04:55 +00:00
colin axnér 0f8fdf60df
Remove ClientType func and update consensus state path (#7573)
* update paths and remove unused func

* fix bug

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-19 09:59:31 +00:00
colin axnér 6fa73998bd
Fix solomachine cmds (#7581)
* fix solo machine cli cmds

* polish

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-19 09:40:29 +00:00
Cory 8138605aed
Refactor x/auth/vesting to use ADR-031 (#7551)
* update auth/vesting module to use proto msg services

* rm accidental tmp files

* Update x/auth/vesting/msg_server.go

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

* golangci-lint fix

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-19 09:22:56 +00:00
colin axnér c40f3d02a0
remove id in localhost (#7577)
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-10-17 21:05:26 +00:00
Amaury Martiny 58eabcb71f
Refactor x/evidence to ADR-031 (#7538)
* Refactor x/evidence to ADR-031

* Add hash in response

* Update changelog

* Update x/evidence/keeper/keeper.go

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

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

* Use msgServer struct

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
2020-10-16 16:05:25 +00:00
atheeshp 18ef33caff
Refactor x/staking according to ADR 031 (#7556)
* Refactor x/staking according to ADR 031

* lint

* review changes

* review changes

* review changes

Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-10-16 14:53:49 +00:00
atheeshp 6e569e1255
Refactor x/{gov, crisis} according to ADR 031 (#7533)
* Refactor x/gov according to ADR 31

* fix tests

* Refactor x/crisis according to ADR 031

* fix lint

* lint

* lint

* review changes

* lint

* review change

* fic doc

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-16 13:04:02 +00:00
Amaury Martiny 69e2b7df16
docs: Revert SPEC-SPEC and update x/{auth,bank,evidence,slashing} (#7407)
* Revert some changes from #7404

* Update x/slashing

* Address review comments

* Small tweak

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-16 12:42:48 +00:00
colin axnér 7818867163
ibc: update solo machine client command (#7579)
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-10-16 09:24:48 -03:00
SaReN 332d8ec038
update upgrade query (#7567) 2020-10-15 19:02:45 +00:00
Zaki Manian c735a8eb81
Add the option of emitting amino encoded json from the CLI (#7221)
* Add the option of emitting amino encoded json

* Update AMINO JSON serialization with ConvertTxToStdTx

* Make the Amino flag more self documenting by serializing the BroadcastRequest type instead of StdTx

* Handle amino encoding error

* Update x/auth/client/cli/tx_multisign.go

Co-authored-by: Alessio Treglia <alessio@tendermint.com>

* Update x/auth/client/cli/tx_sign.go

Co-authored-by: Alessio Treglia <alessio@tendermint.com>

* Apply suggestions from code review

Co-authored-by: Alessio Treglia <alessio@tendermint.com>

* Fix go format

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-15 15:12:35 +00:00
Marie Gauthier c59a04d70f
[x/slashing] Implement Protobuf Msg Services (#7557)
* Update x/slashing to use proto msg service

* Fix proto-gen

Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-15 14:38:15 +00:00
Federico Kunze 503b518efc
client: add GetAccount and GetAccountWithHeight to AccountRetriever (#7558)
* client: add GetAccount and GetAccountWithHeight to AccountRetriever

* update ADR

* address comments from review
2020-10-15 14:19:57 +00:00
atheeshp bf7165414d
Refactor x/distribution according to ADR 031 (#7524)
* Refactor x/distribution according to ADR 31

* lint

* removed unused

* Apply suggestions from code review

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

Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-15 13:54:16 +00:00
Amaury Martiny 55242a659c
Add ADR 031 BaseApp and codec infrastructure (#7519)
* Refactor RegisterQueryServices -> RegisterServices

* Cleaner proto files

* Fix tests

* Add MsgServer

* Fix lint

* Remove MsgServer from configurator for now

* Remove useless file

* Fix build

* typo

* Add router

* Fix test

* WIP

* Add router

* Remove test helper

* Add beginning of test

* Move test to simapp?

* ServiceMsg implement sdk.Msg

* Add handler by MsgServiceRouter

* Correct signature

* Add full test

* use TxEncoder

* Update baseapp/msg_service_router.go

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

* Push changes

* WIP on ServiceMsg unpacking

* Make TestMsgService test pass

* Fix tests

* Tidying up

* Tidying up

* Tidying up

* Add JSON test

* Add comments

* Tidying

* Lint

* Register MsgRequest interface

* Rename

* Fix tests

* RegisterCustomTypeURL

* Add changelog entries

* Put in features

* Update baseapp/msg_service_router.go

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

* Update baseapp/msg_service_router.go

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

* Update baseapp/msg_service_router.go

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

* Update baseapp/msg_service_router.go

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

* Update baseapp/msg_service_router.go

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

* Update baseapp/msg_service_router.go

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

* Update baseapp/msg_service_router.go

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

* Address review comments

* Address nit

* Fix lint

* Update codec/types/interface_registry.go

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

* godoc

Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
2020-10-15 13:07:59 +00:00
colin axnér 652d5d93bb
remove test_utils.go in tm client (#7522)
* remove test_utils from tm client

* fix build

* fix lint?

* fix lint?

* apply @fedekunze review suggestion

* add tests as per @alessio suggestion

* fix typo
2020-10-14 14:51:11 +00:00
colin axnér 3589a3c799
Fix misbehaviour handling for solo machine (#7515)
* add timestamp to SignatureAndData

Add timestamp field to signature and data. Add ValidateBasic check for timestamp. Add ValidateBasic test. Update misbehaviour handler to use supplied timestamp.

* fix typo

* add timestamp check

* fix lint

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-10-13 09:02:24 -03:00
colin axnér 037a32bc91
ibc: cleanup channel types test (#7521) 2020-10-13 06:57:39 -03:00
Aaron Craelius 9be15a42b9
Refactor x/bank according to ADR 031 (#7520)
* Refactor x/bank according to ADR 031

* Add comment

* Update comment

* Add comment

* Add tests, address edge cases

* Imports

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-13 09:05:46 +00:00
colin axnér 45f5df7ea5
update solo machine specs (#7512)
* update solo machine specs

* update concepts

* self review fixes

* Apply suggestions from code review

* add note on upgarding solo machines

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-10-13 05:36:23 -03:00
Aaron Craelius 228728cce2
Refactor RegisterQueryServices -> RegisterServices (#7518)
* Refactor RegisterQueryServices -> RegisterServices

* Fix tests
2020-10-12 16:31:51 +00:00
Amaury Martiny 647ad0dd3c
docs: Update "Basics" section (#7416)
* Prettier

* docs: Update "Basics" section

* appcli -> appd

* Better wording

* Fix to appCodec

* Add gRPC mention

* Add grpc

* Reference simapp code

* Update docs/basics/accounts.md

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

* Add section about gRPC query services

* Optional LegacyQuerierHandler

* Clearer docs

* Update docs/basics/app-anatomy.md

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

* Update docs/basics/app-anatomy.md

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

* Address comments

* Address comments

* Update docs/basics/accounts.md

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-10-12 15:31:25 +00:00
Amaury Martiny 33e7297c79
Use enum instead of int32 for BondStatus (#7499)
* Migrate staking module

* Add gov legacy

* Add comments

* Add x/distrib

* x/crisis

* x/mint

* Fix test

* migrate x/genutil

* Fix lint

* Fix staking constants

* Fix test

* Update x/genutil/legacy/v040/migrate.go

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

* Add migrate script instead of change BondStatus constants

* Change staking bondStatus to enum

* Fix test

* Fix another test

* Remove staking exported

* fix references

* Better constants

* Fix build

* Fix lint

* Remove buf version

* Fix tests

* Fix test

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2020-10-12 13:56:02 +00:00
Neeraj Murarka 61d5844705
Corrected 'unsafe-reset-all' help text (#7504) 2020-10-10 13:02:12 +02:00
Amaury Martiny c14a3a7cb2
CLI `migrate` command follow-up: decode & re-encode (#7464)
* Migrate staking module

* Add gov legacy

* Add comments

* Add x/distrib

* x/crisis

* x/mint

* Fix test

* migrate x/genutil

* Fix lint

* Fix staking constants

* Fix test

* Update x/genutil/legacy/v040/migrate.go

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

* Add migrate script instead of change BondStatus constants

* Fix test

* Fix another test

Co-authored-by: Marie Gauthier <marie.gauthier63@gmail.com>
Co-authored-by: Cory <cjlevinson@gmail.com>
2020-10-09 19:09:43 +00:00
wimel 278eaa70f8
Fix on gov module (#7493)
* Fix ISSUE #64 on cosmosdevs/stargate

* Fix ISSUE #64 on cosmosdevs/stargate

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

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2020-10-09 16:28:58 +00:00
Federico Kunze c39dd9eb38
ibc: metrics (#7441)
* ibc transfer metrics

* ibc client metrics

* update connection logs

* connection metrics

* channel metrics

* update logs

* docs updates

* update telemetry.md

* move calls from handler

* Update x/ibc/core/04-channel/keeper/handshake.go

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

* add chain-id metric

* address @colin-axner comments

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-10-08 12:37:20 +00:00
colin axnér ac9aebf4af
rename epoch to version (#7483)
* rename epoch to version

* Apply suggestions from code review

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-08 12:03:47 +00:00
Emmanuel T Odeke d2b914781b
x/genutil: fix CollectTxs traversal logic (#6913)
* x/genutil: fix CollectTxs traversal logic

Fixes the file traversal of CollectTxs to correctly skip over
directories instead of trying to read them, failing and erroring
out.

Also while here, changed the order to perform the os read
only after the AppState UnmarshalJSON has succeeded, otherwise
an attack vector can be to purposefully request many file stats
which touches kernel resources, while  just causing failures
indefinitely.

Fixes #6788

* address comments

* Fix test by passing in blank AppState

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: SaReN <sahithnarahari@gmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-08 11:22:39 +00:00
colin axnér dd84c8bd56
add ConsensusParams to ClientState (#7456)
* add ConsensusParams to ClientState

* validate self consensu params using context + tests

* fix tests

* remove test

* Update proto/ibc/lightclients/tendermint/v1/tendermint.proto

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

* add tests for nil consensus params

* use default consensus params variable housed in the testing pkg

* set consensus params in get context call

* disallow nil consensus params

* disallow nil consensus state + fixes

* remove comments

* make proto

* fix build

* fix build

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-08 11:01:55 +00:00
Amaury Martiny 87e3751f5c
Update TM to latest (+add test) (#7442)
* Add test for /block_results

* Fix test

* Use http RPC client

* Fix temporarily block_results

* Use init

* Add flag back

* Remove init

* Update TM master

* Address comments

* Fix build

* require refactor

* Add build flag back

* More timeout on test

* fix timeout-minutes

Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-10-08 12:44:11 +02:00
Aditya 31ab35ad72
UpgradeClient Followup #1 (#7457)
* require old chain halts before upgrade

* Update proto/ibc/core/client/v1/client.proto

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

* start address reviews

* Apply suggestions from code review

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

* address reviews

* rework upgrade to ensure there is never more than one upgrade client in store

* fix tests

* fix conditional

* make proto-gen

* remove if statement skipping tests in upgrade keeper test

* address reviews

* correctly escape and unescape merkle keys

* add small conditional check

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Colin Axner <colinaxner@berkeley.edu>
2020-10-08 09:22:22 +00:00
Aditya bb6b0cf95b
Upgrade followup #3 (#7467)
* prevent upgrades if client is expired

* fix test
2020-10-07 08:51:56 +00:00
Amaury Martiny 090bae567b
Use nil instead of protobuf.Empty in genesis BaseAccount (#7463)
* Use nil instead of protobuf.Empty in genesis

* Fix tests
2020-10-06 16:07:37 +00:00
Aditya c9cb02ea98
Upgrade-Client Followup #2 (#7460)
* enforce client-chosen parameters are persisted across upgrades in tendermint clients

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

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-10-06 09:49:15 +00:00
Aaron Craelius 4a1b2fba43
Add Fee granter field (#7418)
* WIP on adding Fee granter field

* WIP on adding Fee granter field

* WIP on adding Fee granter field

* Update comments, add tests
2020-10-05 21:56:09 +00:00
Amaury Martiny d9ede6551a
0.39->0.40 CLI `migrate` command (#6839)
* WIP on BaseAccount protobuf pub_key

* WIP on BaseAccount.PubKey

* Migrate supply

* Change validator_slash_event

* Add evidence

* Add evidence to genutil migrate

* Fix lint

* Add println

* No _ in package name

* Add slashing migrate

* Add tests for slashing

* Add capacity to array

* stray fmt.Prinlnt

* WIP on BaseAccount pub key

* Put current types in v0_40

* Add evidence old types

* Remove useless impl

* Add RegisterInterface

* Add clientCtx to argument

* Register evidence interfaces

* Update PubKey

* Update Account

* Docs

* WIP on protobuf keys

* Use Type() and Bytes() in sr25519 pub key Equals

* Add tests

* Add few more tests

* Update other pub/priv key types Equals

* Fix PrivKey's Sign method

* Rename variables in tests

* Fix infinite recursive calls

* Use tm ed25519 keys

* Add Sign and VerifySignature tests

* Remove ed25519 and sr25519 references

* proto linting

* Add proto crypto file

* Implement some of the new multisig proto type methods

* Add tests for MultisigThresholdPubKey

* Add tests for pubkey pb/amino conversion functions

* Move crypto types.go and register new proto pubkeys

* Add missing pointer ref

* Address review comments

* panic in MultisigThresholdPubKey VerifySignature

* Fix compile errors

* Remove pk conversion in ante handler

* Use internal crypto.PubKey in multisig

* Add tests for MultisigThresholdPubKey VerifyMultisignature

* Only keep LegacyAminoMultisigThresholdPubKey and move to proto keys to v1

* Remove conversion functions and introduce internal PubKey type

* Override Amino marshaling for proto pubkeys

* Merge master

* Make proto-gen

* Start removal of old PubKeyMultisigThreshold references

* Fix tests

* Fix solomachine

* Fix ante handler tests

* Pull latest go-amino

* Remove ed25519

* Remove old secp256k1 PubKey and PrivKey

* Uncomment test case

* Fix linting issues

* More linting

* Revert tests keys values

* Add Amino overrides to proto keys

* Add pubkey test

* Fix tests

* Use threshold isntead of K

* Standardize Type

* Revert standardize types commit

* Fix build

* Fix lint

* Fix lint

* Add comment

* Register crypto.PubKey

* Add empty key in BuildSimTx

* Simplify proto names

* Unpack interfaces for signing desc

* Fix IBC tests?

* Format proto

* Use secp256k1 in ibc

* Fixed merge issues

* Uncomment tests

* Update x/ibc/testing/solomachine.go

* UnpackInterfaces for solomachine types

* Remove old multisig

* Add amino marshal for multisig

* Fix lint

* Correctly register amino

* One test left!

* Remove old struct

* Fix test

* Fix test

* Unpack into tmcrypto

* Remove old threshold pubkey tests

* Fix register amino

* Fix lint

* Use sdk crypto PubKey in multisig UnpackInterfaces

* Potential fix?

* Register LegacyAminoPubKey

* Register our own PubKey

* Register tmcrypto PubKey

* Register both PubKeys

* Register interfaces in test

* Refactor fiels

* Add comments

* Remove old cosmos-sdk/crypto/keys reference

* Use anil's suggestion

* Add norace back

* Use our own ed25519

* Fix pubkey types

* Fix network tests

* Fix more tests

* Make ibc work?

* Use TM pubkey in NewValidator

* Fix lint

* Put interface in tpyes

* rerun CI

* Better name register

* Remove stray code

* Add ed25519 tests

* Check nil

* Correct interface impl assert

* rerun CI

* Add fix for Bech32

* Address comments

* FIx lint

* Add tests for solomachine unpack interfaces

* Fix query tx by hash

* Better name in amino register

* Fix lint

* Add back ed25519 test (fixes #7352)

* go mod tidy

* Fix merge issues

* Sort import

* Add test for backwards-compatibility

* Fix tests

* Fix merge issue

* Fix merge issues

* Fix tests build

* Fix tests

* Marshal to proto

* Fix 040 marshalling

* Remove dontcover

* Fix equivocation

* Add vesting

* Fix vesting

* Fix slashing test

* Fix evidence test

* Remove pb.go files

* Fix legacy auth tests

* deterministic tests help

* Fix auth tests

* Remove useless code

* Small cleanups

* Add comment

* Fix migrate hub

* fmt.Println

* No need to marshal indent

* Update proto comment

* Fix merge issues

* Support nil pubkey

* Use protobuf empty

* Address comments

* Fix tests

* Unify legacy package names

Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: blushi <marie.gauthier63@gmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Zaki Manian <zaki@manian.org>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-10-05 21:28:14 +00:00
colin axnér 6fa8330c31
Flexible handshake followup (#7454)
* rename provedID

rename provedID to counterpartyChosenID for connection and channel. Update if statement in handshake and tests. Ref: https://github.com/cosmos/cosmos-sdk/pull/7439#discussion_r498858944

* update docs

Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-10-05 14:48:04 +00:00
colin axnér a84f4fb3d5
rename signature to signature data (#7455)
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-10-05 14:32:26 +00:00
colin axnér 0047099061
ibc: flexible channel handshake selection (#7439)
* update channel handshake

Add ProvedID to ChanOpenTry which allows for flexible handshake identifier selection. Add CounterpartyChannelID to OpenAck. Update and add to handshake tests. Modify msgs_test. Counterparty ValidateBasic will return nil on an empty channel identifier to allow for flexible handshake identifier selection to succeed.

* Update x/ibc/core/04-channel/keeper/handshake.go

* add conn open init docs

* update docs for conn open try and conn open ack

* update channel docs
2020-10-02 16:17:00 -03:00
Federico Kunze 82c9ae3949
LGTM alerts audit (#7440)
* LGTM alerts audit

* Update x/simulation/mock_tendermint.go

Co-authored-by: Alessio Treglia <alessio@tendermint.com>

* Update x/staking/keeper/delegation.go

Co-authored-by: Alessio Treglia <alessio@tendermint.com>

* comment false positive

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-10-02 15:13:58 +02:00
Federico Kunze 2c93ec7a0c
ibc: core restructure (#7434)
* ibc: protobuf v1

* update codec

* core client

* core connection

* core host

* core commitment

* core port

* core channel

* core ibc module files

* core exported

* core types & simulation

* core spec

* make proto-all

* ibc alias
2020-10-02 06:03:02 -03:00
colin axnér 432ba30bed
Flexible Connection Handshake Selection (#7427)
* update connopeninit

Update ConnOpenInit to reflect changes in https://github.com/cosmos/ics/pull/482. An additional version field is added to the connection handshake and connection open init message to take in an optional field. If this field is empty, then the default versions are used for connection handshake version negotiation.

* add version compatibility check in open init

* implement partial changes to conn open try

* partial implementation of conn open ack changes

* fix tests

* add handshake tests

* make proto

* fix conflicts

* fix lint

* fix lint

* increase code cov

Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
2020-10-01 22:28:15 +00:00
Federico Kunze 53f8aec857
ibc: protobuf v1 (#7432)
* ibc: protobuf v1

* update codec
2020-10-01 19:23:29 +00:00
Federico Kunze 92ffed01bb
ibc: applications restructure (#7425)
* ibc: applications refactor

* update proto files

* try fix castrepeated

* fix proto

* update spec

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-10-01 15:32:53 +00:00
Federico Kunze 72353902e2
ibc: rename epoch -> version (#7429)
* ibc: rename epoch -> version

* more renaming

* update spec
2020-10-01 15:08:26 +00:00
colin axnér a32e2a03ae
Enforce solo machine signature type uniqueness (#7394)
* update solo machine proto types to use enum for uniqueness

* move data type to SignatureAndData

Adjusts SignatureAndData proto definition to take in a DataType. Updates misbehaviour basic validation to do checks on the data type. Adds unmarshaling tests.

* split signature bytes creation to allow for function reusing. Stuck on strange error on testing codec.go

* fix test bug

* update UnmarshalByType and refactor misbehaviour handle

Rename CanUnmarshalDataByType -> UnmarshalDataByType. Return a new interface and error. Refactor tests to work. Refactor misbehaviour_handle.go to check unmarshaling of the data and DRY code by separating signature and data checks into its own function. Update godoc.

* add tests to codec_test.go

* self review + lint

* update spec

* fix lint

* Update x/ibc/light-clients/solomachine/spec/01_concepts.md

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

* increase code cov, update spec

apply most of @fedekunze comments.

* format spec

* make proto

* fix merge conflicts

* make proto

* fix conflicts

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
2020-10-01 11:40:35 +00:00