Commit Graph

25 Commits

Author SHA1 Message Date
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 41fc538ac7 Add Safety Measures to Coin/Coins (#2797) 2018-11-20 01:22:35 -08:00
Sunny Aggarwal 8d6b0929fb Codespaces as Strings (#2821) 2018-11-16 09:12:24 -08:00
Christopher Goes 3f59cf1517
Merge branch 'develop' into cwgoes/fix-signing-info-bugs 2018-10-16 19:23:57 +02:00
Christopher Goes 2c4d9a0be4 Merge branch 'develop' into cwgoes/fix-signing-info-bugs 2018-10-15 21:04:49 +02:00
rigelrozanski 5de0c9a1f8 Merge remote-tracking branch 'origin/develop' into rigel/fee-distribution 2018-10-15 02:43:36 -04:00
Christopher Goes 5fd7297e25 Count missed blocks instead of signed blocks 2018-10-12 00:04:44 +02:00
mossid 03975407ba Merge branch 'develop' into joon/paramstore-refactor-base 2018-10-10 21:20:59 +09:00
rigelrozanski c9730329bf ... 2018-10-09 13:58:59 -04:00
Sunny Aggarwal cd21427a7b Merge PR #2405: Unbonding and Redelegations Queue 2018-10-08 06:43:47 +02:00
mossid 37ce8d51c6 apply requests 2018-10-07 01:12:00 +09:00
mossid cc0e2c9523 paramstore refactor base
rm debug code

fix lint

fix hack.go
2018-10-07 01:11:59 +09:00
Rigel 324bdaf55d Merge PR #2394: Split up UpdateValidator into distinct state transitions applied only in EndBlock 2018-10-03 18:37:06 +02:00
Jeremiah Andrews 20f5325f47 Fix more linter errors 2018-09-03 09:52:20 -07:00
Rigel b296209536
Merge PR #2205: minor develop fix
* minor corrections

* ...

* ...
2018-08-31 21:23:30 -04: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
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
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 879f78cfc0 Rename revoke(d) to jail(ed) 2018-08-22 17:56:13 +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
Joon bdccbeff9e Merge PR #1265: Global Paramstore
in progress
in progress
stake and slashing now params
fix gaia
fix gaia again
add msg type deactivation
delete local error
in progress
revert actual application in baseapp/gaia/stake
add test, fix apps
fix MinSignedPerWindow, pass lint
fix gaia
fix keeper_test
fit with multiple msgs
fix
apply requests
pass lint
really the last fix
fix dependency
fix keeper_test
fix lint
2018-07-14 02:12:23 +02:00
rigelrozanski a2f7b582df validators smaller values stored 2018-07-04 01:32:49 -04:00
Christopher Goes 3f438cdbc2
Merge PR #1511: Prevent unrevoked validators from unrevoking
* Prevent unrevoked validators from unrevoking
* Update changelog
* Update previously incorrect test
* 'make format'
2018-07-03 07:47:40 +02:00