4276 Commits

Author SHA1 Message Date
z-bowen
d5a0c87e49 Problem: Changes to format for validator keys broke some tests
Solution: Aligned the tests to reflect the changed key format
2018-09-07 14:15:35 +02:00
z-bowen
a6f6b81254 Merge branch 'abstract_election_class' into generalize-election-management-commands 2018-09-07 11:46:06 +02:00
z-bowen
eae7182823 Merge remote-tracking branch 'upstream/master' into abstract_election_class 2018-09-07 11:35:15 +02:00
z-bowen
38fcd4d792 Problem: Minor style issues with PR
Solution: Addressing comments
2018-09-06 17:27:02 +02:00
z-bowen
2eb32d93f6 Problem: Election class variable to VOTE_TYPE unnecessary
Solution: Removed the variable and hardcoded everything to use the `Vote` class
2018-09-06 17:16:12 +02:00
Vanshdeep Singh
cbfbfa8fc4 Problem: Public key format not standardized (#2508)
Solution: Add 'type' field to public key so that it can be decoded properly
2018-09-06 16:06:36 +02:00
Lev Berman
699494613f Problem: The commit mode behaves incorrectly. (#2510)
* Problem: The commit mode behaves incorrectly.

Solution: Parse the Tendermint response properly. The functionality was disabled in https://github.com/bigchaindb/bigchaindb/pull/2235/files#diff-c6511560546a7dc577e7e647b5bfdaceL68 and was not fixed since then.

* Add a test case for the sync mode.

* Do not strictly expect deliver_tx in the response.

* Fix post_mock in web/test_transactions.py.

* Check for the error field first.
2018-09-06 15:49:00 +02:00
Vanshdeep Singh
2656302c60 Problem: Bigchaindb crashes when restarted after init chain (#2519)
Solution: Return appropirate height so that Tendermint doesn't execute
init_chain more than once
2018-09-06 11:27:52 +02:00
z-bowen
35bd61c5d2 Merge branch 'abstract_election_class' into generalize-election-management-commands 2018-09-05 17:26:47 +02:00
z-bowen
fdacca7976 Problem: Multiple small issues with style etc.
Solution: Addressed comments from PR
2018-09-05 17:24:01 +02:00
Lev Berman
9bf09324df Problem: Txs posted in async/sync can be lost. (#2514)
Solution: Document when the transactions posted in the async and sync modes can be lost. Describe how they are stored. Mention that BigchainDB does not store or expose rejected transactions.
2018-09-05 17:18:17 +02:00
vrde
f6bee3b63e Problem: default config is slow (#2516)
Solution: update the suggested `config.toml` file to increase the
allowed network speed, and avoid rechecking transactions.
2018-09-05 16:04:37 +02:00
z-bowen
b1c9d7de86 Problem: Default for show_election not implemented for Election class
Solution: Create a default method that work if all fields in the 'asset[data]' can be displayed without additional formatting
2018-09-05 14:10:24 +02:00
z-bowen
5cde9c8b08 Problem: Command line options for upsert-validator can be generalized to manage any type of election
Solution: Refactored the CLI to manage generalized elections
2018-09-05 13:27:45 +02:00
z-bowen
abc74579cd Merge branch 'abstract_election_class' into generalize-election-management-commands 2018-09-05 11:53:46 +02:00
z-bowen
b6a5150da9 Merge branch 'master' into abstract_election_class 2018-09-05 10:52:23 +02:00
Zachary Bowen
bee9468bd0 Problem: test_make_sure_we_dont_remove_any_command does not check for upsert-validator show (#2499).
Solution: Extend the test.
2018-09-05 10:51:32 +02:00
z-bowen
0c64fbfb5d Problem: Election class variable ELECTION_TYPE is overly specific
Solution: Renamed `ELECTION_TYPE` to `OPERATION`
2018-09-05 10:41:05 +02:00
z-bowen
331b52cc4c Problem: Schema still refers to ValidatorElectionVote instead of Vote
Solution:  Renamed `TX_SCHEMA_VALIDATOR_ELECTION_VOTE` as `TX_SCHEMA_VOTE`
2018-09-05 10:36:44 +02:00
z-bowen
7d756bf1a9 Problem: Hardcoded reference to the VOTE_TYPE in Election base class
Solution: Pointed the reference to the class variable
2018-09-04 17:23:24 +02:00
z-bowen
30a5b9374d Problem: Error in docstring return signature
Solution: Fixed the docstring
2018-09-04 17:21:48 +02:00
z-bowen
1e3caf8ccd Problem: UpsertValidatorVote can be generalized to just be Vote
Solution: Renamed, refactored and moved the `Vote` class to tie in with the more general `Election` base class
2018-09-04 17:13:34 +02:00
z-bowen
84a7cf7657 Problem: Election class needs to be updated to store concluded elections in the elections table
Solution: Updated the class to use the new table
2018-09-04 15:58:35 +02:00
Vanshdeep Singh
af2b5424c0 Problem: Cryptoconditions not pinned which is casuing build failure (#2512)
Solution: Pin cryptoconditions so that docs build properly
2018-09-04 15:45:48 +02:00
Vanshdeep Singh
cb22557771 Problem: Validation code not optimized (#2490)
Solution: memoize data
2018-09-04 15:30:52 +02:00
z-bowen
fe8eb84cf7 Merge branch 'master' into abstract_election_class 2018-09-04 15:06:03 +02:00
Troy McConaghy
c72c7a4626 Problem: tests/README.md either wrong or redundant (#2479)
The information on that page was either wrong or redundant, so I either deleted it or linked to where to find the same information in the docs about contributing to BigchainDB.
2018-09-04 13:31:00 +02:00
Troy McConaghy
f8bb29535a
Problem: Code Reference docs hidden in appendices (#2473)
Solution: Move the Code Reference docs into their own section
2018-09-04 12:17:27 +02:00
z-bowen
e7dae7db72 Problem: Need a table to store data for all elections
Solution: Created the `elections` table with secondary_index `election_id`
2018-09-04 12:08:16 +02:00
z-bowen
b468504bfc Problem: Missed a method in Bigchain class when updating the naming for an election method
Solution: Finished the refactoring
2018-09-04 11:12:51 +02:00
z-bowen
bd76b31e40 Revert "Problem: No need to store different types of elections in their own tables"
This reverts commit db45374d3c690429d18a25bcc319f8056c016500.
2018-09-04 10:55:23 +02:00
Lev Berman
230a5b2d69 ABCI chain migration conclusion (#2488)
* Problem: No good way to check for val set absence.

Solution: Make get_validator_set/get_validators return None/[] when there are no validators yet.

* Problem: Incompatible ABCI chain upgrades.

Solution: Record known chains and sync through InitChain. Triggering the migration and adjusting other ABCI endpoints will follow.
2018-09-03 15:41:49 +02:00
Lev Berman
fe0a4c494b
Problem: No MongoDB support for election ID index. (#2507)
Solution: Election ID has to be unique but not every validator set record has it. MongoDB does not support partial indexes, does not even allow for multiple Nones. This is a temporary fix since we are introducing an `election` collection to store election IDs in #2498.
2018-09-03 15:09:16 +02:00
Muawia Khan
8e55b11da2 Problem: cyrptoconditions dependency updated because of vulnerability (#2494)
* Problem: cyrptoconditions dependency updated because of vulnerability CVE-2018-10903

* update cc to ~=0.7.2

* Fix test using b58encode

* Fixing some more tests failing because of base58 update
2018-09-03 13:25:58 +02:00
z-bowen
db45374d3c Problem: No need to store different types of elections in their own tables
Solution: Remove `DB_TABLE` property from `Election` class
2018-09-03 12:45:37 +02:00
z-bowen
560a8154b7 Problem: Responding to a suggestion for improved method naming
Solution: Refactored `get_result_by_election_id` to `get_election_result_by_id`
2018-09-03 12:00:06 +02:00
Troy McConaghy
80b6881797 Problem: Docs page 'BigchainDB and Smart Contracts' is stale (#2504)
Solution: Update that page to reflect our current thinking on how BigchainDB relates to smart contracts
2018-09-02 00:23:17 +02:00
Troy McConaghy
905b1a5141
Problem: Root docs page about decentralization has two incorrect sentences (#2505)
Solution: Delete them
2018-08-31 20:43:08 +02:00
Muawia Khan
cf1f253019 Update bigchaindb-driver version -> 0.5.2 in acceptance test (#2503) 2018-08-31 16:56:34 +02:00
Troy McConaghy
96932793b1
Problem: The docs about database.ssl are wrong (#2500)
Solution: Rewrite the docs about the database.ssl config setting
2018-08-31 15:27:35 +02:00
z-bowen
4a631ef3ae Problem: Adding base58 as a requirement seems to break the build...
Solution: Reverting the changes
2018-08-31 14:07:49 +02:00
z-bowen
3d67565bda Problem: ValidatorElection and MigrationElection need to inherit from a common Election class
Solution: Factored the common logic out of `ValidatorElection` and moved it to `Election` parent class
2018-08-31 13:56:55 +02:00
Shahbaz Nazir
2d1f670eec
Problem: BigchainDB has un-necessary code to initialize a replica set and check if MongoDB was started with replicaSet (#2491)
Solution: Remove un-necessary code. Deployment of MongoDB with or without replicaSet should be the responsibility of MongoDB admin which can and cannot be a BigchainDB node operator. As far as BigchainDB is concerned replicaset, if provided in bigchaindb configs, should be used to establish connection with MongoDB.
2018-08-31 13:54:32 +02:00
Shahbaz Nazir
cb418265b6
Problem: No documentation for hosted MongoDB (#2495)
Solution: Add documentation.
2018-08-31 13:24:04 +02:00
z-bowen
7de4226666 Merge branch 'master' into abstract_election_class 2018-08-31 10:31:47 +02:00
Zachary Bowen
cfc2c5900b Rework upsert-validator show status (#2496)
* Problem: We need to store the `election_id` as part of the `validator_update` so we can efficiently check which election was resposible for the change

Solution: Added the parameter to `store_validator_set` and aligned the tests

* Problem: Logic for `upsert-validator show` is convoluted

Solution: Rewrote the function to be much simpler

* Problem: Need a uniqueness constraint for election_id wrt validator changes

Solution: Added a new key to the db schema
2018-08-31 09:47:47 +02:00
Zachary Bowen
7a0b474d11 Problem: Users want to know upsert-validator election status.
Solution: Introduce the `upsert-validator show` command. Soon to be re-implemented via storing and querying identifiers of concluded elections.
2018-08-30 10:47:37 +02:00
Vanshdeep Singh
3cf368aab7 Problem: No unique indexes on transaction id and block height (#2492)
Solution: Created unique indexes when setting up the collections
2018-08-29 17:45:08 +02:00
vrde
3f7b521809 Problem: make unit-test-watch loops forever (#2486)
Solution: BigchainDB by default writes logs in the same directory it is
run. The `looponfail` feature provided by pytest waits for changes in
the current directory, so it is continuously triggered. This patch tells
pytest to only watch the `bigchaindb` and `tests` directories.
2018-08-29 14:14:47 +02:00
vrde
407b771185 Problem: validating create+transfer might crash the system (#2487)
Solution: if a TRANSFER transaction is validated after a CREATE
transaction, the system crashes with `AttributeError: 'NoneType' object
has no attribute 'txid'`.

This happens because querying `get_spent` checks the attributes `txid`
and `output` of `input.fulfills` for every transaction in the current
buffer (`current_transactions`). For a CREATE, `input.fulfills` is None,
so the check would fail.

The solution is to check if `input.fulfills` is defined. If not, then
the current transaction cannot spend any output, so we can safely skip
it.
2018-08-29 14:13:22 +02:00