Commit Graph

427 Commits

Author SHA1 Message Date
Aaron Craelius 2e11c81668
Make sdk.Msg implement proto.Message (#6327)
* Make sdk.Msg implement proto.Message

* Cleaning up

* Cleaning up

* Update CHANGELOG.md

* Lint fixes

* Lint fixes

* fix tests

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-06-03 19:52:05 +00:00
Marko 218ec99508
various linter fixes (#6106)
x/staking: Fix all linter warnings.

Fixed warnings across base packages.

New linters:
- unparam
- nolintlint

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-05-02 21:26:59 +02:00
Anton Kaliaev f0b72b93be
server: remove deprecated UpgradeOldPrivValFile (#6079)
* server: remove deprecated UpgradeOldPrivValFile

OldFilePV was deprecated in Tendermint Core v0.28 and will be removed in
upcoming v0.34.5 release.

* remove imports

* Add changelog entries

Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-04-27 16:08:44 +00:00
Alexander Bezobchuk 72a2dae3db
Bump Tendermint v0.33.4 (#6055)
* Bump go.{mod,sum}

* Update APIs from Tendermint

* Add max clock drift to client state

* Test updates

* Update APIs from Tendermint

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-04-22 19:21:48 +00:00
Alexander Bezobchuk 09a55f68b5
Merge PR #5952: Refactor Evidence Age Util + Governable Consensus Params 2020-04-16 11:10:39 -04:00
Alessio Treglia aeee097b2f
spring cleanup (#5991)
* Make format

* Fix golangci-lint warnings

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
2020-04-14 19:13:15 +00:00
Alessio Treglia e8cedf243f
fix all bits broken by viper API changes (#5982)
github.com/spf13/viper's recent releases introduced a semantic
change in some public API such as viper.IsSet(), which have
broken some of our flags checks. Instead of checking whether
users have changed a flag's default value we should rely on such
defaults and adjust runtime behaviour accordingly. In order to do
so, it's important that we pick sane defaults for all our flags.

The --pruning flag and configuration option now allow for a
fake custom strategy. When users elect custom, then the
pruning-{keep,snapshot}-every options are interpreted and
parsed; else they're ignored.
Zero is pruning-{keep,snapshot}-every default value. When
users choose to set a custom pruning strategy they are
signalling that they want more fine-grainted control, therefore
it's legitimate to expect them to know what they are doing and
enter valid values for both options.

Ref #5964
2020-04-14 17:24:27 +02:00
Alessio Treglia a1feca39c2
Enter the new keyring interface (#5904)
crypto/keyring:

`Keybase` interface gives way to its successor: `Keyring`. `LegacyKeybase`
interface is added in order to guarantee limited backward compatibility with
the old `Keybase` interface for the sole purpose of migrating keys across
the new keyring backends.

The package no longer depends on the `github.com/types.Config`
singleton.

`SupportedAlgos` and `SupportedLedgerAlgos` methods have been removed.
The keyring just fails when trying to perform an action with an unsupported
algorithm.

crypto/ subdirs reorganization:

`crypto/keys/hd` was moved to `crypto/hd`, which now groups together
all HD wallets related types and utilities.

client/input:

* Removal of unnecessary `GetCheckPassword`, `PrintPrefixed` functions.
* `GetConfirmation`'s signature changed to take in a io.Writer for better integration
  with `cobra.Command` types.

client/context:

* In-memory keyring is allocated in the context when `--gen-only` flag is passed
  in. `GetFromFields` does no longer silently allocate a keyring, it takes one as
  argument.

Co-authored with @jgimeno

Co-authored-by: Jonathan Gimeno <jgimeno@gmail.com>
2020-04-08 11:38:28 +02:00
Alessio Treglia 2a7a408d35
crypto/keyring: deprecate old keybase (#5889)
Remove the Update method from the Keybase interface.

Remove redundant lazy keybase implementation altogether.

Created LegacyKeybase interface to restrict capabilities to
only those required by keys commands that deal with
legacy keybase such as update and migrate.

Rename keyring.New() -> keyring.NewLegacy().

Rename client/keys.NewKeyBaseFromDir -> NewLegacyKeyBaseFromDir.

crypto/keyiring.NewInMemory() now returns a in-memory keyring.
BackendMemory is added yet not exposed via command line
--keyring-backend flag. keys add uses it when --dry-run flag
is on.
2020-03-30 20:30:50 +02:00
Federico Kunze 9cce836c08
crypto/keys: move keybase and keyring to crypto/keyring/ dir (#5866)
* crypto/keys: move keybase and keyring to crypto/keyring/ dir

* Update client/keys/root.go

* Update crypto/keyring/errors.go

* Update crypto/keyring/keybase.go

* Update crypto/keyring/options.go

* format

* changelog

* fix build

* format

* lint
2020-03-25 15:20:36 +00:00
Alessio Treglia 1d0967c32a
run go mod tidy && make format (#5847) 2020-03-20 17:14:14 +00:00
Alessio Treglia d7fd5b6a42
Replace defer with testing.T.Cleanup() (#5732) 2020-03-02 00:16:23 +00:00
Jonathan Gimeno 60970baf20 update from PR comments 2020-02-28 10:53:56 +01:00
Jonathan Gimeno 3c262306fa add more information into GetPruningOptionsFromFlags 2020-02-28 10:48:34 +01:00
Jonathan Gimeno 0027111db4 fix linter test 2020-02-27 17:29:13 +01:00
Jonathan Gimeno fa3572e300 update start cmd desc 2020-02-27 16:35:13 +01:00
Jonathan Gimeno a21a7faebc update test error lint 2020-02-27 16:33:30 +01:00
Jonathan Gimeno 0c3117b3c7 add godoc into GetPruningOptionsFromFlags 2020-02-27 16:07:24 +01:00
Jonathan Gimeno 9aeefa77d3 update command doc 2020-02-27 16:05:10 +01:00
Jonathan Gimeno 93e3f33461 remove unused error 2020-02-27 16:02:29 +01:00
Jonathan Gimeno 2f55b9d255 change default and fix test 2020-02-27 15:56:07 +01:00
Jonathan Gimeno cfb3819183 add function to get pruning options from flags 2020-02-27 13:40:01 +01:00
Jonathan Gimeno a6cd6554ec extract to function logic to check pruning params 2020-02-27 12:30:24 +01:00
Jonathan Gimeno 0d8dade5e2 add case for none set 2020-02-27 12:18:21 +01:00
Jonathan Gimeno ae14edc900 add pre run command to check for prunning options 2020-02-27 12:01:27 +01:00
Alexander Bezobchuk ec39bb3b42
Merge PR #5696: Fix x/auth proto json tags 2020-02-25 15:22:28 -05:00
Alessio Treglia c77bb7b038
Squash various linter warnings (#5652)
Closes: #5651
2020-02-16 20:06:45 +01:00
Aditya dba80caec0
Merge PR #5579: Fix Restart application issue 2020-02-06 15:58:32 -05:00
Alessio Treglia 415eab7a56
Create new generic keyring constructor: NewKeyring (#5547)
Remove other convenience constructors:
 * Remove NewKeyBaseFromHomeFlag
 * Remove NewKeyringFromDir
 * Remove NewKeyringFromHomeFlag
2020-01-22 17:54:56 +00:00
Alexander Bezobchuk c1991e31bd Merge PR #5527: Bump Tendermint Version to v0.33.0
* Bump Tendermint version to v0.33.0

* Deprecate old cmn package with new packages

* Update update DB APIs

* More DB updates

* Bump IAVL to v0.13.0

* Handle error returned by iavl.NewMutableTree

* Fix some IAVL stuffs

* Update IAVL

* More updates

* Passing tests

* Fix unit tests

Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com>
2020-01-16 13:46:51 -08:00
Sunny Aggarwal f367087731 Merge PR #5439: Keybase: Multiple Signature Algorithms 2020-01-14 10:40:10 -05:00
Alexander Bezobchuk 869531ca92
Merge PR #5495: Replace Redundant Bech32 PubKey Functions 2020-01-09 09:04:28 -05:00
Anil Kumar Kammari a5fc7d6ba6 Merge PR #5367: Regen network/skip upgrade 2020-01-03 09:37:29 -05:00
Alexander Bezobchuk 9a183ffbcc
Merge PR #5421: Refactor Error Handling 2019-12-27 12:57:54 -05:00
Alexander Bezobchuk b862e271a1 Allow node to restart after halt config trigger (#5352)
* Allow node to restart after halt config trigger

* Update godoc

* Update documentation on halt config
2019-12-03 10:24:12 +01:00
Alessio Treglia d4c831e63a Drop on-disk keybase in favor of keyring (#5180)
* Switch keys commands to keyring

* Replace NewKeybase with NewKeyring

* Fix delete test

* Purge dead code

* Override COSMOS_SDK_TEST_KEYRING envvar to switch to a test keyring

* s/unningOnServer/unningUnattended/

C'ing @tnachen

* Add deprecated warning, output looks like the following:

```
$ gaiacli keys update --help
Command "update" is deprecated, it takes no effect with the new keyring
based backend and is provided only for backward compatibility with the
legacy LevelDB based backend.
Refer to your operating system's manual to learn how to change your
keyring's password.

Change the password used to protect private key

Usage:
  gaiacli keys update <name> [flags]

Flags:
  -h, --help   help for update

Global Flags:
      --chain-id string   Chain ID of tendermint node
  -e, --encoding string   Binary encoding (hex|b64|btc) (default "hex")
      --home string       directory for config and data (default "/home/alessio/.gaiacli")
  -o, --output string     Output format (text|json) (default "text")
      --trace             print out full stack trace on errors
```

* Update multisign command

* Modify server.GenerateSaveCoinKey()

* GenerateSaveCoinKey more modifications

* Update docs

* Update upgrade module
2019-11-14 15:17:21 +01:00
Alexander Bezobchuk 8d7cc5e08d
Merge PR #5166: Add pruning constants and fix template 2019-10-09 15:57:12 -04:00
Maciej Krüger 639dad2e15 Merge PR #5090: feat: add pruning config to toml 2019-10-03 14:15:38 -04:00
Alexander Bezobchuk fbdf0e778e
Merge PR #5103: Migration Testing 2019-09-26 09:07:15 -07:00
Marko 01d8a230b2 Merge PR #5068: Add linter Nakedret 2019-09-19 09:21:38 -04:00
Marko 936cffef40 Merge PR #5055: Added Prealloc, Gosec, Golint linters 2019-09-17 12:13:26 -04:00
Marko 6684cdf3e5 Merge PR #5048: Fix linters and add golint 2019-09-16 13:11:17 -04:00
Alexander Bezobchuk c8d84b4df4
Merge PR #5005: Add support for halt-time 2019-09-09 10:08:10 -04:00
Alexander Bezobchuk f010d2c6f1
Merge PR #4748: Write-Through Inter-Block Cache 2019-09-04 13:33:32 -04:00
Alexander Bezobchuk 1cd124a373
Merge PR #4973: Enable CPU Profiling via CLI flag 2019-08-30 11:46:48 -04:00
Marko 3a4f1fc4d4 Merge PR #4881: Linting Galore 2019-08-19 12:06:27 -04:00
colin axner 3eac2707b2 Merge PR #4908: Various goreport fixes 2019-08-15 09:54:10 -04:00
Alessio Treglia 8f51fb39cb Merge PR #4884: Fix standalone execution 2019-08-11 18:42:10 -04:00
Ethan Frey 1f8cdeed55 Merge PR #4724: Allow substore migrations upon multistore loading 2019-08-06 08:59:22 -04:00
Alexander Bezobchuk 861e4798ad
Merge PR #4836: Upgrade Tendermint and IAVL 2019-08-02 09:20:39 -04:00
Alexander Bezobchuk 2a27ebc9ab Merge PR #4767: Sort genesis JSON before printing 2019-07-23 10:00:26 -07:00
Federico Kunze e85a734a57 update x/genaccounts to match module spec (#4759) 2019-07-22 16:26:42 +01:00
Marko b2f8c58ec4 Merge PR #4608: More linters - Gosec, staticcheck 2019-06-26 13:30:36 -07:00
Alexander Bezobchuk 67f6b02118 Merge PR #4541: Events Tracking / Tendermint v0.32.0 Update
* Update Tendermint to v0.32.0-dev0

* Initial refactor of tags

* Update event types and add unit tests

* Refactor context

* Update module manager

* Update result godoc

* Implement ToABCIEvents

* Update BaseApp

* Minor cleanup

* Fix typo

* Update x/bank message handler

* Update x/bank keeper

* Update x/bank

* Update x/bank events docs

* Update x/crisis module events

* Reset context with events on each message exec

* Update x/distribution events and docs

* Update BaseApp to not set empty events manually

* Implement simple event manager

* Update module manager

* Update modules to use event manager

* Update x/gov module to use events

* Update events docs

* Update gov queries and crisis app module

* Update bank keeper

* Add events to minting begin blocker

* Update modules to use types/events.go

* Cleanup x/mint

* Update x/staking events

* Update x/staking events

* Update events to have sender part of message.sender

* Fix build

* Fix module unit tests

* Add pending log entry

* Update deps

* Update x/crisis/types/events.go

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

* Update x/bank/internal/types/events.go

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

* Update x/distribution/types/events.go

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

* Update x/mint/internal/types/events.go

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

* Update x/slashing/types/events.go

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

* Update x/staking/types/events.go

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

* Update x/gov/handler.go

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

* Update x/gov/handler.go

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

* Update x/mint/abci.go

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

* Update x/mint/abci.go

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

* Update x/slashing/handler.go

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

* Update x/staking/handler.go

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

* Update x/slashing/handler.go

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

* Update x/staking/handler.go

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

* Update x/staking/handler.go

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

* Update x/staking/handler.go

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

* Upgrade TM to v0.32.0-dev1

* Update events as strings

* Update Tendermint to v0.32.0-dev2

* Fix BaseApp unit tests

* Fix unit tests

* Bump tendermint version to v0.32.0

* typos
2019-06-26 18:03:25 +02:00
Ethan Frey 3950017bd9 Merge PR #4624: Don't reject config files with create_empty_blocks=false 2019-06-26 08:30:35 -04:00
Alessio Treglia 6672e70556 Merge PR #4603: Increase server package's coverage by adding DONTCOVER 2019-06-20 12:06:03 -04:00
Alessio Treglia 5b78a7bc19 Merge PR #4500: Remove unnecessary auth dependency from the server package 2019-06-06 10:48:01 -04:00
Alessio Treglia e9810ac25c Merge PR #4433: Adopt YAML as human-readable text output 2019-05-31 09:14:34 -04:00
Alexander Bezobchuk 8b1d75caa2
Merge PR #4382: Support height queries for queriers 2019-05-28 20:58:33 -04:00
frog power 4000 73e5ef7c13 reduce module interdependancy, /client refactor (#4415)
* abstract staking BuildCreateValidatorMsg, genutil defines its own flags

* client/ refactor

* staking move keys from keeper to types
2019-05-28 09:44:04 +01:00
Alexander Bezobchuk cfe31c4090
Merge PR #4372: Use Build's Client/Server Name 2019-05-18 19:06:08 -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
Ethan Buchman 77c04202a2 server: run cleanupFunc before Exit (#4324)
Ensure gaiad shutdown Tendermint gracefully upon
receiving SIGINT and SIGTERM.

Closes: #4323
2019-05-11 04:27:11 +02:00
Alexander Bezobchuk c6cb84c558
Merge PR #4059: Add support for graceful halt via server config 2019-04-23 09:33:11 -04:00
Alessio Treglia 85021d4ca9
No packages must depend on cmd/gaia/ (#4048)
Preparation work for moving gaia out of the SDK.
2019-04-04 15:36:39 +01:00
Alexander Bezobchuk dd7de2acaf
Merge PR #3951: Remove ';' delimiting support from ParseDecCoins 2019-03-25 10:38:15 -04:00
Jack Zampolin 57fe79ffbf Merge PR #3804: Update to Tendermint 0.31.0-rc0
* Update tendermint
* Fix build failure
* PENDING
2019-03-05 14:14:34 +01:00
Alessio Treglia 3e82a8bbb8 Merge PR #3792: Use DBBackend set at compile time
* use DBBackend set at compile time

Closes: #3719

* Refresh changelog

* Tweak Makefile
2019-03-04 21:31:55 +01:00
Jack Zampolin b1ce965de8
Merge Pull Request #3777: Fix export panic 2019-03-01 13:04:36 -08:00
Sunny Aggarwal 21bdecafeb Merge PR #3725: Fixed errcheck 2019-02-25 12:35:06 +01:00
Alexander Bezobchuk 26c13b28cd Merge PR #3607: Reconcile DecCoin/s API with Coin/s API 2019-02-15 16:33:23 +01:00
Alessio Treglia e7e3c32204 Merge PR #3553: Code cleanup, take #1
* add a bunch of tests, add DONTCOVER text tag

- Also fix flaky test (closes: #3559). Don't test values
  returned by queries since there's no way to query a
  specific height via REST.

* GetTempDir -> NewTestCaseDir
2019-02-08 22:45:41 +01:00
Juan Leni b5fdb83830 Merge PR #3517: Increasing test coverage in keys/client package 2019-02-08 12:45:23 -08:00
Juan Leni ba63eb1801 Merge PR #3557: Removing pkg/errors when not necessary 2019-02-08 11:37:46 -08:00
Alexander Bezobchuk 7bc837aa06 Merge PR #3555: Reintroduce Fees OR Semantics 2019-02-07 18:14:54 -08:00
Alessio Treglia dff6d0e462 Merge PR #3551: Code cleanup, small coverage boost 2019-02-07 14:38:45 -08:00
Alessio Treglia 9a57ce0214 Merge PR #3514: don't lock keybase on lcd startup 2019-02-06 11:23:49 -08:00
Jack Zampolin c766993c83
Merge PR #3454: Add --jail-whitelist to gaiad export 2019-02-04 08:42:48 -08:00
Joon 08e62fb157 Store Refactor 1 (#2985) 2019-02-01 17:03:09 -08:00
Alessio Treglia ee33d8248e Merge PR #3364: Use dash-separated flags for minimus gas prices 2019-01-24 11:21:02 +01:00
Alessio Treglia 493bbaa537 Merge PR #3360: Remove --json flag from all commands
* remove --json flag from all commands and CLIContext

gaiad tendermint show-{address,validator} now take --machine-parseable/-m
for machine parseable output.

Closes: #3249

* Revert machine-parseable thing
2019-01-24 11:15:44 +01:00
Alexander Bezobchuk 36d1736a08 Refactor Gas/Fee Model (#3258) 2019-01-18 08:45:20 -08:00
Alessio Treglia 145fe81544 Include Block and P2P protocols versions 2019-01-14 13:38:52 +00:00
Alessio Treglia ee9dd2250d Add tendermint version command 2019-01-12 13:52:12 +00:00
Alessio Treglia df567616a9 Upgrade tendermint to 0.28.0-dev0 (#3279) 2019-01-11 09:19:01 -08:00
Hleb Albau 867f8a7467 Merge PR #3195: Configurable pruning. Fix docs and create strategies const. 2019-01-09 16:06:22 +01:00
Alexander Bezobchuk 8211c025da Support min fees in a localnet and fix gaiad config (#3172) 2018-12-20 11:21:39 -08:00
Jack Zampolin 14ebc65daf Merge PR #3119: Move all store keys into constants
* Move all store keys into constants
* Fix lint issue
* Add Pending.md
* QuerierKey -> QuerierRoute
2018-12-19 20:58:30 +01:00
Alessio Treglia 24a1670cf0 Run make format 2018-12-10 14:27:25 +00:00
Jae Kwon d1e76221d8
Jae/simulator improvements (#2900)
* Make simulator operations predetermined
* Use new dbm.ReverseIterator API
* Simulation speed improvements
* Pin exact revisions, not branches
* Rename 'MountStoresIAVL' to 'MountStores'
* Zero Power Block fees to community pool
2018-11-27 00:14:22 -08:00
Christopher Goes ad121f1498 Add a flag to export for zero-height start (#2827)
Closes #2812

This PR adds the flag --for-zero-height to gaiad export, which runs several alterations to the application state to prepare for restarting a new chain in a consistent fashion.

It also:

* Moves Gaia's export code to cmd/gaia/app/export.go for cleaner separation.
* Fixes an inconsistency where we treated the initChainer as happening at height -1 - it should now happen at height 0, since the first header sent by Tendermint has height 1.
* Runs the runtime invariant checks on start (in initChainer)
* Adds a few auxiliary functions to clear slashing periods
* Removes the Height field from Delegation objects in x/stake, which was not used anywhere
2018-11-26 04:21:23 -08:00
Alexander Bezobchuk 6e813ab3a8 Change gas & related fields to unsigned integer type (#2839)
* Change gas & related fields to unsigned integer type
* Implement AddUint64Overflow
2018-11-19 09:13:45 -08:00
Alessio Treglia 815a6de82f R4R: Remove AppInit (#2801)
* Remove AppInit
* Update PENDING.md
2018-11-15 10:01:19 -08:00
Christopher Goes 17b9afaaa7 Export specific height 2018-11-14 18:23:20 -08:00
Alexander Bezobchuk 811b863677 Use correct Bech32 prefix for show-address command (#2746)
* Use consensus address bech32 prefix
* Update show-address CLI description
2018-11-11 23:34:50 -08:00
Hendrik Hofstadt 61fd142b9e Fix TimeoutCommit (#2743)
* Fix TimeoutCommit to 5 seconds instead of whatever it was before which was too short.
2018-11-09 16:08:35 -08:00
Alessio Treglia c20fcbfd8f New genesis workflow (#2602)
New genesis workflow:
* `gaiad init` is now used to generate an empty `genesis.json`.
* Genesis accounts need to be populated manually before running
  `gaiad collect-gentxs`.
* This should support starfish too, see #2615 for more info.
* Closes: #2596 #2615
* Validate validator address and address against respective account ex ante
* Fix local testnet failures
* New genesis tests
* Run make format
* Add --pubkey flag
* gaiad collect-gentxs takes no args
2018-11-04 20:26:46 -08:00
Alexander Bezobchuk 50926fffff Update to TM v0.26.0 - Part I (#2679)
* Update to TM v0.26.0
2018-11-04 18:28:38 -08:00
Alessio Treglia 36bb4409b6
Refactor TrapSignal 2018-11-02 13:44:40 +00:00
Sunny Aggarwal d666658ca9 Merge PR #2553: Renamed msg.Name() and msg.Type() to msg.Type() and msg.Route() 2018-10-23 21:23:55 +02:00
Cong Zhao 6c623b203e #1255 make keybase opened with readonly option to support better parallelization between gaiacli 2018-10-20 20:26:15 +08:00
Alessio Treglia 593921d04d Merge PR #2524: Replace GenTx with StdTx
Rework the process of loading a genesis.json file to load a starting app state and set of initial transactions to process.

* New function to create genesis account from MsgCreateValidator
* Add arg to PrintUnsignedStdTx() to actually operate in offline mode
* New func processStdTxs()
* Remove gen-tx command
* Cleanup, return validators as they need to be written into genesis.json
* Modify gaiad init to allow auto-create of stdTx
* Remove server/testnet.go
* Don't load node_key.json, which might not be available
* Get the txs through DeliverTx
* Add app.slashingKeeper.AddValidators at the end of genesis
* On InitChain(), Signature's account number must be 0
* Add (tentative?) command to generate {node_key,priv_validator}.json files
* Reintroduce gaiad testnet
* Prompt user for passwords
* Update gaia to work with auth.StdTx
* Remove test_utils, NewTestGaiaAppGenState is now deprecated
* Combine --genesis-format and --generate-only
* Improve sign command's --offline flag documentation
* Moniker must be set
* Call app.slashingKeeper.AddValidators() even if len(txs) == 0
* Refactoring, introduce gaiad init --skip-genesis, code cleanup
* Drop unnecessary workaround to make lcd_tests pass
* Reintroduce gentx
* Simple name changes, GenesisState.Txs -> .GenTxs; OWK -> OverwriteKey; OverwriteKeys -> OverwriteKey
2018-10-19 20:00:27 +02:00
Alessio Treglia 0f4a03b44e Alessio/server refactor (#2472)
* Add arg to PrintUnsignedStdTx() to actually operate in offline mode
* WIP simplifying server module
* Expose ExternalIP()
* Move {GenTx,Init}Cmd into gaia's new init package
2018-10-10 15:45:41 -07:00
Christopher Goes 17983460b8
Merge PR #2219: Update to Tendermint 0.24 (except NextValSet offsets) 2018-10-03 17:48:23 +02:00
Alessio Treglia b74a6a9066 Merge PR #2328: Support min fees-based anti spam strategy 2018-09-19 23:25:52 +08:00
Dev Ojha 65137f6331 Merge PR #2343: Add a name field to the message type
This is to facillitate ease of implementing #1406. (Tags for messages
could then be added dynamically)

Ultimately once we make the router support hiearchical routing, (#770)
we can then remove the name field and just the parse info for tags from that.

Until then, we can parse the tag name as
`fmt.Sprintf("%s %s", msg.Type(), msg.Name())`
2018-09-17 22:34:06 +08:00
Dev Ojha 6b55093c75 Merge PR #2324: rename wire to codec
* rename wire to codec

* fix formatting and cli

* fix the docs
2018-09-13 14:17:32 -04:00
philipstanislaus 8682556fad Merge PR #1993: Add optional flag to `gaiad testnet` to make config directory of daemon and cli configurable 2018-09-12 16:02:03 +08:00
Dev Ojha 2a49406e9b Merge PR #2284: Prevent create_empty_blocks=false 2018-09-11 17:15:38 +08:00
Jeremiah Andrews 2378e3431c Fix linter errors 2018-09-03 07:58:57 -07:00
Christopher Goes 1204857694 Merge PR #2122: Implement slashing period
* Update PENDING.md

* SlashingPeriod struct

* Seperate keys.go, constant prefixes

* Make linter happy

* Update Gopkg.lock

* Seek slashing period by infraction height

* Slashing period hooks

* Slashing period unit tests; bugfix

* Add simple hook tests

* Add sdk.ValidatorHooks interface

* No-op hooks

* Real hooks

* Fix iteration direction & duplicate key, update Gaia

* Correctly simulate past validator set signatures

* Tiny rename

* Update dep; 'make format'

* Add quick slashing period functionality test

* Additional unit tests

* Use current validators when selected

* Panic in the right place

* Address @rigelrozanski comments

* Fix linter errors

* Address @melekes suggestion

* Rename hook

* Update for new bech32 types

* 'make format'
2018-08-31 20:01:23 -04:00
Christopher Goes 03f79ef744
Merge PR #2192: Split LCD implementation PR, part one 2018-08-31 18:41:24 +02:00
Alexander Bezobchuk 2d92803b9f Merge PR #2040: Refactor Validator Account Types/Bech32 Prefixing
* Add new account bech32 prefixes with godocs

* Restructure spacing of existing account code

* Update account godocs

* More account godoc updates + new tm pub/addr helpers

* Update validator type to use new account types/bech32 prefixes

* Fix account documentation errors

* Update Bech32 prefix for consensus nodes

* Update Bech32 spec doc

* Fix account type tests

* Add missing account consensus functions, clear up godocs, and fix tests

* Add to TestRandBech32PubkeyConsistency check

* Update initialization of validator public keys

* Update query signing info command

* Implement new ConsAddress type with associated unit tests

* [WIP] Update stake and slashing parameters

* Update all calls to MustBech32ifyValPub

* [WIP] Validator operator API updates

* [WIP] Fix and update unit tests

* Fix gov logs (helping to debug failing tests)

* Fix gov tally

* Fix all broken x/ unit tests

* Update gaia app genesis address logic

* Fix linting errors

* Fix broken LCD tests

* Fix broken CLI tests

* Implement command to get validator address and pubkey from key name

* Add support for getting validator key information via REST endpoint

* Update PENDING log

* Update docs

* Revert GaiaGenTx.PubKey bech32 prefix

* Fix broken docs and cli tests

* Update genesis to use correct Bech32 (cons) prefix for pubkeys

* Update docs and unit tests to reflect new cosmos account bech32 prefix

* minor formatting
2018-08-31 00:06:44 -04:00
Matthew Slipper dc0f13214d Merge PR #2170: Add show-address command
* Add show-address command

Closes #1274.

* Add PENDING entry

* Add godoc

* Updates from code review
2018-08-30 21:38:28 -04:00
Matthew Slipper 03c56fc024 Merge PR #2190: Rename --gen-txs to --with-txs
* Rename --gen-txs to --with-txs

Closes #1088.

* Update CHANGELOG.md
2018-08-30 21:33:48 -04:00
HaoyangLiu 3f83aca599 IRISHUB-238: fix test_lint failures in client/lcd/root.go and server/ 2018-08-30 16:24:56 +08:00
Matthew Slipper 2146450aaa Fix export segfault
Closes #1834
2018-08-24 02:24:00 -07:00
Rigel a54e3a3fc4
Merge branch 'develop' into cli-updates 2018-08-21 23:44:57 -04:00
Matthew Slipper 5ce9b9af5a Merge PR #2015: Change gaiad testnet example output flag
Closes #1960.
2018-08-21 23:28:16 -04:00
Matthew Slipper 0c0d282a0c Add plaintext flags to show keys; default print response to true; helptext updates
Closes #1970
Closes #1971
Closes #1967
Closes #1969
2018-08-21 15:36:53 -07:00
Matthew Slipper 8fa2c3b4ea Merge PR #1984: Replace _ with - in command names
Closes #1955
2018-08-14 10:23:42 +02:00
Dev Ojha b2a4aecc44 Upgrade to tm version 23.0. (#1927)
* Start upgrade. Currently go test ./... hangs.

* (squash this) Fix staking tests

* wip

* note what changes need to be made to make this work on tm v0.23.0

* Fix addr -> pubkey map

* cleanup code

* Fix slashing test failures except for begin blocker

* fix all slashing tests

* fix lcd tests

* Address PR comments

* add link to changelog.

* (wip) start making addrToPubkey map persisted. Since amino can't handle maps,
we have to change from what this commit is doing.

* Use the correct method of storing a map

* (squash this) address PR comments

* Did you run 'make'?

* remove gaiadebug binary
2018-08-12 03:33:48 -04:00
Alessio Treglia 831435ccc0 Merge PR #1948: enable indexing of all tags by default 2018-08-10 15:40:21 +02:00
Joon d46140a392 Merge PR #1481: Transient Stores 2018-07-27 03:24:18 +02:00
rigelrozanski ee47b3b1ca rollback changes which break gen-tx 2018-07-25 16:57:33 -04:00
Aditya Sripal 48885b4093 merge 2018-07-19 11:38:44 -07:00
Joon aa525418e1 Merge PR #1373: Initialization of POS chain 2018-07-19 08:39:40 +02:00
Aditya Sripal 218c9b3702 Merge branch 'develop' of https://github.com/cosmos/cosmos-sdk into aditya/cleanup 2018-07-18 17:48:15 -07:00
Aditya Sripal 81f3e794fe make breaking changes 2018-07-18 16:24:16 -07:00
Ethan Buchman 972b8f5d6d
Merge pull request #1690 from cosmos/release/v0.22.0
update params for x/gov and default config
2018-07-16 19:46:26 +01:00
Ethan Buchman 8f453eaa04 update params for x/gov and default config 2018-07-16 17:43:10 +01:00
Ethan Buchman f4ee940989 update to tm0.22.4-rc0 and bring back lcd test 2018-07-14 19:47:42 +01:00
Christopher Goes 78edba82c0
Merge PR #1648: Write moniker on 'gaiad init' and 'gaiad init gen-tx'
* Write moniker on 'gaiad init' and 'gaiad init gen-tx'
* Update changelog
* Add comment to second instance
* Checkout Gopkg.lock
2018-07-13 19:16:31 +02:00
Jeremiah Andrews 43b9cc6df0 Merge PR #1533: Pruning Cleanup 2018-07-13 03:20:26 +02:00
Alexander Bezobchuk 5983a07fb6 Merge PR #1599: Implementation of TraceKVStore 2018-07-13 01:58:51 +02:00
Christopher Goes 5a56c3f03d
Merge PR #1575: ready-for-review: sdk.AccAddress natively bech32 2018-07-10 04:18:23 +02:00
ValarDragon 592419c83a Reduce code complexity of testnet command 2018-07-09 15:29:16 -07:00
ValarDragon 2b5ccdbf87 Reduce code complexity in AnteHandler, and GetExternalIP 2018-07-09 15:29:16 -07:00
Sunny Aggarwal 25d976feb4 works? 2018-07-09 01:47:38 -07:00
sunnya97 7ac220beb6 asdf 2018-07-09 00:59:51 -07:00
ValarDragon 611e4faa3a gaiad: Genesis txs now use bech32 encoding of address and pubkey
* `gaiad init gen-tx` makes the outputted file use bech32, with acct prefix
* `gaiad init --gen-txs` only reads bech32 with acct prefixes

The reason for using the account prefix is that in principle you could
have genesis transactions for non-validators.

Closes #1475
2018-07-07 14:23:19 -07:00
Ismail Khoffi abce54ea60
Merge branch 'develop' into sort_getsignbytes 2018-07-06 01:31:34 +01:00
Liamsi b7f902fba5 sort *all* GetSignBytes:
- call MustSortJSON before return JSON bytes to guarantee alphabetic
ordering

- moved SortJSON and MustSortJSON to types package to avoid cyclic
package dep
2018-07-06 01:12:57 +01:00
Christopher Goes 66fdb9585b Gopkg.lock & 'make format' 2018-07-06 02:09:33 +02:00
Christopher Goes 908fb39a65
Merge PR #1559: Fix genesis JSON key ordering
Inconsistent Genesis Generation Key Order
2018-07-05 23:05:05 +02:00
Liamsi 28245dba90 adhere to golint 2018-07-05 19:18:48 +01:00
Aleksandr Bezobchuk 51fdc9db2f Merge pull request #1559: Inconsistent Genesis Generation Key Order 2018-07-05 14:15:00 -04:00
Liamsi 97182dce21 Add test-cases, remove indentation 2018-07-05 19:10:35 +01:00
Liamsi 547390a238 WIP: add simple sorting using golang json.Marshal 2018-07-05 17:11:44 +01:00
Ethan Buchman d388036454 Merge PR #1520: various fixes for test_cli
* various fixes for test_cli
* linting
2018-07-03 06:33:53 +02:00
Aleksandr Bezobchuk e3e58435eb Merge branch 'develop' into bez/1269-basecoind-start-failure 2018-07-02 18:59:34 -04:00
Aleksandr Bezobchuk 61ce80135a Merge pull request #1509: Fix basecoin Example 2018-07-02 18:46:12 -04:00
Ethan Buchman f78f30c67a update for tm v0.22.0. tmlibs->tendermint/libs 2018-07-02 16:34:06 -04:00
Ethan Buchman 0845d8126e server: remove broken start test 2018-07-02 14:47:58 -04:00
Dev Ojha 955a0c9af7 Switch asserts to require (#1483)
* meta: Switch the majority of asserts to require

Switch most assert statements to require, to ease debugging.
Closes #1418

* Fix imports
2018-06-30 03:10:15 +02:00
Dev Ojha 097dd8a164 tools: Add unparam linter (#1443)
* tools: Add unparam linter

unparam detects unused parameters in functions, and a parameter to
a function which only ever takes on one value. The latter is an
indication that more tests are required.

There are many nolints in this PR, as I believe that writing tests
to fix alot of these situations is out of scope for this PR / it
will be changed in future commits. There are some nolints for
when we have to comply to normal api's.

* crypto/keys no longer used by x/gov/client/rest/rest.go
2018-06-29 18:22:24 -04:00
Christopher Goes 59aadf42aa
Ledger integration (#931)
Merges the keybase and Ledger code from go-crypto (which is no more) into the SDK
Adds support for Ledger into gaiacli
Cherry-picks updated error handling from #1158
2018-06-29 02:54:47 +02:00
Dev Ojha ac3adff1e8 Merge PR #1438: Tools: Add errcheck linter
This linter ensures that all errors are checked.
This is disabled in the client directories, since its not needed on
those writes
2018-06-29 00:52:10 +02:00
Dev Ojha eb097c4c5c Merge PR 1361: server: Use differing defaults from tendermint
When loading the config file, this now checks in the sdk if the file
already exists. If not, it writes a config with different defaults.
The defaults differ by having the profiler listen address set,
and increasing the receive / send rates.
2018-06-25 18:33:07 +02:00
Aditya f049a56376 Merge PR #1266: Multiple messages
* Started work on multiple msgs, types and x/auth tests pass
* Fix issues in x, examples, and baseapp
* Added baseapp tests for multiple msgs
* Documentation fixes
* Fix baseapp tests with sdk.Int
* Modify test
* Transaction handling is now atomic
* Fix test comment
* Minor doc fixes and code cleanup
* Added baseapp result changes
* Use address in validator update accumulation
* Started work on multiple msgs, types and x/auth tests pass
* Fix issues in x, examples, and baseapp
* Added baseapp tests for multiple msgs
* Documentation fixes
* Fix baseapp tests with sdk.Int
* Modify test
* Transaction handling is now atomic
* Fix test comment
* Minor doc fixes and code cleanup
* Added baseapp result changes
* Use address in validator update accumulation
* Added ante tests for multisigner
* Remove validatorUpdates from tx result
* Better error logs
* Put Memo in StdSignBytes and formatting
* Updated changelog
2018-06-22 00:05:25 +02:00
Joon 3fa68249eb Merge PR #1254: Add prefixstore and lib refactor
* Merge pull request #1254: add prefixstore and lib refactor
add prefixstore
refactor lib
fix test
fix linter
in progress
in progress
add test for prefixstore
add KVStoreGetter, PrefixStoreGetter
move PrefixStoreGetter to types/
add tests
KVStore.Prefix(string) -> KVStore.Prefix([]byte)
fix mock
apply requests
pass lint, add test
apply requests
* Remove unnecessarily 'valid' boolean
2018-06-21 23:33:36 +02:00
Christopher Goes 918e217e1f
Merge PR #1280: Implement simple transaction memos
* AltBytes -> Memo, memo CLI support & thread-through
* Check memo size, update changelog
* Update existing testcases
* Nuke CircleCI caches
* Charge gas proportional to memo size
* Fix gas allocations in ante handler testcases
* Add testcases
* Update changelog
* Fix tiny CLI bug & add to CLI tests
* Add '--memo' to gaiacli
* Add testcase for large memos
* Address PR comments
2018-06-20 21:27:36 +02:00
Dev Ojha 1f88b0bf8f Merge PR #1281: Don't run defers if it would result in an NPE
* Don't run defers if it would result in an NPE
* Nuke CircleCI caches
2018-06-16 09:49:55 +02:00
Greg Szabo f8290a0fc3
Merge branch 'develop' into greg/testnet-command-2 2018-06-14 11:34:26 -07:00
Greg Szabo 17e88a5e00 Fixes requested by Rigel: GenTx, config package name 2018-06-13 17:30:16 -07:00
Dev Ojha bd362ee590 Merge PR #1090: Switch away from ephemeral ports
* Switch ports 4665x to be 2655x
This is done so the default ports aren't in the linux kernel's default ephemeral port range.
* Missed one doc file, change dep so gaiad works
* Update changelog, fix Gopkg.lock
2018-06-14 00:13:51 +02:00
Dev Ojha 0fa28cac3b Merge PR #1248: Sync to tendermint develop's latest revision 2018-06-13 23:44:41 +02:00
Greg Szabo bc206c315c
Merge branch 'develop' into greg/testnet-command-2 2018-06-13 12:30:51 -07:00
David Kajpust ec2fedd36c Merge PR #1227: Set all Error strings 1st letters to lowercase. Fixes issue #1154 2018-06-13 21:13:22 +02:00
Christopher Goes 8753d6d59a
Revert "Merge PR #1228: Update to Tendermint develop" (#1231)
This reverts commit 1c8dbd1087.
2018-06-13 07:25:14 +02:00
Dev Ojha 1c8dbd1087 Merge PR #1228: Update to Tendermint develop 2018-06-13 06:42:52 +02:00
Greg Szabo 4c5e536b31 Added testnet command and localnet targets
Finished testnet command and introduced localnet targets in Makefile, together with gaiadnode Docker image

Fixed function parameter list - now starts with ctx

Separated GenTxConfig into a server/config package so both the server package and the mock package can use it

Adding server/config to app package

gaiadnode Docker image

Separated GenTxConfig into a server/config package so both the server package and the mock package can use it

Adding server/config to app package

Fixes requested by Rigel

Removed commented code

Global flag fixes
2018-06-12 11:25:03 -07:00
Ethan Buchman a277ba91c7 Merge PR #1178: Merge master (Tendermint updates)
* update to tm v0.19.6
* update tm to 0.17.4
* update for tm v0.19.9
* update godep
2018-06-09 06:34:27 +02:00
rigelrozanski b5d847288d move original mock into server 2018-06-07 21:33:06 -07:00
Christopher Goes 3fbee11ccc
Merge PR #1142: Export validators to genesis
* Validator export skeleton
* Update export command, add tests, update CHANGELOG
* Rename exportAppState to exportAppStateAndTMValidators
2018-06-06 18:38:13 +02:00
Zaki Manian ce850dca3b Switch from bech32cosmos to bech32 2018-06-01 16:23:58 +02:00
rigelrozanski 34686e8d61 unsafe_reset_all back to root 2018-06-01 01:35:39 -07:00
rigelrozanski 7ce9e000b6 update changelog, minor update 2018-06-01 00:53:54 -07:00
Jeremiah Andrews 744f78573e small fixes 2018-05-31 21:50:01 -07:00
Jeremiah Andrews 083ca8234b Refactored gaiacli and gaiad commands into subcommands 2018-05-31 21:50:01 -07:00
rigelrozanski 5515b60b0a better tooling for cli, couple lsd fixes 2018-05-31 18:46:25 -07:00
Zaki Manian a163a3558f Use public keys consistently for validators and all addresses are for accounts 2018-05-27 14:21:15 +02:00
Zaki Manian f33f49a840 Almost from scratch reimplementation of bech32cosmos integration. 2018-05-27 13:47:23 +02:00
Zach Ramsay d6708a40e8 gaiad: don't print command twice 2018-05-15 18:30:06 -04:00
rigelrozanski d2163017ce small efficiency increase 2018-05-14 09:39:29 -04:00
Adrian Brink 878a53bf0d
Prevent --gen-txs from failing silently
Instead of just failing silently if there is a non .json file or folder
in the gentx/ directory it now just skips that file or directory.

ref #940
2018-05-13 18:24:48 -04:00
Adrian Brink cd24244308
Sort all genesis transaction by node id
This ensures that users can rename the genesis transactions and they
will still be in the same order.
2018-05-13 18:19:42 -04:00
Christopher Goes 12ebad49e2
Export all genesis information (closes #946) 2018-05-07 01:01:01 +02:00
rigelrozanski 318e924145 refactor 2018-04-27 20:36:11 -04:00
rigelrozanski 10ddd7a3d3 refactor export function, working 2018-04-27 20:06:50 -04:00
Christopher Goes 10d2e5ae40 Move generateApp & exportApp to baseapp/helpers 2018-04-27 20:04:29 -04:00
Christopher Goes df4fdb3642 Rebase & merge changes 2018-04-27 20:03:43 -04:00
Christopher Goes f92e83d2e0 Swap to general `export` command 2018-04-27 20:02:26 -04:00
rigelrozanski 0f28f6738a updated some testnet docs, gen-txs now in the config folder 2018-04-26 15:52:20 -04:00
rigelrozanski ade42e74b7 better init test 2018-04-26 14:26:39 -04:00
rigelrozanski 05c5809bae gaia init automatic key processing 2018-04-26 14:26:39 -04:00
rigelrozanski d1c6216c0f gen-tx fix 2018-04-26 14:26:39 -04:00
rigelrozanski b9477ecbbe init refactor uses genesis transaction now 2018-04-26 14:26:39 -04:00
rigelrozanski 12f20d160a interim gen app tx refactor 2018-04-26 14:26:39 -04:00
rigelrozanski 4049c5d24f cwgoes comments, bug fix 2018-04-26 14:26:39 -04:00