Commit Graph

283 Commits

Author SHA1 Message Date
Alessio Treglia 57ffe14631
Makefile: build simd with ledger support (#6629)
Makefile: parse COSMOS_BUILD_OPTIONS

Look for build options in the make's COSMOS_BUILD_OPTIONS
variable. This allows one to build simd with ledger support.

References:
* https://github.com/cosmos/gaia/pull/363
* https://github.com/tendermint/tendermint/pull/4738

fix tiny typo in nolint: statement that causes golangci-lint to
misbehave.
2020-07-07 19:10:11 +02:00
Alexander Bezobchuk 8670a10564
Merge PR #6595: Single Binary & Command Refactor 2020-07-07 11:40:46 -04:00
Alessio Treglia 80e53a4d89
buildsystem: various small improvements (#6598)
Follow-up of #6101.

- Makefile:

Set all as actual default target.

- contrib/devtools/Makefile:

The buf target was running unconditionally.

Install protoc-gen-gocosmos along with protoc.
2020-07-03 20:50:14 +02:00
Cory 4e73e0f817
Update proto files & definitions in accordance with ADR023 (#6413)
* consolidate proto files into single directory, turn on PACKAGE_DIRECTORY_MATCH linting

* add third_party root for third party proto files

* move ibc proto files to top level folder, rename .proto files to types.proto as before

* update protocgen script, and run code generation

* move vesting proto definition to cosmos namespace, rename from types.proto in alignment with buf.build naming conventions

* update Makefile so proto dependencies are set with new structure when updated

* add comment for sed usage in makefile

* remove unused aliases of proto generated types

* add settings.json instructions to contributing.md for including protobuf paths

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
2020-06-18 10:04:26 -07:00
Alexander Bezobchuk 6a05b83069
Merge PR #6426: Migrate API Server 2020-06-15 13:39:09 -04:00
Alexander Bezobchuk 7871910359
Simapp Localnet (#6421)
* Setup localnet

* Fix compose

* Fix file perms

* Fix build

* Codec + lint updates

* lint++
2020-06-12 16:23:08 +00:00
Alessio Treglia 65ea305336
x/auth: add sign-batch command (#6350)
The command processes list of transactions from file
(one StdTx each line), generate signed transactions
or signatures and print their JSON encoding, delimited
by '\n'. As the signatures are generated, the command
increments the sequence number automatically.

Author: @jgimeno
Reviewed-by: @alessio
2020-06-08 17:19:29 +02:00
Aaron Craelius 43947ca2ef
Add RegisterQueryService to AppModule (#6336)
* Add RegisterQueryService to AppModule

* Update CHANGELOG.md

* Update CHANGELOG.md

* Wire up BaseApp, fix tests

* Add mock test

* add missing file

* Update types/module/module.go

* Update CHANGELOG.md

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-06-06 07:59:57 +00:00
SaReN 39f53ac22f
client: rename CliContext to Context (#6290)
* Refactor CliContext as Context

* Fix lint issues

* Fix goimports

* Fix gov tests

* Resolved ci-lint issues

* Add changelog

* Rename cliCtx to clientCtx

* Fix mocks and routes

* Add changelog

* Update changelog

* Apply suggestions from code review

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

* merge client/rpc/ro{ot,utes}.go

* Update docs

* client/rpc: remove redundant client/rpc.RegisterRPCRoutes

* regenerate mocks

* Update ADRs

Co-authored-by: Alessio Treglia <alessio@tendermint.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-06-01 12:46:03 +00:00
Aaron Craelius 850419fffd
Tx CLI proto module interface (#5989)
* WIP

* WIP

* WIP on removing x/auth dependency from client/tx

* Revert unneeded changes

* Simplify cli tx UX

* Wire up bank tx REST routes

* Fix assignment issue

* Wire up bank NewSendTxCmd

* fix lint

* revert file

* revert file

* fix simcli

* Refactor AccountRetriever

* Fix build

* Fix build

* Fix build

* Fix integration tests

* Fix tests

* Docs, linting

* Linting

* WIP on all modules

* Implement other module new tx cmd's

* Fix cmd's

* Refactor existing GetTxCmd

* Fix cmd

* Removing deprecated code

* Update ADR 020 & CHANGELOG

* Lint

* Lint

* Lint

* Lint

* Lint

* Lint

* Lint

* Fix client/tx tests

* Fix mocks

* Fix tests

* Lint fixes

* REST tx migration

* Wire up REST

* Linting

* Update CHANGELOG, docs

* Fix tests

* lint

* Address review feedback

* Update CHANGELOG.md

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

* Update CHANGELOG.md

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

* group vars

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-05-21 21:29:34 +00:00
Aaron Craelius 70767c87c4
Update x/gov to use Any (#6147)
* Update x/gov to use Any

* Fixes

* Remove MsgSubmitProposalLegacy

* Update CHANGELOG.md

* Add RegisterInterfaces for x/distribution, x/params, & x/upgrade

* Fix query JSON issue

* Fix gov tests

* Revert custom Any Equals

* Re-remove types

* Rename receivers

* Fix imports in gov

* Sort imports

* Make amino JSON signing work with Any

* Run proto-gen

* Create full amino wrapper

* Fix errors

* Fixes

* Fix tests

* Test fixes

* Fix tests

* Linting

* Update ADR 019 and CHANGELOG

* Updated ADR 019

* Extract Marshal/UnmarshalProposal

* fix error

* lint

* linting

* linting

* Update client/keys/parse.go

Co-authored-by: Marko <marbar3778@yahoo.com>

* linting

* Update docs/architecture/adr-019-protobuf-state-encoding.md

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

* Update docs/architecture/adr-019-protobuf-state-encoding.md

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

* Address review feedback

* Add godocs

* Fix errors

* fix errors

* revert file

* Address review feedback

* Address review feedback

* Stacktrace debug flag

* Fix tests

* Address review feedback

Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-05-19 20:17:29 +00:00
Aaron Craelius 386217209d
Merge PR #6076: Proto Any init + evidence 2020-05-05 10:28:20 -04:00
Alessio Treglia 2414e5bdd4
x/auth: turn sign --validate-sigantures into a standalone command (#6108)
--validate-signatures should not be a flag of the sign command
as the operation performed (transaction signatures verification)
is logically distinct.

cli_test is and has always been an horrible name for package
directory as it's very much Go anti-idiomatic - _test is the
suffix used by test packages, not directories. Plus, CLI test
cases can and should live alongside other testcases that don't
require binaries to be built beforehand. Thus:

x/module/client/cli_test/*.go -> x/module/client/cli/

Test files that require sim{cli,d} shall be tagged with // +build cli_test

With regard to cli test auxiliary functions, they should live in:

x/module/client/testutil/

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-05-04 13:55:16 +00:00
SaReN f92f6c9dd1
Add CLI tests for simd, distribution (#6095)
* Added cli integration base setup

* Added cmd to simapp

* Fixed ci-lint issues

* Fixed ci-lint issues

* Addressed changes in Makefile

* Updated simd to latest

* Removed testnet and replay commands

* Modified tx command for simcli

* Did code cleanup

* Removed duplication in Makefile

* Refactored cli_test

* Added build-sim to Makefile

* Added test-cli to circleci

* Added tests for staking txns

* Addressed format issues

* refctored tests code

* Added tests for send, staking

* Removed test_hepers file

* Moved test_cover to contrib

* Added codec in fixtures

* Migrated tests to respective modules

* Exported helper methods

* Moved helpers to bank

* Added codec to fixtures

* Migrated tests to modules

* Removed auth helpers from staking

* Did minor code cleanup

* Added test-cli to Makefile

* Updated github actions

* Did code refactor

* Fixed github actions for cli-test

* Added tests for recover keys and fee deduction

* Did minor code cleanup

* Added build flag to cli_tests

* Moved cli_test to tests

* Modified path in Makefile

* Updated codec std in fixtures

* Added doc for cli tests

* Remove ibc genesis validation

* Fix issue number

* Added missing imports

* Add tests for distribution and simd

* Modified naming for test functions

* Added test for withdraw rewards

* Modified test function names

* Fixed import format

* Migrated helpers to package cli

* Fixed github test actions

* Fixed test coverage in actions

* Added build sim to actions

* Apply Alessio patch for tests

* Removed unused imports

* Added init for go tests

* try fix tests

* goimports what wasn't goimports'd

* try fix ci

* add relevant tags to integration tests

* run integration tests separately

* use go build -o flag and let compiler gemerate the binary with the
right extension for the HOST platform

rename cli-test to test-integration

* update ci

* rename

Co-authored-by: atheesh <atheesh1>
Co-authored-by: kaustubhkapatral <54210167+kaustubhkapatral@users.noreply.github.com>
Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: anilCSE <anil@vitwit.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-05-01 20:16:17 +00:00
Alessio Treglia a8a455a6f7
Makefiles: various improvements (#6101)
Don't reinstall proto tools unconditionally every time
one runs make.

On most Linux systems, /usr/local is writable by root only.
Allow users to customise installation directory by passing
PREFIX to make command line, e.g.:

 $ make PREFIX=~/.local
2020-04-30 21:30:30 +02:00
SaReN 3b71198b25
Merge PR #6033: Add setup for cli_test 2020-04-29 11:52:30 -04:00
Marko 4b3eb0ea98
ci: migrate long sims (#6084)
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.
2020-04-28 16:13:36 +02:00
Federico Kunze 3ee975c57b
Merge PR #6037: refactor simulation decoder 2020-04-21 17:33:56 -04:00
SaReN 50f81b173b
Add simd and simcli commands (#5998)
Reference: #5951
2020-04-20 15:17:21 +02:00
Alessio Treglia 22f377a858
regenerate mocks, don't format autogenered files on make format (#5848) 2020-03-20 18:14:53 +00:00
Alessio Treglia 3349c971ae
increase types/module coverage up to 80% (#5740)
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-03-03 13:38:46 +00:00
Alessio Treglia 5f14dc2e42
Increase coverage across the store package (#5727) 2020-02-28 23:05:28 +00:00
Alessio Treglia 5a2e59ebb2
Exclude proto files from format (#5706)
* Don't change proto files on make format

The format target does not need to depend on tools.
Thus remove dependency.

* Run make format

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-02-27 07:53:22 -03:00
Marko 32b40fdb27
Merge PR #5669: proto: update tendermint proto files 2020-02-20 11:38:07 +01:00
Marko 56c5868975
Merge PR #5610: proto: migrate x/distr to use hybrid codec 2020-02-11 09:58:37 -05:00
Erik Grinaker 05e40d3ff3
Merge PR #5612: Makefile: remove golangci-lint installation 2020-02-04 13:43:48 -05:00
Alexander Bezobchuk 26d6e49d6a
Merge PR #5491: Protobuf Introduction + Types 2020-01-24 10:32:00 -05:00
Alessio Treglia 394860068d
keyring's encrypted file backend integration (#5355)
Client commands accept a new `--keyring-backend` option through which users can specify which backend should be used by the new key store:
- os: use OS default credentials storage (default).
- file: use encrypted file-based store.
- test: use password-less key store (highly insecure).
2019-12-11 09:45:26 +00:00
Alessio Treglia 9428615c49 Run tests with passwordless keyring (#5332) 2019-11-20 10:42:02 +01:00
Mircea Colonescu 1285782ef6 add docs staging build (#5306) 2019-11-13 12:06:05 +01:00
Alessio Treglia 849e2fb638 Merge PR #5025: Standardize and clean up Makefile
* Attempt to standardise Makefile's conventions

Use check- prefix for test- targets to adhere to
Make's standard naming convention [1].

Snake-case names are abandoned in favor of
kebab-case naming convention.

[1] https://www.gnu.org/prep/standards/html_node/Standard-Targets.html

* Replace check- with test-

* Remove goimports from tools

* Update circleci config

* Update workflow steps names to match Makefile

* Fix circleci config

* s/check_statik/update-swagger-docs/
2019-09-11 08:13:11 -07:00
Alexander Bezobchuk 47ffaa2504
Merge PR #5018: Fix test_sim_multi_seed_long make target 2019-09-09 13:40:33 -04:00
Alexander Bezobchuk 2c4faf983b
Merge PR #5015: Update Makefile runsim targets 2019-09-09 09:54:01 -04:00
Federico Kunze e3e49fc72c Merge PR #5009: remove redundant invariant simapp check 2019-09-06 14:23:40 -04:00
Federico Kunze 45b25ceaae Merge PR #4838: Sim refactor 2 - Move GenesisState generators to modules 2019-08-28 10:58:25 -04:00
mircea-c 450c8ced2c Merge PR #4787: Updated docs build process 2019-08-26 09:09:18 -04:00
Alexander Bezobchuk 42c54f8d0c
Merge PR #4861: Simulation Fixes 2019-08-07 12:54:13 -04:00
Alexander Bezobchuk 451535bd79
Merge PR #4837: Cleanup node_info Endpoint 2019-08-02 11:52:55 -04:00
mircea-c e8ed9302f7 CI configuration refactor (#4776)
* added back the tools targets
* removed ci target
2019-07-25 20:21:42 +02:00
Federico Kunze 8af2230ee4 Merge PR #4731: Save sim params and export app state to file 2019-07-19 18:59:04 +02:00
Alessio Treglia 01d4425658
Remove tools from the repository (#4683) 2019-07-04 15:54:06 +01:00
Alessio Treglia a57915600c
Update golangci-lint (#4636)
Update golangci-lint to latest version.

Remove ci-lint, no longer used.

Remove golangci-lint from tools target to prevent CI builds
from downloading automatically (and unnecessarily).
Developers can still run make golangci-lint to download
it locally for development and testing purposes.
2019-06-28 15:11:26 +01:00
Alessio Treglia 908c5cf4be
R4R: added slack notification to runsim (#4547) 2019-06-26 08:11:42 +01:00
Alessio Treglia 1eb7706c28
Separate account getters from client/context (#4579)
Account getters are removed from client context. x/auth has the
queriers necessary for retrieving account information.
These functions should be removed since they are currently
redundant and don't provide any extra value.

Closes: #4543
2019-06-19 14:24:11 +02:00
Alexander Bezobchuk 5cae008fbe
Merge #4434: Remove draw_deps target 2019-05-29 10:58:28 -04:00
Karoly Albert Szabo c39fa755cb Merge PR #4413: Revert swagger removal 2019-05-28 09:46:26 -04:00
Alexander Bezobchuk 4b872d2eb4
Merge PR #4377: Remove statik/Swagger UI 2019-05-20 11:19:53 -04:00
Alessio Treglia 71d71f2206
Remove gaia (#4347)
Gaia is removed from cosmos-sdk repository.

Few changes were required to make sure no packages depend on gaia subpackages.

CI config is amended accordingly.

Unnecessary targets are removed from Makefile.

Simulations run through a lightweight version of gaia renamed to simapp.

Closes: #4104
2019-05-18 10:42:24 +02:00
frog power 4000 3fe5869148
Merge PR #4159: Module/Genesis Generalization
* first commit

* gaia cleanup

* ...

* staking multihooks

* missing module function return args

* bank module name constant

* working, module interface for x/

* got this thing compiling

* make test compiles and passes

* remove expanded simulation invariants

* genesis issue

* continued

* continued

* register crisis routes thought mm

* begin blocker to mm

* end blocker to mm

* empty routes not initialized

* move gaia initChainer sanity check to baseapp

* remove codecs from module manager

* reorging genesis stuff

* module manager passed by reference/bugfixes from working last commit

int

int

* move invariant checks from gaia to crisis

* typo

* basic refactors cmd/gaia/init

* working

* MultiStakingHooks from types to x/staking/types

int

* default module manager order of operations from input modules

* working

* typo

* add AppModuleBasic

* moduleBasicManager / non-test code compiles

* working attempting to get tests passing

* make test passes

* sim random genesis fix

* export bug

* ...

* genutil module

* genutil working

* refactored - happy with non-testing code in cmd/

* ...

* lint fixes

* comment improvement

* cli test fix

* compile housing

* working through compile errors

* working gettin' compilin'

* non-test code compiles

* move testnet to its own module

* reworking tests

int

* bez staging PR 1 comments

* concise module function-of names

* moved all tests from genesis_test.go to other genutil tests

* genaccounts package, add genutil and genaccounts to app.go

* docs for genutil genaccounts

* genaccounts iterate fn

* non-test code with genaccounts/ now compiles

* working test compiling

* debugging tests

* resolved all make test compile errors

* test debuggin

* resolved all unit tests, introduced param module

* cli-test compile fixes

* staking initialization bug

* code comment improvements, changelog entries

* BasicGaiaApp -> ModuleBasics

* highlevel explanation in types/module.go

* @alexanderbez comment revisions

* @fedekunze PR comments

* @alexanderbez PR comments (x2)

* @cwgoes comments (minor updates)

* @fedekunze suggestions

* panic on init with multiple validator updates from different modules

* initchain panic makes validate genesis fail

int

* AppModuleGenesis seperation

int

* test

* remove init panic logic in validate genesis replaced with TODO

* set maxprocs to match system's GOMAXPROCS

* Update circleci

* Cap maxprocs in CI to 4

* @alexanderbez recent comments addressed

* less blocks in twouble sims

int

* runsim error output flag

* -e on import_export as well

* error out

int

* Try to fix failures

* runsim
2019-05-16 11:25:32 -04:00
Alessio Treglia c0486aa532
R4R: Infrastructure for reproducible builds (#4262)
This change set introduces support for building gaia with gitian
on the following GOOS/GOARCH pairs:

- darwin/386
- darwin/amd64
- linux/386
- linux/amd64
- linux/arm
- linux/arm64
- windows/386
- windows/amd64

cmd/gaia/contrib/gitian-descriptors/ contains gitian descriptor files.

cmd/gaia/contrib/gitian-keys/ contains:
- a keys.txt file that is meant to list core developers and gitian
  builders PGP keys. 
- README.me to provide instructions on how to import the keys
  into one's personal GPG keyring.

The gosum utility is removed, so is the go.sum hashsum bit from
gaiacli/gaiad version string. It was meant to be a provisional
mitigation to the lack of a reproducible build process.

GOBIN is removed from all Makefiles. When GOBIN is set, go
refuses to cross-compiles binaries for foreign architectures.
export GOBIN=$GOPATH/bin is unnecessary anyway as by
default go install places built binaries in $GOPATH/bin.
Developers are required to update their enviornment files and
replace $GOBIN with $GOPATH/bin in PATH.

circleci configuration file is amended accordingly.

Closes: #4027
Closes: #4280
2019-05-14 00:33:34 +02:00