Commit Graph

455 Commits

Author SHA1 Message Date
Christopher Goes 94f45311a0 Fix state export/import, add to CI (#2690)
* Update slashing import/export
* More slashing.WriteGenesis
* Add test import/export to CI
* Store equality comparison.
* Fix validator bond intra-tx counter
* Set timeslices for unbonding validators
* WriteGenesis => ExportGenesis
* Delete validators from unbonding queue when re-bonded
* Hook for validator deletion, fix staking genesis tests
2018-11-08 16:28:28 -08:00
Christopher Goes 256ec0f07b Simulation improvements (logging fix, random genesis parameters) (#2617)
* Print out initial update on every block
* Randomize simulation parameters
* Randomize initial liveness weightings
* Randomize genesis parameters
* fixed power store invariant
* IterateValidatorsBonded -> IterateBondedValidatorsByPower
* WriteValidators uses IterateLastValidators rather than IterateBondedValidatorsByPower
* fixed democoin interface

Closes #2556
Closes #2396

Via #2671:
closes #2669
closes #2670
closes #2620

Offshoot issues:
#2618
#2619
#2620
#2661
2018-11-04 20:44:43 -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
svaishnavy 9cf53f25f7 Merge PR #2614: Configurable Bech32 prefix for SDK users 2018-10-31 20:13:13 +01:00
Federico Kunze 855e0ac70a Merge PR #2596: Cmds for validator unbondings and redelegations 2018-10-28 22:28:12 +01: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
Jack Zampolin 322d0b7087 Fix typo in json output for basecoin and democoin 2018-10-22 15:35:08 -07:00
Alessio Treglia 6014089fa1
Rename AccountMapper to AccountKeeper
Closes: #2540
2018-10-20 23:22:48 -07: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
rigelrozanski dba20d1725 Merge remote-tracking branch 'origin/develop' into rigel/fee-distribution 2018-10-12 06:06:24 -04: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
rigelrozanski 45f0dd0e3b Merge remote-tracking branch 'origin/develop' into rigel/fee-distribution 2018-10-04 18:33:12 -04:00
HaoyangLiu 9f67e8af20 Merge PR #2215: Add swagger-ui for gaiacli lite-server 2018-10-04 13:00:24 +02:00
Christopher Goes 17983460b8
Merge PR #2219: Update to Tendermint 0.24 (except NextValSet offsets) 2018-10-03 17:48:23 +02:00
Jae Kwon 1e26ba2e0e
CLIContext.Logger -> .Output as it isn't a logger (#2420)
This changes .Logger to .Output, as it isn't used anywhere except as os.Stdout.
2018-09-28 21:45:54 -07:00
rigelrozanski 436d2a0178 Merge remote-tracking branch 'origin/develop' into rigel/fee-distribution 2018-09-27 22:48:16 -04:00
rigelrozanski 0436f50c00 ... 2018-09-27 19:54:41 -04:00
Dev Ojha 7d5bc459fa Merge PR #2413: Remove reflection from handlers 2018-09-27 05:04:06 +08:00
Alexander Bezobchuk 91cac96fea Merge PR #2391: LCD Cleanup and DRY Refactor 2018-09-26 21:29:39 +08:00
rigelrozanski 380d3e1c5a pull a bunch from develop 2018-09-25 17:43:26 -04:00
Rigel 6b595842ed Distr-PR-1 Staking ConsPubKey -> ConsAddr index (#2369)
* pulling in stuff from fee-distr PR
* revert some gov changes
* fix using cons address, also remove old commented distr code
* doc update
* val comments
* remove GetValidatorByConsPubKey
2018-09-24 21:09:31 -07:00
rigelrozanski 0d9105cf7c ... 2018-09-20 20:10:26 -04: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
Rigel 5bf9401e87
Merge PR #2310: staking transient store for Tendermint Updates
* working

* non-tests compile

* fix mounting error, working on testing

* stumped using transient store

* joon comments

* remove old comments

* resolve ibc error

* lint/sim_test

* fix determinism sim test

* sim enable commit

* docs and pending
2018-09-13 00:53:55 -04:00
Dev Ojha 358b48771c Merge PR #2308: Remove ripemd160 entirely
* Remove ripemd160 entirely

We already made this decision awhile ago, and have had tendermint switched
for awhile. I was surprised to find ripemd still used within the storeinfo.
This actually leads me to think the new "byter" API change in the tendermint
PR RFC compliance is better, as it avoids things like this from ever happening.

* Get ripemd160 removed from the gopkg imports
2018-09-12 15:13:14 +08:00
Alexander Bezobchuk e13cdc0260 Merge PR #2146: x/bank: Keeper Interfaces
* Update banking module to implement and use keeper interfaces

* Cleanup/consolidate x/bank keeper interface
2018-09-10 14:25:34 -04:00
ValarDragon e812919649 Rename coinKeeper -> bankKeeper
Closes #2267
2018-09-07 22:34:32 -07:00
Jae Kwon 6325441861 txBld -> txBldr 2018-09-07 10:15:49 -07:00
Jae Kwon acd125029d x/auth/client/context -> x/auth/client/txbuilder 2018-09-07 10:04:58 -07:00
Alessio Treglia 54b3b5c028
sed -i 's/txCtx/txBld/g' 2018-09-07 14:39:23 +01:00
Alessio Treglia 3b6da7af18
TxContext -> TxBuilder 2018-09-07 14:36:21 +01:00
Jeremiah Andrews 2378e3431c Fix linter errors 2018-09-03 07:58:57 -07:00
Christopher Goes e1981d47e3
Merge PR #2181: Implement a simulate-only CLI flag/field for REST endpoints 2018-08-31 22:35:52 +02:00
Rigel b92ac313ac
Merg PR #2198: Ensure Legacy Validator Delegation Invariants
* Test and allow jailed validator to self-bond

* Implement TestJailedValidatorDelegations

* Restructure TestJailedValidatorDelegations

* Add Delegation to Validator type and update handleMsgUnjail accordingly

* Update ErrMissingSelfDelegation error message

* Update democoin mock validator set impl

* Update pending log

* Add comment to ValidatorSet

* Fix conflicts/errors due to develop merge
2018-08-31 15:21:12 -04:00
Alessio Treglia 599923fb99
Introduce simulate mode
Add a simulate only flag '--dry-run' to both CLI tx commands
and RESTful endpoints to trigger the simulation of unsigned
transactions.

* Turning --dry-run on causes the --gas flag to be ignored.
  The simulation will return the estimate of the gas required
  to actually run the transaction.
* Adjustment is no longer required. It now defaults to 1.0.
* In some test cases accounts retrieved from the state do not
  come with a PubKey. In such cases, a fake secp256k1 key is
  generated and gas consumption calculated accordingly.

Closes: #2110
2018-08-31 19:04:11 +02:00
Rigel ee0434e5a7
Revert "Merge PR #2176: Ensure Legacy Validator Delegation Invariants" (#2197)
This reverts commit df33452490.
2018-08-31 00:55:33 -04:00
Alexander Bezobchuk df33452490 Merge PR #2176: Ensure Legacy Validator Delegation Invariants
* Test and allow jailed validator to self-bond

* Implement TestJailedValidatorDelegations

* Restructure TestJailedValidatorDelegations

* Add Delegation to Validator type and update handleMsgUnjail accordingly

* Update ErrMissingSelfDelegation error message

* Update democoin mock validator set impl

* Update pending log

* Add comment to ValidatorSet
2018-08-31 00:10:51 -04: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
Christopher Goes f8f97f7bd0
Merge PR #2124: Simple integration tests for {base,demo}coind 2018-08-23 13:56:32 +02:00
Alessio Treglia 56a98cb047
Simple integration tests for {base,demo}coind
Closes: #1632
2018-08-22 18:17:15 +01:00
Christopher Goes 879f78cfc0 Rename revoke(d) to jail(ed) 2018-08-22 17:56:13 +02:00
Christopher Goes 7b8c1c0e80
Merge branch 'develop' into fix-iterator-leak 2018-08-22 16:06:35 +02:00
Federico Kunze cfb5acca6e Merge PR #2099: Query staking Pool and Params 2018-08-21 17:32:54 +02:00
youjing 517682f17c fix Iterator leak, ref to https://github.com/cosmos/cosmos-sdk/issues/2105 2018-08-21 14:54:12 +08:00
Max Levy bce09055b2 Merge PR #2058: comment fix
An outdated comment fixed to be less confusing.
2018-08-16 16:56:15 -04:00
Alessio Treglia 187bc1972a Merge PR #1950: Validator.Owner -> .Operator
* Rename --address-validator flag to --validator

See #1901

* Update PENDING.md

* Rename Validator.Owner -> Validator.Operator

See #1901
2018-08-16 16:47:59 -04:00
Max Levy a4bcbc972e Merge PR #2036: Update examples to bech32
Using the addresses in Bech32 form
2018-08-15 12:04:16 +02:00
Rigel d9dc061b4f
Merge pull request #1819: rational -> decimal
* changelog

* ...

* decimal func working

* decimal complete, untested

* fixing tests

* decimal compile errors resolved

* test compile errors

* precision multiplier test

* 1% laptop battery

* fixed TestNewDecFromStr

* equalities working

* fix bankers round chop

* ...

* working, some decimal issues resolved

* fix rounding error

* rounding works

* decimal works

* ...

* deleted rational

* rational conversion working

* revert changelog

* code compiles (not tests)

* went through all NewDec, made sure they were converted from NewRat properly

* test debugging

* all testing bugs besides the json marshalling fixed

* json unmarshal

* lint

* document update

* fix lcd test

* cli test fix

* mostly undo Dece -> Rate

* val comments

* Efficiency improvements

This now caches all of the precision multipliers (as they were all
used in non-mutative functions), and caches the precisionInt calculation.
(Now it just copies the already calculated value)

* Cache another precisionInt() call.

* Improve banker rounding efficiency

* remove defer, make negation in-place.

* chris val comments

* bez comments

* Aditya comments

* ...

* val comments

* rebasing start

* ...

* compiling

* tests pass

* cli fix

* anton, cwgoes, val comments

* val and jae comments

* type

* undo reuse quo
2018-08-14 20:15:02 -04:00