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
* unbonding redelegation queue
* address some of bez and chris review
* delete old timeslices from queue
* added Rigel's test case
* added end-time to tags
* fixed bug in staking
* removed prints
* Get -> Queue
* called Endblocker in test
* implement validator queue
* Docs and PENDING
* address federicos comments
* unexposed UnbondingToUnbonded
* no copying unbonded val array to memory
* Cherry picked commits from prev branch
* Added new keepers for querier functionalities
* Renaming
* Fixed gov errors and messages
* Added Querier to stake and app
* Update delegation keepers
* REST Queriers not working
* Fix marshalling error
* Querier tests working
* Pool and params working
* sdk.NewCoin for test handler
* Refactor and renaming
* Update LCD queries and added more tests for queriers
* use sdk.NewCoin
* Delegator summary query and tests
* Added more tests for keeper
* Update PENDING.md
* Update stake rest query
* Format and replaced panics for sdk.Error
* Refactor and addressed comments from Sunny and Aleks
* Fixed some of the errors produced by addr type change
* Fixed remaining errors
* Updated and fixed lite tests
* JSON Header and consistency on errors
* Increased cov for genesis
* Added comment for maxRetrieve param in keepers
* Comment on DelegationWithoutDec
* Bech32Validator Keepers
* Changed Bech validator
* Updated remaining tests and bech32 validator
* Addressed most of Rigel's comments
* Updated tests and types
* Make codec to be unexported from keeper
* Moved logic to query_utils and updated tests
* Fix linter err and PENDING
* Fix err
* Fix err
* Fixed tests
* Update PENDING description
* Update UpdateBondedValidatorsFull
* Update iterator
* defer iterator.Close()
* delete comment
* Address some of Aleks comments, need to fix tests
* export querier
* Fixed tests
* Address Rigel's comments
* More tests
* return error for GetDelegatorValidator
* Fixed conflicts
* Fix linter warnings
* Address @rigelrozanski comments
* Delete comments
* wire ––> codec
* 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
* 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
* docs: Explain the expected return type within the store (#1452)
* bug somewhere here
* ...
* ...
* fix appending over key
* keys cleanup
* changelog
* remove some junk
* address bucky comments - rearrange appends
* hard code address length