* 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>
* 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>
* 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
* 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>
* 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>
* Add fee payer to protobuf definition
* Compile new tx type
* Use FeePayer from Tx, add it to required signers
* Add unit tests on proper handling of FeePayer field
* Use string address for fee payer field
* Update logic for string feePayer
* add multisig support to testing pkg
Adds single and multisig public key support to the testing package. Fix build associated with changes.
* update clientstate tests to use singlesig and multsig
* add singlesig and multisig tests for consensus state, header, and misbehaviour
* add singlesig and multisig for solomachine handlers
* add spec
* fix lgtm
* fixes from self review
* fix lint?
* fix build
* increase code cov
* Update x/ibc/light-clients/solomachine/types/client_state.go
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
* apply @fedekunze review suggestions
Add comment to VerifyMultisignature explaining why it uses the nested function. Switch panic to require. Add comment for secp256k1 key usage. Ref: https://github.com/cosmos/cosmos-sdk/pull/7383#pullrequestreview-496591518
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>
* add check in header updates for non decreasing timestamp
Add check in update.go that the header timestamp is non decreasing compared to the consensus state timestamp. Unit test added in update_test.go
* update error message
* update godoc
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Update QueryTendermint to take in tendermint height
Update QueryTendermint to subtract the provided height by one to query at the IAVL height.
* Update x/ibc/client/query.go
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
* update height check to > 2
Update height check to ensure that the client context height is greater than two before decrementing. Queries at height 0 and 1 are not expected to succeed. Documentation was updated to reflect this reasoning
* update query to return error for height <= 2
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>
* setup: update linter make jobs
* go lint: remove wsl from golangci-lint config
* rollback to use disable-all
* bring back vendor rules
* lint fails on golangci-lint error
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Fix proposal update handling to update the consensus state with the new diversifier and timestamp. Add checks in the proposal update test to ensure the values provided in the header match. Did manual testing to ensure the test additions fails before updating the code to the correct behaviour.
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
* Update tendermint version
* update testing pkg to use latest versioned block protocol for tendermint headers
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>
Co-authored-by: Colin Axner <colinaxner@berkeley.edu>
* remove client type struct
Remove the client type struct, remove ClientType interface function from Header and Misbehaviour.
ClientState and ConsensusState return the ClientType as a string.
All uses of client type in testing are now pointing at the testing package so changing the location of the client type const will be painless.
* update godoc and add back client type interface func
Add godoc to client type constant for solo machine, tendermint, and localhost as per @fedekunze review suggestion.
Add back the ClientType interface function for misbehaviour and header for solo machine and tendermint and add back the one liner unit tests as per @AdityaSripal suggestion.
* remove client state from return
remove client state from the return of CreateClient, UpdateClient, and CheckMisbehaviourAndUpdateState as well as update tests to reflect this change.
* fix build error introduced by latest merge
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* update handshake to match spec
* add test for version
* add test for open try
* add more tests
Add a test for supplied versions that do not function with previous connection states in INIT and TRYOPEN
* update godoc
* update version checks to switch
Update the version checks in ConnOpenAck to use a switch to increase readability of the code as well as provide custom error messages for each possible case that may occur. Slighly modified version to review suggestion by @fedekunze
* add intersection comments to handshake and pick version
* remove old code
* 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
* 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
* Start removal of old PubKeyMultisigThreshold references
* 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
* Add comment
* Simplify proto names
* Fixed merge issues
* Uncomment tests
* 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?
* Use anil's suggestion
Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
* add multi-sequence ante_test with explicit amino, test out alternative without SkipSequenceCheck
* add attempt at rest based test for full transactions
* drop extraneous ante_handler explicit amino test
* add rest handler test for multiple broadcasts, remove SkipSequenceCheck flag
* add godoc & cleanups
* add test case for incorrect sequence number
* remove artifact files
* Update x/auth/ante/sigverify.go
Co-authored-by: Zaki Manian <zaki@manian.org>
* Update sigverify.go
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Zaki Manian <zaki@manian.org>
* 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
* 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
* 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
* Add comment
* Simplify proto names
* Add comment about multisig codec
Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>