* 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>
* 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>
* codec: remove unnecessary allocations in ProtoCodec.MarshalBinaryLengthPrefixed
Improve ProtoCodec.MarshalBinaryLengthPrefixed by removing the need
to use a *bytes.Buffer and instead use an array and invoke
binary.PutUvarint, and directly create the respective length prefixed
concatentation.
With this change we get the following improvement in all dimenions
of throughput, bytes allocated, number of allocations per operation.
```shell
$ benchstat before.txt after.txt
name old time/op new time/op delta
ProtoCodecMarshalBinaryLengthPrefixed-8 295ns ± 2% 177ns ± 3% -39.92% (p=0.000 n=20+20)
name old speed new speed delta
ProtoCodecMarshalBinaryLengthPrefixed-8 505MB/s ± 2% 841MB/s ± 3% +66.44% (p=0.000 n=20+20)
name old alloc/op new alloc/op delta
ProtoCodecMarshalBinaryLengthPrefixed-8 576B ± 0% 336B ± 0% -41.67% (p=0.000 n=20+20)
name old allocs/op new allocs/op delta
ProtoCodecMarshalBinaryLengthPrefixed-8 5.00 ± 0% 3.00 ± 0% -40.00% (p=0.000 n=20+20)
```
Fixes#6875
* Address @marbar3778's feedback
Use binary.MaxVarintLen64 instead of 10
Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
* WIP: using encoding config
* Make it compile, test fails
* test should be okay
* Make tests pass
* Add comments
* Convert more tests
* Make TestAnteHandlerSigErrors work
* Make first 2 tests pass
* TestAnteHandlerAccountNumbers
* Use table tests
* Remove print
* Use test table
* TestAnteHandlerSigErrors
* TestAnteHandlerAccountNumbers
* TestAnteHandlerAccountNumbers
* Refactor TestAccount
* Refactor getSignBytes
* TestAnteHandlerAccountNumbersAtBlockHeightZero
* TestAnteHandlerSequences
* TestAnteHandlerFees
* TestAnteHandlerMultiSigner
* TestAnteHandlerBadSignBytes
* TestAnteHandlerSetPubKey
* TestAnteHandlerSigLimitExceeded
* TestCustomSignatureVerificationGasConsumer
* TestAnteHandlerReCheck
* Make all tests pass
* Refactor a little bit more
* Fee test
* SetupTest
* All tests pass
* Refactor to RunTestCase
* Don't use StdFee
* Revert some little stuff
* Finish up last couple of test cases
* Less verbose
* s/TxGenerator/TxConfig
* Add comments
* Indent
* Move KeyTestPubAddr to testdata
* Move testdata to /testutil
* Revert to use signature: nil step in signing
* Add comments
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
* refactor auths broadcast cmd in alignment with #6216
* add TxResponse proto definition, and related refactoring
* re-run make proto-gen, updating staking.pb.go
* cleanup TxResponse tests to handle nil return values
* properly handle nil Tx value in TxResponse's implementation of UnpackInterfaces
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
As part of an audit, adds as much visible coverage from
73.4% to about 84.2%, but after #6668 is merged, we'll
have it about 88.X% and the coverage report seems to show
only missing cases of not common scenarios, e.g. a case that'll
make jsonpb.Marshaling to fail, and which will return an error
anyways.
* enable the wsl linter
Fix various wsl-related warnings.
x/ibc/04-channel/keeper/handshake.go: fix missing return statement in ChanOpenTry().
* goimports -w files
* remove unknown linter references
* run make format
* Revert "run make format"
This reverts commit f810b62b9e4993f08506663d4e5f2ec2228a9863.
* run make format
Cancel ci if no .go files have been touched. There is no clean way of
doing this so i opted to `exit 1` on the diff job if no go files were
changed and have builds depend on diff passing
- migrate proto checks to github actions.
- providing make commands to use buf within docker.
- test-sim-multi-seed-long migration to github actions. Follows same
logic and only runs on release branches.
- add protobuf section to CONTRIBUTING.md.
As part of #5864 part 2), this PR decouples the new client/tx
package from x/auth (as an incremental step to deprecating
all the tx logic in x/auth) and adds StdFee, StdSignature,
StdSignMsgBase and StdTxBase to codec/std, while
deprecating the corresponding types in x/auth.
* change abci file to use BinaryBare
* change all calls to EncodeLengthPrefixed to BinaryBare in distribution keeper store.
* change all calls to EncodeLengthPrefixed to BinaryBare in mint keeper store.
* change all calls to EncodeLengthPrefixed to BinaryBare in auth keeper store.
* change all calls to EncodeLengthPrefixed to BinaryBare in distribution keeper store.
* change all calls to EncodeLengthPrefixed to BinaryBare in staking keeper store.
* change all calls to EncodeLengthPrefixed to BinaryBare in staking keeper store.
* change all calls to EncodeLengthPrefixed to BinaryBare in gov keeper store.
* change all calls to EncodeLengthPrefixed to BinaryBare in slashing keeper store.
* update decoder test
* migrate decoder
* migrate gov simulation decoder
* migrate baseapp_test
* refactor QuerySubspace
* refactor coedc std codec
* migrate keybase
* migrate iavl store
* migrate root multi
* migrate ante basic
* migrate tx type to bare
* migrate auth client
* update auth types
* update decoder
* migrate supply decoder
* migrate stake encoding
* migrate staking simulation
* migrate genutil
* migrate simapp test helpers
* migrate docs
* upgrade changelog
* Update CHANGELOG.md
Co-Authored-By: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>