Commit Graph

1214 Commits

Author SHA1 Message Date
Dev Ojha 7d5bc459fa Merge PR #2413: Remove reflection from handlers 2018-09-27 05:04:06 +08:00
Dev Ojha cb86efa054 Merge PR #2376: auth: Don't recalculate mempool fees for every msg signer, misc. cleanup
This PR begins improving the godocs for the auth module, and begins cleaning
up the Ante handler.

Additionally we previously calculated if the fee was sufficient for the tx
on every single signer. This is now refactored to be more efficient, and have
a better logical flow. No changelog entry as this is new to this release.
2018-09-27 02:34:01 +08:00
Christopher Goes da96e93727 'make format' 2018-09-26 18:23:14 +02:00
Christopher Goes e931195831 Remove unnecessary changes 2018-09-26 18:06:52 +02:00
Christopher Goes e7c2a9614f Merge branch 'develop' into cwgoes/update-tendermint-upstream 2018-09-26 17:42:22 +02:00
Alessio Treglia a2caefc8ae Merge PR #2390: CLI subcommands reorganization 2018-09-26 22:00:49 +08:00
Dev Ojha e6a8b2278e Merge PR #2377: auth: Move stdsignmsg to txbuilder, add tests 2018-09-26 21:39:05 +08:00
Alexander Bezobchuk 91cac96fea Merge PR #2391: LCD Cleanup and DRY Refactor 2018-09-26 21:29:39 +08:00
Dev Ojha e11c52e873 Merge PR #2408: decimal: Add a method to multiply a decimal by an Int
This is for usage within the slash function, to minimize operations
required to slash each unbonded and redelegating account.
2018-09-26 18:13:40 +08:00
Rigel b54801b4b3 [RETRY] Distr-PR-3 More staking hooks (#2404)
* update commission hook for new commission work
* comment update
2018-09-25 23:11:57 -07:00
rigelrozanski 3846894c3a Merge branch 'rigel/new-hooks' into rigel/fee-distribution 2018-09-25 20:09:33 -04:00
rigelrozanski 4929b022ce mini-fix 2018-09-25 19:59:46 -04:00
rigelrozanski 9e9756a6a9 Merge remote-tracking branch 'origin/develop' into rigel/new-hooks 2018-09-25 18:31:12 -04:00
rigelrozanski 47e899bb61 Merge remote-tracking branch 'origin/develop' into rigel/fee-distribution 2018-09-25 17:45:48 -04:00
rigelrozanski 380d3e1c5a pull a bunch from develop 2018-09-25 17:43:26 -04:00
Matthew Slipper 2fb3493ff5 Merge PR #2223: Gaia CLI Config Command
* Allow a gaia-cli config file to be created

Closes #1613.
Closes #1275.
Closes #1956.

* Add homedir to Gopkg.toml

* Updates from code review

* Post-rebase fixes

* Update test

* Code review refactor

* Fixes from code review

* Fix import

* Fix broken test

* Fixes from rebase

* Fix formatting
2018-09-25 17:36:42 -04:00
Matthew Slipper 24413a395d Merge PR #2073: Allow --from to be a name or an address
* Allow --from to be a name or an address

Closes #1735.

* Post-rebase fixes

* Updates from code review

* Updates from code review

* Updates from code review

* Fix merge artifacts

* Fix merge conflicts

* Fix integration tests

* Add back GetFromName() check broken during merge

* Code review updates

* Fix failing test

* Updates from code review
2018-09-25 16:48:38 -04:00
Sunny Aggarwal 15e848e43c Merge PR #2395: Remove governance slashing 2018-09-26 02:45:20 +08:00
Alexander Bezobchuk 611e287375 Merge PR #2401: Remove remnants of gocyclo 2018-09-25 13:45:04 -04:00
Jae Kwon c31c0d2822 Merge remote-tracking branch 'origin/dev/simulation_remove_pubkey_ops' into develop 2018-09-24 21:29:41 -07: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 ca2fc77af7 update commission hook for new commission work 2018-09-24 22:58:26 -04:00
rigelrozanski f5116b9d57 Merge branch 'rigel/truncate-decimal' into rigel/new-hooks 2018-09-24 22:52:12 -04:00
rigelrozanski dad4253957 merge fix 2018-09-24 22:27:09 -04:00
rigelrozanski 16594f7daf Merge remote-tracking branch 'origin/develop' into rigel/stake-cons-addr 2018-09-24 21:54:30 -04:00
rigelrozanski afe179ebb3 remove GetValidatorByConsPubKey 2018-09-24 21:51:24 -04:00
Dev Ojha 1a5d122c93 Merge PR #2392: remove redundant sprintf calls, improve a doc comment, write test
* remove redundant sprintf calls, improve a doc comment, write test

* One more super minor fix
2018-09-24 21:42:51 -04:00
rigelrozanski 9dfeeb0d7b address bez comments 2018-09-24 18:54:49 -04:00
Alexander Bezobchuk 9dafa3252d Merge PR #2365: Validator Commission Model
* Update validator commission fields

* Remove CommissionChangeToday and update to use CommissionChangeTime

* Implement commission as a first class citizen type

* Implement stringer for Comission

* Move commission type and logic to new  file

* Add new commission errors

* Add commission to create validator message

* Implement and call UpdateValidatorCommission

* Update godoc for UpdateValidatorCommission

* Add Abs to the decimal type

* Implement new SetValidatorCommission

* Update decimal short godocs

* Move set initial commission logic

* Move initial commission validation to Commission type

* Update initial validator commission logic and unit tests

* Remove commission update time from struct and move to validator

* Update validator create handler tests

* Implement commission logic for CLI

* Fix make lint failure

* Fix make cover failure

* Update edit validator logic to handle new commission rate

* Fix lint and cover

* Update create/edit validator simulation to include commission params

* Update MsgEditValidator godoc

* Update pending log

* Update staking tx docs

* Fix CLI create validator test

* Update variables names for commission  strings

* Merge UpdateTime into Commission type

* Update create-validator usage in docs

* Update more docs with examples

* More doc updates
2018-09-24 18:23:58 -04:00
ValarDragon bb624b36aa simulation: Use a simulation.Account struct
This removes privkeys and addresses from function signatures.
This comes with a 11% performance improvement to the simulator,
as we no longer keep recomputing the pubkeys.
Once we move the transient store clearing to endblock, we can
further raise the size of make test_sim_gaia_fast

concretely, `make test_sim_gaia_fast` went from 16.8 seconds to 13.5 seconds on my system.
2018-09-22 20:33:32 -07:00
rigelrozanski 6f35822d7d import hook from fee-distr 2018-09-22 16:29:42 -04:00
rigelrozanski 14792f2b23 val comments 2018-09-22 13:50:26 -04:00
rigelrozanski b212470d31 revert some accidental stuff 2018-09-20 22:49:51 -04:00
rigelrozanski 787a2f990e fix using cons address, also remove old commented distr code 2018-09-20 22:36:47 -04:00
rigelrozanski 1243507098 no more compile errors in tests 2018-09-20 22:09:27 -04:00
rigelrozanski 9e2b8e413d revert some gov changes 2018-09-20 21:22:28 -04:00
rigelrozanski 0f903bdd52 finished pulling in, compiles 2018-09-20 21:17:50 -04:00
rigelrozanski 4e4749da9d pulling in stuff from fee-distr PR 2018-09-20 20:30:18 -04:00
rigelrozanski 0867ce8656 ... 2018-09-20 20:23:07 -04:00
rigelrozanski 0d9105cf7c ... 2018-09-20 20:10:26 -04:00
rigelrozanski d36030424e breakout use of GetValidatorByConsAddr 2018-09-20 15:36:32 -04:00
Sunny Aggarwal 8721dd6ff8 Merge PR #2355: Governance BFT Time 2: Electric Boogaloo 2018-09-20 22:53:52 +08: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 7002438d5f compile debugging 2018-09-19 21:17:28 -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 97f7dbc5e6 Merge remote-tracking branch 'origin/develop' into rigel/fee-distribution 2018-09-19 13:25:23 -04:00
Alessio Treglia b74a6a9066 Merge PR #2328: Support min fees-based anti spam strategy 2018-09-19 23:25:52 +08: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
Dev Ojha c6a3928d37 Added a couple of benchmarks (#2353)
These method were surprisingly slow from the profiling.
(Mapper.Get accounted for 2.7% of time taken, GetKey also took an
interestingly large portion of time)
2018-09-18 20:00:49 -07:00
Sunny Aggarwal 5b8a499fd0 R4R: Simulation Queued Time Operations (#2348)
* closes #2349
* queue time operations simulation
* removed FutureTimeOperation
2018-09-18 19:47:54 -07: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
Dev Ojha 18d5b048a9 Merge PR #2299: simulation: reduce number of failed governance msgs 2018-09-17 22:36:26 +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
HaoyangLiu a3df7af428 Merge PR #2346: bugfix in validatorset query and refactor transaction search 2018-09-17 22:13:11 +08:00
Dev Ojha 2263cea118 Merge PR #2345: update doc.go for mock/simulation 2018-09-17 12:15:06 +08:00
HaoyangLiu 7dc09d0fc2 Merge PR 2210: Judge if trust-node predefined before create certifier add verification for getBlock, queryTx and getValidators (#2210)
Replace trust-node option with distrust-node option, and add varification in getting blocks, transactions and validator sets.
2018-09-15 02:41:21 +08:00
rigelrozanski d60f620787 working 2018-09-14 02:35:02 -04:00
Federico Kunze d195cc15ed Merge PR #2249: Staking Querier pt1
* 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
2018-09-13 17:23:44 -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 46db96bdb7 Merge remote-tracking branch 'origin/develop' into rigel/fee-distribution 2018-09-13 02:11:07 -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
Federico Kunze 5834a500da Merge PR #2259: Minor changes on slashing logs and gov Querier 2018-09-12 15:41:09 +08:00
Dev Ojha e5e7c4fa0f Merge PR #2303: simulation: Add weighted operation 2018-09-12 15:16:52 +08:00
Alexander Bezobchuk 854aca2f7d Merge PR #2238: Ensure Tendermint Validator Update Invariants 2018-09-12 15:16:28 +08:00
Alessio Treglia fb0cc0b078 Merge PR #2306: Change --gas=0 semantic and introduce --gas=simulate
* Change --gas=0 semantic and introduce --gas=simulate

Make --gas flag accept a conventional "simulate" string value in addition
to integers. Passing --gas=simulate would trigger the tx simulation and
set the gas according to the gas estimate returned by the simulation.
Any other integer value passed to --gas would be interpreted as-is and
and set as gas wanted value.

Closes: #2300

* Add test cases with gas=0

* ACK suggestion from @alexanderbez

* s/GasFlagSimulateString/GasFlagSimulate/

* Drop TODO comment on Gas type

* Enrich TODO with ref
2018-09-11 20:31:30 -04:00
rigelrozanski a153088073 ... 2018-09-11 13:35:47 -04:00
Dev Ojha 962b04d985 Merge PR #2285: simulation: Write logs on panic 2018-09-11 17:18:58 +08:00
Dev Ojha 2e0fc15dd4 Merge PR #2292: x/staking: Use variable names in switch case 2018-09-11 17:14:32 +08:00
Dev Ojha 4f0c3cb25a Merge PR #2291: x/staking: standardize validator record not found error 2018-09-11 17:12:35 +08: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
Ismail Khoffi 06f094563a Merge PR #2301: remove BechValidator
- replace with and unexported struct and amino's ability to override /
implement MarshalJSON & UnmarshalJSON to have the pub key bechified

- replaced default time to UTC as I (from London) always got an error
while decoding (epoch but in BST ;-)

- remove all occurrences of `BechValidator
2018-09-10 18:37:03 -04: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
Dev Ojha 173ed6a63d Merge PR #2282: simulation: Switch the log method from a single string to string builders 2018-09-09 23:34:09 +08:00
Christopher Goes d85eb98762 make format 2018-09-08 17:46:08 +08:00
Christopher Goes 1d55673f1f
Merge branch 'develop' into cwgoes/update-tendermint-upstream 2018-09-08 17:41:38 +08:00
Alessio Treglia 4448d175ad Merge PR #2240: New broadcast command
Implement broadcast command/REST endpoint to submit transactions
generated offline with --generated-only and the sign command.
2018-09-08 17:26:20 +08:00
Dev Ojha 88a2ddeb25 Merge PR #2276: make simulation no longer generate new privkeys 2018-09-08 16:55:49 +08:00
Christopher Goes 08d4f4525c Merge branch 'develop' into cwgoes/update-tendermint-upstream 2018-09-08 16:48:15 +08:00
Alexander Bezobchuk 0edfa17b53 Merge PR #2251: Refactor Bech32 Prefixes and Nomenclature of Validator Pubkey and Operator 2018-09-08 16:44:58 +08:00
Dev Ojha c800bc7a1a Merge PR #2274: simulation: Stop on SIGTERM 2018-09-08 16:29:24 +08:00
Christopher Goes f95d26aec1 Merge branch 'develop' into cwgoes/update-tendermint-upstream 2018-09-08 16:14:23 +08:00
ValarDragon fb235724d5 Fix unrelated lint error. 2018-09-07 22:39:26 -07:00
ValarDragon e812919649 Rename coinKeeper -> bankKeeper
Closes #2267
2018-09-07 22:34:32 -07:00
Jae Kwon 2abc90e92b Merge remote-tracking branch 'origin/develop' into alessio/auth-txcontext-to-txbuilder 2018-09-07 10:49:12 -07:00
Jae Kwon a27d83911a bld -> bldr in txbuilder.go 2018-09-07 10:34:44 -07:00
Jae Kwon 6325441861 txBld -> txBldr 2018-09-07 10:15:49 -07:00
Christopher Goes b144dc7aa2 Merge branch 'develop' into cwgoes/update-tendermint-upstream 2018-09-08 01:09:24 +08:00
Jae Kwon acd125029d x/auth/client/context -> x/auth/client/txbuilder 2018-09-07 10:04:58 -07:00
Christopher Goes 44b695c3c0
Merge PR #2226: simulation: Make governance simulation use future operations to schedule votes 2018-09-07 19:01:33 +02:00
Christopher Goes 5494e3c2dc
Merge branch 'develop' into cwgoes/revert-governance-bft-time 2018-09-07 17:24:37 +02:00
Christopher Goes 72e9664ce1 Revert "Merge PR #2217: Governance BFT Time"
This reverts commit 94b86f85c1, reversing
changes made to 2a4edcca48.
2018-09-07 17:00:57 +02:00
Alessio Treglia f5a7f2524f
ACK and incorporate @cwgoes comments 2018-09-07 15:27:06 +01: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
Alessio Treglia e6a8a4df55
Implement command/REST endpoint for offline tx sign off #1953
* Add sign CLI command to sign transactions generated with the
  --generate-only flag.
* Add /sign REST endpoint for Voyager support.

Redirect password prompt to STDERR to avoid messing up cli
commands output. As a rule of thumb, program's output should
always go to STDOUT, whilst errors&diagnostics go to STDERR
as per POSIX's philosophy and specs.
2018-09-07 12:57:50 +01:00
Christopher Goes 72b3a45778
Merge branch 'develop' into sunny/gov-bft-time 2018-09-07 07:47:14 +02:00
Christopher Goes 549eba0d54 Add height offsets 2018-09-07 06:56:05 +02:00
Christopher Goes dd75cd3049 Minor cleanup 2018-09-07 01:00:06 +02:00
Christopher Goes c667c5690a More testcase fixes 2018-09-07 00:47:37 +02:00
Christopher Goes 06adc691d2 Update testcases for TM 0.24.0-rc0 2018-09-07 00:45:07 +02:00
Christopher Goes f45cfb2f70 Merge branch 'develop' into cwgoes/update-tendermint-upstream 2018-09-06 11:51:56 +02:00
Christopher Goes e410a9e38a
Merge PR #1952: Update IAVL dependency for v0.10.0 2018-09-06 11:18:16 +02: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 8ab25fa78c Merge remote-tracking branch 'origin/develop' into rigel/fee-distribution 2018-09-05 18:29:37 -04:00
rigelrozanski aebd36fef8 ... 2018-09-05 18:29:20 -04:00
rigelrozanski 53253aa32f working 2018-09-05 02:41:17 -04:00
rigelrozanski 38c6090a9b Merge branch 'rigel/move-spec' into rigel/fee-distribution 2018-09-04 22:17:45 -04:00
Christopher Goes a6120686f9
Merge PR #2165: Implement generate-only option for commands that create txs 2018-09-05 01:12:03 +02:00
rigelrozanski 48aa9a6ad5 working, moved WIP distribution spec to attic 2018-09-04 16:19:37 -04:00
Alessio Treglia 89b3ab9e51
Don't skip basic validation 2018-09-04 17:29:33 +02:00
ValarDragon 5ed24e44d2 simulation: Minor changes
Now that we properly initialize governance, a ton of governance slashing
doesn't happen in the first few blocks. Because of this, we can run through
blocks in the range (0,200) quite rapidly. This PR acknowledges that and
increases many of the default block heights.
2018-09-03 19:15:51 -07:00
ValarDragon 753e58bac0 simulation: Make governance simulation use future operations to schedule
votes.

In a future PR, functionality to test that slashing occured properly should be added.
2018-09-03 18:30:18 -07:00
rigelrozanski 9a2aee8791 working 2018-09-03 20:46:33 -04:00
Alessio Treglia 86395809cb
Implement generate-only option for commands that create txs
The new CLI flag builds an unsigned transaction and writes it to STDOUT.
Likewise, REST clients can now append generate_only=true to a request's
query arguments list and expect a JSON response carrying the unsigned
transaction.

Closes: #966
2018-09-04 02:32:05 +02:00
Jeremiah Andrews 20f5325f47 Fix more linter errors 2018-09-03 09:52:20 -07:00
Christopher Goes 14d5e686d9 More TM 0.24 updates 2018-09-03 18:04:28 +02:00
Christopher Goes 73292e08b4 Start of changes for TM 0.24 2018-09-03 17:01:49 +02:00
Jeremiah Andrews 2378e3431c Fix linter errors 2018-09-03 07:58:57 -07:00
Christopher Goes a4f36aa874
Merge pull request #2200 from cosmos/dev/GetValidator_speed_improvement
Improve GetValidator speed
2018-09-03 13:07:09 +02:00
Sunny Aggarwal aafa0d92dd BFT Time 2018-09-03 00:09:26 -07:00
Sunny Aggarwal 3a62c83873 asdf 2018-09-03 00:09:26 -07:00
rigelrozanski 2c66ba0bd4 extra comment on cache key usage 2018-09-02 15:42:25 -04:00
Dev Ojha 311c5f8ac6
Merge branch 'develop' into dev/benchmark_simulation 2018-09-01 15:14:46 -07:00
Christopher Goes d214952450
Merge PR #2163: Validator unbonding state 2018-09-01 23:15:03 +02:00
ValarDragon 52775f3329 Make the slashing logger print a string representation of slashFactor
It used to print the decimal number, which has an extra factor of 10**10,
and is thus confusing.
2018-09-01 13:54:47 -07:00
ValarDragon f29fdcafdd Add comments 2018-09-01 13:21:42 -07:00
ValarDragon 3b4caa5dd2 fix lint 2018-09-01 12:59:36 -07:00
ValarDragon a991a2e1c4 Improve GetValidator speed
In simulation, this was shown to cause a 4x speedup. There are no safety
concerns here, as amino encoding is deterministic.
2018-09-01 12:59:36 -07:00
Dev Ojha 5643c0801b Merge branch 'develop' into dev/benchmark_simulation 2018-09-01 12:37:50 -07:00
ValarDragon 3c2100793e Address @cwgoes comments 2018-09-01 12:32:24 -07:00
rigelrozanski f0c13bbfbd resolve merge errors 2018-08-31 21:38:50 -04:00
Rigel b296209536
Merge PR #2205: minor develop fix
* minor corrections

* ...

* ...
2018-08-31 21:23:30 -04:00
rigelrozanski acf1f09e73 Merge branch 'rigel/develop-fix' into rigel/validator-unbonding 2018-08-31 21:03:14 -04:00
rigelrozanski 6e295085c1 ... 2018-08-31 20:56:35 -04:00
rigelrozanski 9593a2641a ... 2018-08-31 20:52:45 -04:00
rigelrozanski 07ba719c75 minor corrections 2018-08-31 20:50:12 -04:00
rigelrozanski a880242895 Merge remote-tracking branch 'origin/develop' into rigel/validator-unbonding 2018-08-31 20:28:48 -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
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 d84885ca49
No need to create a fake slice of signatures nor skip account no./sequence check 2018-08-31 19:09:39 +02:00
Alessio Treglia 1ed76565f2
Remove obsolete comments 2018-08-31 19:04:45 +02:00
Alessio Treglia 122ed3a900
Don't use pointers when you need them not! 2018-08-31 19:04:45 +02:00
Alessio Treglia 1370ca611b
Set GasAdjustment in CLIContext when handling HTTP requests
This is to address @alexanderbez's comments
2018-08-31 19:04:42 +02: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
rigelrozanski d900c583ff melekes comment 2018-08-30 21:16:23 -04:00
ValarDragon 4be69077fe Fix cyclomatic complexity, add ability to use GoLevelDB 2018-08-30 11:43:56 -07:00
ValarDragon d1a5808a75 Address Anton's comment 2018-08-30 09:32:15 -07:00
ValarDragon b3d08bcb23 minor cleanup 2018-08-30 00:35:02 -07:00
ValarDragon 03d2f7331b Remove code duplication 2018-08-30 00:28:15 -07:00
ValarDragon 31ca2e058b Update PENDING 2018-08-29 23:11:14 -07:00
ValarDragon 46bbada4ee simulation: Add benchmarking 2018-08-29 23:02:15 -07:00
rigelrozanski 8d02c3eba0 fix golint 2018-08-29 20:24:35 -04:00
rigelrozanski 6fd8299b1a ... 2018-08-29 18:54:02 -04:00
rigelrozanski 52b249b0cd complete tests 2018-08-29 18:44:40 -04:00
rigelrozanski d1a2fed2bc tests working 2018-08-29 02:28:27 -04:00
Mike Xu fd8c1e5253 Merge PR #2159: fix the gov/slash error 2018-08-29 01:22:39 -04:00
rigelrozanski c4d0a00550 Merge remote-tracking branch 'origin/develop' into rigel/validator-unbonding 2018-08-28 20:16:07 -04:00
Matthew Slipper c6d692e27f Merge PR #2172: Use cobra.NoArgs where appropriate
Closes #885.
2018-08-28 12:59:42 -04:00
Christopher Goes 5f347e0d9a
Merge PR #2166: simulation: Allow operations to specify future operations 2018-08-28 14:53:45 +02:00
Christopher Goes d1ecc8f6b4
Merge PR #2141: Governance CLI uses Querier 2018-08-28 14:49:33 +02:00
Christopher Goes 73f90e8f92
Merge PR #2047: Simulate transactions by default to set gas automatically 2018-08-28 13:53:29 +02:00
rigelrozanski 78f98fec16 Merge remote-tracking branch 'origin/develop' into rigel/validator-unbonding 2018-08-27 19:34:03 -04:00
HaoyangLiu 5ed1775681 Merge PR #2148: Change delegation amount from int64 to sdk.Int
* Change delegation amount from int64 to sdk.Int

* Refactor code according to code review

* leave freeFermionVal to int64 in case of overflow
2018-08-27 18:18:18 -04:00
Sunny Aggarwal bfdeb3f8ce works 2018-08-27 15:18:01 -07:00
ValarDragon 855222e8c3 simulation: Allow operations to specify future operations
The intent of this is to allow for simulating things like slashing for not
voting on a governance proposal. To test this, you would queue all the validator votes
in future blocks, and keep track of which ones you didn't slash. Then you could add queue a
"check governance slashing operation" after the voting period is over.
2018-08-27 14:27:00 -07:00
rigelrozanski f2d47f9e91 slash contract, cwgoes comment 2018-08-27 14:46:38 -04:00
rigelrozanski 527320c9fc dummy tests 2018-08-27 00:38:31 -04:00
rigelrozanski ec42e66501 fix old tests 2018-08-27 00:20:40 -04:00
ValarDragon 4451755600 simulation: rename TestAndRunTx to Operation, make timestamp randomized 2018-08-26 19:40:53 -07:00
Alessio Treglia 76a16ab288
Modify AnteHandler to take a simulate boolean parameter 2018-08-25 20:12:14 +01:00
rigelrozanski 86f07d271d unbonding validators, delegtion effects 2018-08-24 21:47:31 -04:00
Sunny Aggarwal 6391611005 asdf 2018-08-24 11:07:53 -07:00
Alessio Treglia 7e8feec738
Incorporating @cwgoes comments 2018-08-24 15:20:53 +01:00
Alessio Treglia f36f749818
Incorporating @ValarDragon's comments 2018-08-24 10:16:51 +01:00
Alessio Treglia f432c0c383
Simulate transactions before actual execution
* Change --gas=0 semantic in order to enable gas auto estimate.
* REST clients have been modified to simulate the execution of
  the tx first to then populate the context with the estimated
  gas amount returned by the simulation.
* The simulation returns both an unadjusted gas estimate and an
  adjusted one. The adjustment is required to ensure that the
  ensuing execution doesn't fail due to state changes that might
  have occurred. Gas adjustment can be controlled via the CLI's
  --gas-adjustment flag.
* Tiny refactorig of REST endpoints error handling.

Closes: #1246
2018-08-24 10:16:51 +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
Christopher Goes b23fe15e4a
Merge PR #1918: Keeper custom queries & QueryRouter 2018-08-22 12:50:59 +02:00
Christopher Goes 4b5bb45a09
Merge PR #2062: Support a proposal JSON file in submit-proposal 2018-08-22 12:31:58 +02:00
Sunny Aggarwal 7f43d3b290 fixed GetLastProposalID function 2018-08-22 00:17:37 -07:00