Commit Graph

337 Commits

Author SHA1 Message Date
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
Hendrik Hofstadt 2be19b9d33 Merge PR #3163: Withdraw commission on self bond removal
* Withdraw commission on self bond removal
* Update PENDING.md
2018-12-19 17:05:33 +01:00
Federico Kunze 65beea4430 Add distribution REST endpoints swagger file (#3038) 2018-12-13 10:42:55 -08:00
Artur Albov 0c6d53dc07 Merge PR #2959: Add TxEncoder to client TxBuilder 2018-12-12 22:29:42 +01:00
Jack Zampolin e1f0767ba8
R4R: Move generate_only and simulate to POST body in REST txs (#3060)
* Move generate_only and simulate to POST body in REST txs

Closes: #3056

* Run make format

* drop extra else block, outdent its block, and make linter happy

* Update PENDING.md

* Update LCD swagger docs
2018-12-10 14:51:53 -08:00
dongsamb da7f459d44 Merge PR #3050: Add generate-only option to withdraw-rewards 2018-12-10 16:29:10 +01:00
Alessio Treglia 24a1670cf0 Run make format 2018-12-10 14:27:25 +00:00
Jae Kwon bc51fa93b6
Fix updateValidatorDistInfoFromPool (#3046)
Fixes regression introduced by #2984.
Continuiation of #3033 , which didn't fix the simulation issues.
(candidate) Complete solution for #3019, 9002 halt bug.

From #2984, it isn't sufficient to take the fee pool rewards of a validator. Since we don't track delegator accums (as we do with validator accums), and because onValidatorModified >updateValidatorDistInfoFromPool is also being called upon delegation updates (or at least I believe this is the reason), it is necessary to also withdraw self delegation.

TODO: I don't think self-delegation should be required to be modified here... consider using a delegation hook to do the self-delegation withdraw part instead, e.g. splitting the updateValidatorDistInfoFromPool function into two. It might not result in cleaner code, however. Think hard.
2018-12-08 07:18:04 -08:00
frog power 4000 49da96bc09 Merge PR #3010: Add Missing genesis checks in Gaia 2018-12-07 01:22:24 +01:00
Alexander Bezobchuk 6395e2a7ab Merge PR #2984: Removal of Mandatory Self-Delegation Reward
* Some minor cleanup and reformatting to make things easier to understand

* Update onDelegationSharesModified hook

* Add pending log

* Address PR comments

* Fix linting
2018-12-04 17:53:52 -05:00
Christopher Goes dfd00a661a Inflation bug fixes (#2982)
* PENDING.md; swap BeginBlocker ordering
* Calculate inflation every block
* Update x/mint spec
* Reset distribution info bond height instead
2018-12-04 10:17:02 -08:00
Hendrik Hofstadt b7736367a8 R4R: Fix duplicate json key in SetWithdrawAddress (#2944)
* Fix duplicate json key

* Update PENDING.md
2018-11-29 09:54:36 -08:00
Christopher Goes b2b026b5e0
Merge PR #2930: Simulation spring cleaning
* Update PENDING.md
* Add simple period for expensive invariants
* Remove individual module simulations
* Simulate a few more blocks
* Add README explaining reason for shell scripts
* Deduplicate scripts, log exact replication command on failure
* Refactor invariants to take sdk.Context instead of baseapp.BaseApp
* Reference all issues in PENDING.md entry
* Remove no longer used simulation.RandSetup
* Bug fixes
* Address @rigelrozanski comments
* Fix typo
2018-11-29 16:17:10 +01:00
Hendrik Hofstadt ca43225851 Merge PR #2943: Fix tag usage in handlers and EndBlocker
* Fix tag usage in handlers and EndBlocker
* Prepend action tag in baseApp
* Fix LCD
* Remove unnecessary conversion
* Fix invalid consensus pubkey in CLI tests
* Fix tag usage in cli_test
* Shorten bechify in test
* Update docs and PENDING
2018-11-29 15:34:57 +01: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
Jae Kwon 7ec2b9a72b Fix merge conflict issues from previous squash commit 2018-11-26 04:27:23 -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
frog power 4000 7cb1ba625e blockly minting (#2825)
* update mechanism to use average block time
* correctly sets accum height for zero-delegations
* update Decimal Format()
* clip withdrawal tokens
* PositiveDelegationInvariant
* DelegatorSharesInvariant
* DelAccumInvariants
2018-11-26 04:13:47 -08:00
dongsamb 33d64b6163 Merge PR #2891: Remove redundant temporary code remDelPool when calc DelPool 2018-11-23 17:28:29 +01:00
Jack Zampolin f525717054
Standardize CLI Exports from Modules (#2840)
* Move query and tx commands to modules
* Move GetAccountDecoder to prevent import cycle and replace calls to it with one call in WithAccountDecoder
* Add moduleClients interface and implement in all applicable modules
* Use module clients in cli initialization
2018-11-19 09:02:34 -08:00
Sunny Aggarwal 8d6b0929fb Codespaces as Strings (#2821) 2018-11-16 09:12:24 -08:00
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
Jae Kwon 336415baea
Fix simulation bugs; Incorprates #2676 from Sunny (#2677)
* Fix simulation bugs; Incorprates #2676 from Sunny
* Address review feedback; Update PENDING
2018-11-04 22:11:03 -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
Dev Ojha 8e328c8706 Merge PR #2665: simulation: Remove header from Invariant
This got introduced recently, but wasn't actually needed, hence the reversion
2018-11-02 13:35:21 +01:00
Rigel d71f38bdac Merge PR #2597: Add distribution accum invariants 2018-10-26 13:42:53 +02:00
Jae Kwon 0f1fb179c4 Merge PR #2599 from cosmos/jae/dist_refactor
* Rename Pool -> DelRewards; PoolCommission -> ValCommision
* FeePool.Pool -> FeePool.ValPool
* WithdrawalHeight->DelPoolWithdrawalHeight
* OnValidatorBeginUnbonding
* Caught the bug's tail
* Update vi.FeePoolWithdrawalHeight upon bonding
* Fix staking slashUnbondingDelegation bug; fixes simulator failure #9
2018-10-26 13:27:55 +02:00
Christopher Goes 2a279e954f Remove logs from prior debugging 2018-10-25 13:22:54 +02:00
Jae Kwon f756b40a01 LastValidatorPower is also an Int 2018-10-24 00:04:06 -07: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
Christopher Goes 3d270babc0 Store last total power as sdk.Int, not sdk.Dec 2018-10-23 20:48:50 +02:00
Christopher Goes 306fb8fb6d Address @rigelrozanski comments 2018-10-23 20:33:39 +02:00
Christopher Goes edd56be952 Cleanup, additional item in PENDING.md 2018-10-23 18:29:39 +02:00
Christopher Goes 33c8238392 Merge branch 'develop' into cwgoes/check-supply-in-simulation 2018-10-23 17:54:58 +02:00
Christopher Goes be66a4950e Remove debugging print statements 2018-10-23 15:50:35 +02:00
rigelrozanski 5a559f75c5 simulation stop early with no proposers 2018-10-22 23:55:49 -04:00
Jae Kwon fa3730a5d2 WIP looking for bug... 2018-10-22 19:48:28 -07:00
Jae Kwon ea565baa60 WIP intermediate... 2018-10-22 17:49:53 -07:00
Jae Kwon c3008d585b Add more useful logging 2018-10-22 16:24:19 -07:00
rigelrozanski c4d7747a56 Merge remote-tracking branch 'origin/cwgoes/check-supply-in-simulation' into jae/check-supply-in-simulation 2018-10-22 15:51:52 -04:00
rigelrozanski a3447cd480 debug cleanup 2018-10-22 15:51:27 -04:00
rigelrozanski 278d23776b call hook on slashing 2018-10-22 14:59:00 -04:00
Jae Kwon 471ddeef3c tweak debug output 2018-10-22 09:50:17 -07:00
Jae Kwon 19225fc5d4 Print debugging info 2018-10-22 02:42:40 -07:00
Jae Kwon 1cc74320df Replicate Rigel's changes but w/ modifications as discussed + some name changes 2018-10-22 01:46:47 -07:00
Jae Kwon 3fa5778921 Update naming (BondedValidatorIndex->ValidatorsBondedIndex) and add some comments 2018-10-21 12:02:45 -07:00
Alessio Treglia 6014089fa1
Rename AccountMapper to AccountKeeper
Closes: #2540
2018-10-20 23:22:48 -07:00
Christopher Goes c88fc481d4 Fix linter issues 2018-10-20 01:05:07 +02:00
Christopher Goes 255a6a5db8 Cleanup to one hook 2018-10-20 00:19:10 +02:00
Christopher Goes 7770aec306 Withdraw rewards on bonded to unbonding 2018-10-20 00:13:44 +02:00
rigelrozanski a6ef3c42aa use power instead of total tokens 2018-10-19 17:41:39 -04:00
Christopher Goes 6c9ad8c031 Add sanity checks 2018-10-19 21:58:05 +02:00
Christopher Goes 4f719d60cd Remove the print statement 2018-10-19 20:59:51 +02:00
Rigel d9916f99eb bugfix (#2535) 2018-10-19 20:58:37 +02:00
Christopher Goes 22cb6983b7 Merge branch 'develop' into cwgoes/check-supply-in-simulation 2018-10-19 20:36:55 +02:00
Rigel b48d0d5623 Merge PR #2527: Minting 2018-10-19 20:36:00 +02: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
Christopher Goes 42ae2671c2 Simulation fixes work-in-progress 2018-10-19 03:08:25 +02:00
Christopher Goes 25ce0dea00 Update stake module simulation and fix linter errors 2018-10-18 22:08:00 +02:00
Christopher Goes e099491daa
Merge PR #2526: Distribution fixes from simulation 2018-10-18 21:58:57 +02:00
Christopher Goes b700107bec Add simulated distribution msgs 2018-10-17 00:25:31 +02:00
Christopher Goes 7d46b8b50c Alphanumeric parameter keys 2018-10-16 19:27:16 +02:00
Christopher Goes 3f59cf1517
Merge branch 'develop' into cwgoes/fix-signing-info-bugs 2018-10-16 19:23:57 +02:00
rigelrozanski 32e0f14de2 rework to correctly use previous vote info 2018-10-15 22:09:13 -04:00
rigelrozanski 03b92603ed oh 2018-10-15 17:03:06 -04:00
rigelrozanski 076053d5b9 proposer reward params to global param 2018-10-15 16:12:42 -04:00
rigelrozanski 2f4a01bcba address @ValarDragon comments, param store update 2018-10-15 15:51:51 -04:00
rigelrozanski 5de0c9a1f8 Merge remote-tracking branch 'origin/develop' into rigel/fee-distribution 2018-10-15 02:43:36 -04:00
rigelrozanski 2ece2ff37c address @cwgoes comments 2018-10-15 02:34:01 -04:00
rigelrozanski 06fa518e30 address @cwgoes comments, add in precommit calculation 2018-10-12 07:15:13 -04:00
rigelrozanski 7b1f4a87ea finished off validator tests 2018-10-12 06:06:01 -04:00
rigelrozanski 94731a502a some validator dist tests 2018-10-12 05:51:00 -04:00
rigelrozanski a60b91b7b2 bugfix form TestWithdrawDelegationRewardTwoDelegatorsUneven 2018-10-12 05:37:30 -04:00
rigelrozanski f3c0496c99 TestWithdrawDelegationRewardsAll 2018-10-12 04:11:09 -04:00
rigelrozanski 8cb6d106d1 TestWithdrawDelegationRewardWithCommission 2018-10-11 02:26:54 -04:00
rigelrozanski 8e378e2b2d got basic delegation tests working 2018-10-11 02:14:06 -04:00
rigelrozanski f4f39ae03f allocation tests 2018-10-10 23:16:49 -04:00
rigelrozanski 900a5f47f6 keeper_test 2018-10-10 22:53:25 -04:00
rigelrozanski 3b5e57be08 ctx with proposer, working through allocation test 2018-10-10 17:43:47 -04:00
ValarDragon 9e334afad0 Lock binary dependencies to a specific commits / versions
This is basically copying over @anton's great script!

Also had to run `make format` to make this pass `test_lint`.
This PR also makes the make commands for tools further align
with the tendermint implementation.
2018-10-09 23:52:36 -07:00
rigelrozanski 22de85651f fix distr initialization 2018-10-09 21:59:07 -04:00
rigelrozanski 52316d9ef6 fix initialization of the test 2018-10-09 21:43:23 -04:00
rigelrozanski fc9bafb8d3 Merge remote-tracking branch 'origin/develop' into rigel/fee-distribution 2018-10-09 20:19:22 -04:00
rigelrozanski c9730329bf ... 2018-10-09 13:58:59 -04:00
rigelrozanski 46fe52bbac create test initialization for distr 2018-10-09 11:27:26 -04:00
rigelrozanski 142f42ecc7 ... 2018-10-08 20:14:03 -04:00
rigelrozanski e304b9c600 debugging simulation 2018-10-05 20:32:06 -04:00
Christopher Goes 1f12f204ce Testcase fixes, 'make format', negative pre-genesis block 2018-10-05 14:11:36 +02:00
Rigel 9c9113fa3b Merge PR #2437: Distr-PR-4 Distribution Types 2018-10-05 12:41:38 +02:00
rigelrozanski 81d0f5f4a7 add wanted final test case functions 2018-10-04 21:37:40 -04:00
rigelrozanski 17dc812749 fix distribution endblocker issues 2018-10-04 20:20:43 -04:00
rigelrozanski 20a51e587c fix compile errors 2018-10-04 18:37:46 -04:00
rigelrozanski eb01cb4a35 checkout distr types PR updates 2018-10-04 18:29:03 -04:00
rigelrozanski 3a9102e2af fix 2018-10-04 03:34:10 -04:00
rigelrozanski 4d4de3aa09 delegator_dist_info tests 2018-10-04 03:26:02 -04:00
rigelrozanski 1e74da1abe validator_info tests 2018-10-04 03:00:24 -04:00
rigelrozanski dcf0ddaa03 ... 2018-09-28 20:55:22 -04:00
rigelrozanski 16f5d69329 types fee pool test 2018-09-28 19:32:42 -04:00
rigelrozanski 064f8b0b58 dec coin tests 2018-09-28 19:23:01 -04:00
rigelrozanski e223eadb36 types msg tests 2018-09-28 19:04:04 -04:00
rigelrozanski 7ab02aed76 lcd tests to include proposer 2018-09-28 04:02:07 -04:00
rigelrozanski 60a3541380 major debugs 2018-09-28 03:29:52 -04:00
rigelrozanski 956566d5d1 proser 2018-09-27 23:04:37 -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
rigelrozanski 251a81f589 yay it compiles 2018-09-20 00:53:48 -04:00
rigelrozanski 5790f33159 ... 2018-09-19 23:01:55 -04:00
rigelrozanski 5dabd1bf6d the errors never want to seem to end... 2018-09-19 22:54:46 -04:00
rigelrozanski 18fdccf95b ... 2018-09-19 22:13:12 -04:00
rigelrozanski d9396ed732 working compile errors 2018-09-19 19:33:12 -04:00
rigelrozanski df9c8db5e7 working through compile errors 2018-09-19 19:00:21 -04:00
rigelrozanski 76882991a4 alias work, working on compiling 2018-09-19 14:47:25 -04:00
rigelrozanski de4071f693 aliases, errors 2018-09-19 00:42:05 -04:00
rigelrozanski 73c5fdf1f9 more cli related 2018-09-19 00:10:33 -04:00
rigelrozanski e3cf4f606e cli transactions 2018-09-19 00:00:48 -04:00
rigelrozanski a18b89539a handler, tags, msgs, codec 2018-09-18 23:30:00 -04:00
rigelrozanski bb9e647f95 add in basic commission stuff 2018-09-18 17:54:28 -04:00
rigelrozanski 24e43b9869 hookwork 2018-09-18 12:46:04 -04:00
rigelrozanski 431fdb8695 hook, genesis, and withdraw address 2018-09-17 23:02:15 -04:00
rigelrozanski 2eff69a575 Merge remote-tracking branch 'origin/develop' into rigel/fee-distribution 2018-09-17 17:53:42 -04:00
rigelrozanski d60f620787 working 2018-09-14 02:35:02 -04: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
rigelrozanski dae32a3d65 ... 2018-09-13 03:03:30 -04:00
rigelrozanski a153088073 ... 2018-09-11 13:35:47 -04:00
rigelrozanski 922eb5e7ce ... 2018-09-10 22:00:51 -04:00
rigelrozanski 7d864fee11 Merge remote-tracking branch 'origin/develop' into rigel/fee-distribution 2018-09-10 18:42:26 -04:00
rigelrozanski e498d43d03 dec coins, refactoring distr 2018-09-10 18:37:58 -04:00
ValarDragon e812919649 Rename coinKeeper -> bankKeeper
Closes #2267
2018-09-07 22:34:32 -07:00
rigelrozanski cbb5a504d5 work on allocate fees 2018-09-05 19:28:18 -04:00
rigelrozanski b40909906d update spec 2018-09-05 19:15:15 -04:00
rigelrozanski e2b5b9b73b ... 2018-09-05 18:46:09 -04:00
rigelrozanski aebd36fef8 ... 2018-09-05 18:29:20 -04:00
rigelrozanski 53253aa32f working 2018-09-05 02:41:17 -04:00
rigelrozanski 48aa9a6ad5 working, moved WIP distribution spec to attic 2018-09-04 16:19:37 -04:00
rigelrozanski 9a2aee8791 working 2018-09-03 20:46:33 -04: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
Rigel 7fb626f548 Merge PR #1702: lamborghini distribution & inflation spec upgrade 2018-08-08 12:10:21 +02:00