Commit Graph

66 Commits

Author SHA1 Message Date
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
ace19d9264 Merge branch 'rigel/fee-distribution' of https://github.com/cosmos/cosmos-sdk into rigel/fee-distribution 2018-10-09 20:37:47 -04:00
Christopher Goes
6d4975e2c2 R4R: Fix simulation proposer (#2460)
* Correctly set proposer in randomized simulation

* Return nil if no validators are present
2018-10-09 19:14:46 -04:00
Christopher Goes
482537e6c1
Merge PR #2430: Aggressive slashing simulation & fixes 2018-10-05 19:42:52 +02:00
Christopher Goes
48672c4c0b More comments, update sim for NextValSet 2018-10-04 18:22:51 +02: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
Christopher Goes
17983460b8
Merge PR #2219: Update to Tendermint 0.24 (except NextValSet offsets) 2018-10-03 17:48:23 +02: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
Sunny Aggarwal
8721dd6ff8 Merge PR #2355: Governance BFT Time 2: Electric Boogaloo 2018-09-20 22:53:52 +08: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
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
2263cea118 Merge PR #2345: update doc.go for mock/simulation 2018-09-17 12:15: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
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
Dev Ojha
962b04d985 Merge PR #2285: simulation: Write logs on panic 2018-09-11 17:18:58 +08: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
Dev Ojha
c800bc7a1a Merge PR #2274: simulation: Stop on SIGTERM 2018-09-08 16:29:24 +08:00
Christopher Goes
e410a9e38a
Merge PR #1952: Update IAVL dependency for v0.10.0 2018-09-06 11:18:16 +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
Jeremiah Andrews
20f5325f47 Fix more linter errors 2018-09-03 09:52:20 -07:00
Jeremiah Andrews
2378e3431c Fix linter errors 2018-09-03 07:58:57 -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
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
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
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
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
ValarDragon
4451755600 simulation: rename TestAndRunTx to Operation, make timestamp randomized 2018-08-26 19:40:53 -07:00
Christopher Goes
b8cfc1e19f
Merge PR #2068: Minor simulation changes 2018-08-17 16:19:33 +02:00
Dev Ojha
8bb79d12ca Fix non-deterministic map iteration in fuzzer (#2069)
* This demonstrates that the state machine is non-deterministic if there
are more than two txs in a block.

* fix non-deterministic map iteration

* (squash this) fix build errors

* (squash this) iterate using range
2018-08-16 23:45:07 +02:00
Christopher Goes
3d50567034
Merge PR #1783: Slashing, validator set, and governance simulation 2018-08-16 17:36:15 +02:00
Joon
7b54e4b786 Merge pull request #1812: Add BaseApp.Seal
* Merge pull request #1812: Add BaseApp.Seal

fix pow

move setter functions

apply requests

* fix errors

* fix test

* fix test

* changelog
2018-08-01 00:23:25 -04:00
Joon
19b0781e60 Merge PR #1811: NewCoin takes sdk.Int 2018-07-31 02:09:50 +02:00
Dev Ojha
5d02a743fb Update to tendermint v0.22.6-rc0 (#1798)
* Update to tendermint v0.22.6-rc0

This is comprised of updating the crypto imports / API

* (squash this) switch to v0.22.6

If this passes tests, I'll squash this commit and update the PR.
2018-07-25 16:43:37 -04:00
Aditya
28cbca7d63
Merge branch 'develop' into aditya/cleanup 2018-07-20 17:05:12 -07:00
Christopher Goes
ee29e10068 RandomKey, RandomAmount 2018-07-19 08:48:43 +02:00
rigelrozanski
423d0c4a18 Merge remote-tracking branch 'origin/develop' into cwgoes/a-random-walk-down-proof-of-stake 2018-07-19 01:56:42 -04:00
Aditya Sripal
218c9b3702 Merge branch 'develop' of https://github.com/cosmos/cosmos-sdk into aditya/cleanup 2018-07-18 17:48:15 -07:00
Christopher Goes
cbf432d34c
Merge PR #1746: Remove ctx.IsCheckTx
* Remove ctx.IsCheckTx
* Changelog to Pending
* Typo
* Simulate instead of Check in SignCheckDeliver
* Add descriptive comment
* Change to 'CheckTx implements ABCI'
* Alphabetize changelog
2018-07-19 02:42:19 +02:00
Aditya Sripal
81f3e794fe make breaking changes 2018-07-18 16:24:16 -07:00
Christopher Goes
ad410c1e2e Linter fixes 2018-07-18 07:50:04 +02:00
Christopher Goes
6c61577b0b Misc, environment variables 2018-07-18 07:37:38 +02:00