* 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>
* adr-27: adding
Each ADR should have an abstract and an example use case to quickly present the goal.
Here, adding this to DR 027: Deterministic Protobuf Serialization
* review update
* added link to TxRaw
* added list of major use-cases
* updated wording in context and abstract
* updated the adr-020 part
* add consequences and motivation for TxRaw
* Update docs/architecture/adr-027-deterministic-protobuf-serialization.md
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
* Update docs/architecture/adr-027-deterministic-protobuf-serialization.md
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
* Update docs/architecture/adr-027-deterministic-protobuf-serialization.md
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
* Update docs/architecture/adr-027-deterministic-protobuf-serialization.md
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
* Update docs/architecture/adr-027-deterministic-protobuf-serialization.md
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
* rewording
* Update docs/architecture/adr-027-deterministic-protobuf-serialization.md
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
* Update docs/architecture/adr-027-deterministic-protobuf-serialization.md
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
* Update docs/architecture/adr-027-deterministic-protobuf-serialization.md
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
Co-authored-by: Amaury Martiny <amaury.martiny@protonmail.com>
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
Co-authored-by: Cory <cjlevinson@gmail.com>
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