Commit Graph

262 Commits

Author SHA1 Message Date
Alessio Treglia e7e3c32204 Merge PR #3553: Code cleanup, take #1
* add a bunch of tests, add DONTCOVER text tag

- Also fix flaky test (closes: #3559). Don't test values
  returned by queries since there's no way to query a
  specific height via REST.

* GetTempDir -> NewTestCaseDir
2019-02-08 22:45:41 +01:00
Juan Leni b5fdb83830 Merge PR #3517: Increasing test coverage in keys/client package 2019-02-08 12:45:23 -08:00
Joon d50f3ee4fb Merge PR #3395: Store Refactor 2 2019-02-05 19:39:22 +01:00
Joon 08e62fb157 Store Refactor 1 (#2985) 2019-02-01 17:03:09 -08:00
Christopher Goes f66b7b6310
Merge PR #3435: Assert store implementations never store nil values
* Check non-nil values on IAVL store
* Reuse assertValidValue
2019-01-29 21:28:41 +01:00
HaoyangLiu afb04b117e Merge PR #3387: Add missing iterator close 2019-01-25 12:13:17 +01:00
Hleb Albau 867f8a7467 Merge PR #3195: Configurable pruning. Fix docs and create strategies const. 2019-01-09 16:06:22 +01:00
Alessio Treglia 24a1670cf0 Run make format 2018-12-10 14:27:25 +00:00
Jae Kwon 40a30b738f
Update gas costs to more reasonable numbers for GoS (#3052) 2018-12-10 02:48:19 -08: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
rigelrozanski 70e60c2f30 Merge remote-tracking branch 'origin/develop' into rigel/deliver-max-gas 2018-11-21 01:51:56 -05:00
Jae Kwon 10bdf8fa03 Store ConsensusParams to main store 2018-11-20 16:44:49 -08:00
Jae Kwon 47eed3958b
Clean up Context/MultiStore usage in BaseApp (#2847) 2018-11-20 01:06:14 -08:00
Alexander Bezobchuk 6e813ab3a8 Change gas & related fields to unsigned integer type (#2839)
* Change gas & related fields to unsigned integer type
* Implement AddUint64Overflow
2018-11-19 09:13:45 -08:00
Sunny Aggarwal 8d6b0929fb Codespaces as Strings (#2821) 2018-11-16 09:12:24 -08:00
Jae Kwon c7b3efdd02
Do not allow nil values to be set in CacheKVStore (#2708)
* Do not allow nil values to be set in CacheKVStore
2018-11-07 00:29:27 -08:00
Jae Kwon 2779f4dba3
Add general merkle absence proof (also for empty substores) (#2685) 2018-11-07 00:03:02 -08:00
Jae Kwon f4338d6f75 Fix merge conflict bug; Update PENDING 2018-11-04 19:42:11 -08:00
Jae Kwon 5b74e1d0b6
Bez/tm0.26 update pt 2 redux (#2684)
* Update to TM v0.26.0
* Update TODOs
* Proof and verification updates
* Fix linting
* Fix key path creation
* Temporarily fix tendermint revision to make tests pass
2018-11-04 19:36:35 -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
Christopher Goes 79ce52a41a
Merge PR #2458: Move linear to store 2018-10-16 21:57:42 +02:00
mossid 27b8322a27 split test 2018-10-16 04:09:41 +09:00
mossid 9d809d7855 Merge branch 'develop' into joon/2406-move-linear 2018-10-16 03:18:04 +09:00
mossid fb78f1d0af add docs, fix GetSubspace, address comments
rm Subspace.ptr
2018-10-14 02:44:29 +09:00
mossid 62feae87f5 fix missed conflict 2018-10-12 00:23:52 +09:00
mossid 42c7a09075 Merge branch 'develop' into joon/paramstore-refactor-base 2018-10-12 00:09:07 +09:00
mossid 0c92477b4d mv types/lib/* store/ 2018-10-09 22:23:22 +09:00
mossid 0cbb37ff03 rm Close() from Next() 2018-10-09 21:05:18 +09:00
mossid ed9b29c856 fix typo 2018-10-09 21:05:18 +09:00
mossid 43b3352c87 fix Close() 2018-10-09 21:05:17 +09:00
mossid e7c76eb344 port tests from tmlibs, fix tests 2018-10-09 21:05:17 +09:00
mossid c770e74571 fix cloneAppend 2018-10-09 21:05:17 +09:00
mossid 5091d1688d partially apply requests 2018-10-09 21:05:17 +09:00
mossid 5237639138 fix prefixIterator 2018-10-09 21:05:17 +09:00
mossid 7d49675600 apply requests in progress 2018-10-07 01:12:01 +09:00
mossid 6978d283bf fix lint 2018-10-07 01:12:01 +09:00
mossid 30ea9f85ae add tests for cloneAppend 2018-10-07 01:12:01 +09:00
mossid f3c330ec4d fix prefixstore 2018-10-07 01:12:01 +09:00
mossid e7de48e375 address comments 2018-10-07 01:12:01 +09:00
mossid a43a97bf10 address comments 2018-10-07 01:12:00 +09:00
mossid cc75924182 last rereview 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
Christopher Goes 17983460b8
Merge PR #2219: Update to Tendermint 0.24 (except NextValSet offsets) 2018-10-03 17:48:23 +02:00
Alexander Bezobchuk 8ca8acf638 Merge PR #2357: Refactor Iterator Gas Consumption 2018-09-26 22:02:56 +08: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
Joon f19fbe3fb8 Merge PR #2330: iterate over storesParams 2018-09-13 21:53:21 -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
Dev Ojha 358b48771c Merge PR #2308: Remove ripemd160 entirely
* Remove ripemd160 entirely

We already made this decision awhile ago, and have had tendermint switched
for awhile. I was surprised to find ripemd still used within the storeinfo.
This actually leads me to think the new "byter" API change in the tendermint
PR RFC compliance is better, as it avoids things like this from ever happening.

* Get ripemd160 removed from the gopkg imports
2018-09-12 15:13:14 +08: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 43ccbd4185 Merge PR #2281: Update to iavl 0.11.0 2018-09-09 23:13:17 +08:00
HaoyangLiu 3cf3ab11b0 Merge PR #2037: transient store missed to implement store type interface
* transientstore missed to implement store type interface

* rename pointer name from rs to ts
2018-09-08 20:47:36 -04:00
Jeremiah Andrews 2378e3431c Fix linter errors 2018-09-03 07:58:57 -07:00
Christopher Goes 3ac55b589d Update testcase from merge 2018-09-03 07:57:15 -07:00
Jeremiah Andrews b72f87a027 Update IAVL dependency for v0.10.0 2018-09-03 07:57:15 -07:00
HaoyangLiu 67857d704b IRISHUB-238: change wait 3 second to wait tendermint new block. use MustUnmarshalBinary instead of UnmarshalBinary 2018-08-31 23:20:06 +08:00
HaoyangLiu 9de7650b99 IRISHUB-238: fix a bug in judge whether proof is required and refactor comment 2018-08-31 10:15:37 +08:00
HaoyangLiu ab76fd964a IRISHUB-238: remove todo, refactor comment and refactor multistoreproof 2018-08-31 10:03:48 +08:00
HaoyangLiu b878edc388 IRISHUB-238: fix failures in test_lint and test_cover 2018-08-30 15:52:17 +08:00
HaoyangLiu 703c643fc0 IRISHUB-238: Add multiply store proof build and verification 2018-08-30 15:05:16 +08:00
ValarDragon f6cb4d4fb6 Speedup IAVL iterator by removing defers when unneeded.
Note each defer occurs a 30ish ns overhead here, which is significant
for IAVL iteration. We were previously using around 3-4 defers. (2 in
next, one in Valid, one in Key, one in Value) This slows down the entire
application quite significantly, as we require fast iteration.
2018-08-24 10:26:02 -07:00
Christopher Goes 7b8c1c0e80
Merge branch 'develop' into fix-iterator-leak 2018-08-22 16:06:35 +02:00
Joon f0b3766a46 Merge PR #2074: Reject duplicate storekey name 2018-08-21 15:49:06 +02:00
youjing 517682f17c fix Iterator leak, ref to https://github.com/cosmos/cosmos-sdk/issues/2105 2018-08-21 14:54:12 +08:00
Jeremiah Andrews f653bed8c9 Merge PR #1926: RootMultiStore test helper bugfix
* Add reload modification to test
* Modify test helper function to prefix store dbs
2018-08-08 12:27:05 +02:00
Joon d46140a392 Merge PR #1481: Transient Stores 2018-07-27 03:24:18 +02:00
Rigel 3231daa4d8 remove global shares (#1644)
* wip removing pool shares

* remove PoolShares/Tokens entirely

* worked through stake/type compile error

* work through a bunch of keeper errors

* worked through compile errors

* debugging tests

* resolve compilation error

* resolved types errors

* ...

* move inflation to pool type

* ...

* stumped problem

* Calculate newly issued shares, remove unnecessary pool arg from exchange rate calculation

* Rounding changed

* Update x/slashing tests for sdk.Rat BondedTokens

* testing fixes

* resolved test fixes

* cwgoes comments, changelog, lint

* cli bugfixes

* ..

* cli fixed

* spec update

* 'make format'

* cwgoes comments

* Increase test_cover parallelism
2018-07-13 21:46:14 +01:00
Jeremiah Andrews 43b9cc6df0 Merge PR #1533: Pruning Cleanup 2018-07-13 03:20:26 +02:00
Alexander Bezobchuk 5983a07fb6 Merge PR #1599: Implementation of TraceKVStore 2018-07-13 01:58:51 +02:00
ValarDragon 0c5358c267 Continue reducing code complexity:
* Adds a Min function to Int, and uses that in the slash function
* Adds a getHeight helper function to iavlstore
* Adds a splitPath function to baseapp
* Changes cyclo param from 10 to 11
2018-07-09 15:29:16 -07:00
Jeremiah Andrews 4c5850d405 setting default to archive mode / no pruning 2018-07-07 12:34:11 -07:00
Ethan Buchman d388036454 Merge PR #1520: various fixes for test_cli
* various fixes for test_cli
* linting
2018-07-03 06:33:53 +02:00
Jeremiah Andrews b3e4faec74 addressing comments 2018-07-02 15:30:09 -07:00
Jeremiah Andrews 1632b7de18 testing pruning 2018-07-02 15:30:09 -07:00
Jeremiah Andrews 60a8a63e62 base variabls / logic, need tests 2018-07-02 15:30:09 -07:00
Ethan Buchman f78f30c67a update for tm v0.22.0. tmlibs->tendermint/libs 2018-07-02 16:34:06 -04:00
Dev Ojha 955a0c9af7 Switch asserts to require (#1483)
* meta: Switch the majority of asserts to require

Switch most assert statements to require, to ease debugging.
Closes #1418

* Fix imports
2018-06-30 03:10:15 +02:00
Dev Ojha 097dd8a164 tools: Add unparam linter (#1443)
* tools: Add unparam linter

unparam detects unused parameters in functions, and a parameter to
a function which only ever takes on one value. The latter is an
indication that more tests are required.

There are many nolints in this PR, as I believe that writing tests
to fix alot of these situations is out of scope for this PR / it
will be changed in future commits. There are some nolints for
when we have to comply to normal api's.

* crypto/keys no longer used by x/gov/client/rest/rest.go
2018-06-29 18:22:24 -04:00
Christopher Goes 59aadf42aa
Ledger integration (#931)
Merges the keybase and Ledger code from go-crypto (which is no more) into the SDK
Adds support for Ledger into gaiacli
Cherry-picks updated error handling from #1158
2018-06-29 02:54:47 +02:00
Dev Ojha ac3adff1e8 Merge PR #1438: Tools: Add errcheck linter
This linter ensures that all errors are checked.
This is disabled in the client directories, since its not needed on
those writes
2018-06-29 00:52:10 +02:00
Dev Ojha 3e14868bd6 Merge PR #1429: tools: Add ineffassign linter
* tools: Add ineffassign linter

This errors on assignments that don't actually do anything. i.e.

x, err := myFunc(1)
y, err = myFunc(2)

This will call out that the first function's call error was never
used.

* Fix makefile, add misspell to makefile
2018-06-28 19:12:02 +02:00
Joon 6018e719d2 Merge PR #1069: Oracle Module
fix prefixstore iterator
in progress
fix mock validator
fix NewContext
add to changelog
apply requests
fix mock
2018-06-27 19:21:12 +02:00
Dev Ojha 2e97baabf6 Merge PR #1358: Fix typos and gofmt files
* Fix typos
* gofmt -s files
* Add mispellings and gofmt checks to circle CI
* circleci: Install misspell in the linting step
2018-06-25 20:23:17 +02:00
Joon 3fa68249eb Merge PR #1254: Add prefixstore and lib refactor
* Merge pull request #1254: add prefixstore and lib refactor
add prefixstore
refactor lib
fix test
fix linter
in progress
in progress
add test for prefixstore
add KVStoreGetter, PrefixStoreGetter
move PrefixStoreGetter to types/
add tests
KVStore.Prefix(string) -> KVStore.Prefix([]byte)
fix mock
apply requests
pass lint, add test
apply requests
* Remove unnecessarily 'valid' boolean
2018-06-21 23:33:36 +02:00
David Kajpust ec2fedd36c Merge PR #1227: Set all Error strings 1st letters to lowercase. Fixes issue #1154 2018-06-13 21:13:22 +02:00
sunnya97 caf8c77dce works 2018-05-26 18:00:39 -07:00
Christopher Goes ce38d8f423
Minor fix, testcases 2018-05-16 01:14:31 +02:00
Christopher Goes 147cf9f897
Move GasKVStore to /store 2018-05-16 01:14:30 +02:00
Christopher Goes 1c4ed7b833
Gas-wrap ctx.KVStore 2018-05-16 01:13:48 +02:00
Christopher Goes 9dfccb1cfd
Update iterator gas pricing model 2018-05-16 01:13:48 +02:00
Christopher Goes ef1923f660
Add GasIterator 2018-05-16 01:13:48 +02:00
Christopher Goes c410ceb155
GasKVStore WIP 2018-05-16 01:13:48 +02:00
rigelrozanski 677559bf6c cwgoes comments 2018-05-09 18:24:51 -04:00
rigelrozanski 8dd3052017 fix subspace query tests 2018-05-08 16:32:41 -04:00
rigelrozanski 1d82cdbbbc subspace query tests, changelog 2018-05-08 16:15:35 -04:00
rigelrozanski d464779d34 iter->substore, enable delegator bonds query 2018-05-08 15:57:12 -04:00
rigelrozanski d44c7afa30 add range queries, add candidates query 2018-05-08 15:57:12 -04:00
rigelrozanski d28efaac27 many renames / golint compliance 2018-04-19 00:49:24 -04:00
Christopher Goes f8e44b5b00 Error codespacing (#809)
* Initial codespacing layout (ref #766)
* Add codespace to Router (ref #766)
* Implement Codespacer and update modules
* Default codespaces, testcases
* Update error formatting, codespacer tests
* Add RegisterOrPanic testcase
* Update CHANGELOG
2018-04-17 19:16:21 -07:00
Jae Kwon d530ee2abc Fix MountStoreWithDB(); Bump to 0.15.0-rc0 2018-04-13 02:04:31 -07:00
Jae Kwon 186ee72c0c Update documentation 2018-04-12 16:22:44 -07:00
Jae Kwon 5883c0e942 Support namespacing within RMS db 2018-04-12 15:56:41 -07:00
Sunny Aggarwal 348e28a4b5
Merge branch 'develop' into sunny/IAVLsubspace 2018-04-05 22:02:21 +02:00
Sunny Aggarwal f10983ba06 address review 2018-04-05 21:54:30 +02:00
Christopher Goes 0888096677
Replace Result.ToQuery with Error.QueryResult (closes #765) 2018-04-03 22:15:52 +02:00
Sunny Aggarwal c441ccdf01 added more test 2018-04-01 18:00:28 +02:00
Sunny Aggarwal d98ea3764f it works 2018-04-01 00:26:00 +02:00
Sunny Aggarwal 3f1362f838 why u no work 2018-04-01 00:02:29 +02:00
Sunny Aggarwal 271d240897 trying to figure it out 2018-03-31 19:30:25 +02:00
Sunny Aggarwal 56f28145dd working on it 2018-03-30 22:36:04 +02:00
Ethan Buchman f81b6ec51d update dep 2018-03-23 00:32:57 -04:00
Ethan Buchman 723889570e ErrTxParse->ErrTxDecode; check for empty bytes in account and tx 2018-03-21 02:44:17 +01:00
Sunny Aggarwal 7e8c1e3394 added Substore 2018-03-19 22:46:35 +01:00
Ethan Buchman 630a5fe579 revert to old go-wire 2018-03-02 04:24:07 -05:00
Jae Kwon 7f4bcff3cf Add GetCommitKVStore and CommitKVStore 2018-02-21 09:49:33 -05:00
Adrian Brink b457a4363f
Add directive to Sprintf call to pass make test on go1.10 2018-02-18 14:09:22 +01:00
Ethan Buchman f6cea66e2e test and fix InitChain 2018-02-17 16:32:30 -05:00
Ethan Buchman d48c819207 minor things 2018-02-06 17:20:29 -05:00
Ethan Frey b21081c83a Test query routing in rootMultiStore 2018-02-06 17:20:29 -05:00
Ethan Frey c73f08c845 Make GetStoreByName private, as only needed by MultiStore Query 2018-02-06 17:20:29 -05:00
Ethan Frey 44c39043f1 Test iavlStore query 2018-02-06 17:20:29 -05:00
Ethan Frey 31f00742e5 Add query to iavl store 2018-02-06 17:20:29 -05:00
Ethan Frey 512c601adc Add tests for query path routing 2018-02-06 17:20:29 -05:00
Ethan Frey bc325c4d1c Add Query routing to rootMultiStore 2018-02-06 17:20:29 -05:00
Ethan Frey 57b28d95de Add GetStoreByName to MultiStore to help with Query lookups 2018-02-06 17:20:29 -05:00
Jae Kwon c6bad0b325 Add first Basecoin test harness 2018-01-26 06:54:03 -08:00
Jae Kwon be665d53fe Substore->Store; BaseApp has db; Mapper 2018-01-22 06:20:46 -08:00
Jae Kwon 68e04e629a Do not use global wire.Marshal* 2018-01-21 19:48:19 -08:00
Jae Kwon 14a0dce920
Refactor basecoin example (#332)
Refactor basecoin example
2018-01-17 16:59:40 -08:00
Ethan Buchman 48a864f93d store: fix tests 2018-01-15 20:10:46 -05:00
Ethan Buchman 381424460c basecoin compiles 2018-01-14 22:49:57 -05:00
Ethan Buchman 5e46eea616 types and store compile 2018-01-12 19:17:17 -08:00
Ethan Buchman 2c1d5332be make test/install 2018-01-06 15:53:31 -05:00
Ethan Buchman 1d07f88867 new basecoin example 2018-01-03 20:20:21 -05:00
Jae Kwon 657820372c App compiles. Ready to build on it 2017-12-26 17:04:48 -08:00
Jae Kwon 1afab45cf5 Move store/types.go to types/store.go and alias 2017-12-21 20:05:41 -08:00
Jae Kwon cd278dea6c Fix dependency in store 2017-12-21 19:48:29 -08:00
Jae Kwon 45c2e9c30b curVersion -> nextVersion 2017-12-21 03:44:27 -08:00
Jae Kwon 6f9a08d921 Conform to new tmlibs Iterator 2017-12-21 03:44:04 -08:00
Jae Kwon 1ec9e2e0ae Commit, and working on InitState/SetOpetion 2017-12-21 03:41:40 -08:00
Jae Kwon d681049023 CommitMultiStore, and SetCommitStoreLoader->SetSubstoreLoader 2017-12-21 03:39:00 -08:00
Ethan Buchman 72b0ed004b wip: tests and fixes for kvstore iteration 2017-12-21 03:31:33 -08:00
Jae Kwon eb1f877d3d
KVStore refactor (#303)
I removed that stuff about cwwMutex and CacheWraps expiring. It was unnecessary complexity given that users need not write concurrent logic. If you have 2 CacheKVStores and you Write on one and later you Write on the other one, they will both write, and strange things may happen. But that’s OK, it’s kinda the expected (unsurprising) behavior. And now the code is much simpler.

Also I got rid of IterKVStore. It’s not necessary to distinguish them because we can have KVStore.Iterator() return nil or panic or an empty iterator. Further simplification…

KVStore.CacheKVStore() doesn’t exist. No need, just call NewCacheKVStore(parent).

Originally I wanted the .CacheKVStore() method because you can make the implementor be responsible for ensuring that returned CacheWraps don’t trample each other. But as written previously this complicates the code a lot more and it isn’t strictly necessary. It’s a kind of magic that maybe should just be avoided.

sdk.Iterator is dbm.Iterator. The plan is to conservatively add more aliases into the “sdk” namespace.

GetError() is removed from Iterator. We need to just panic to be consistent. More simplification.
2017-12-12 20:13:51 -08:00
Ethan Buchman 1a28c4b89c store: add some tests, fix deadlocks (#297) 2017-12-11 23:36:50 -08:00
Jae Kwon af7a621440
cacheMergeIterator (#298) 2017-12-11 23:30:44 -08:00
Jae Kwon 04fcc6193c
iavlIterator using goroutine (#295) 2017-12-10 00:24:55 -08:00
Jae Kwon f4484ab3b5 Implementing iavlStore... 2017-12-09 12:35:51 -08:00
Jae Kwon a47da2c8e1 store/* fixes 2017-12-04 00:56:25 -08:00
Jae Kwon 1d207a2a5e Fixing store/* bugs... 2017-12-04 00:23:10 -08:00
Jae Kwon 0917fc3de7 rootMultiStore holds lastCommitID 2017-12-03 23:17:10 -08:00
Jae Kwon 8db15fe3ef Committer -> CommitStore; CacheWrap() 2017-12-03 22:55:15 -08:00