Commit Graph

282 Commits

Author SHA1 Message Date
David Dashyan 9e99c024d3
Replace headers (#2683)
Signed-off-by: David Dashyan <mail@davie.li>
2020-04-06 11:52:18 +02:00
David Dashyan 7df59994e9 Tendermint v0.22.8 backward compatibility (#2677)
Problem statement:

BigchainDB v2.0.0b9 has been around for quite a while. Recently we have updated
Tendermint supported version to v0.31.5 which has incompatible blockchain.
Despite the fact that we have defined instructions on chain migration, no one
expected to migrate to incompatible chain within patch version range. So there
is a demand for Tendermint v0.22.8 compatibility among BigchainDB users.

Work has been done:

bigchaindb-abci package was upgraded to support multiple API versions.
New configuration field stating tendermint version was added.

Signed-off-by: David Dashyan <mail@davie.li>
2020-01-23 23:17:27 +01:00
Jürgen Eckel 9bcefdf3e2
Tendermint upgrade (#2666)
* migrated to tendermint 0.35.1

* increased bigchaindb_abci version

* fixed API adjustments due to Tendermint upgrade

Signed-off-by: Juergen Eckel <juergen@riddleandcode.com>

* migrated to bigchaindb-abci == py-abci 0.7.1

Signed-off-by: Juergen Eckel <juergen@riddleandcode.com>
2019-10-07 16:32:35 +02:00
Lev Berman 0c4d6ec906 Implement crash recovery for elections. (#2566)
1. Save pre-commit state in the beginning of end block. 
2. Provide an interface for custom elections to rollback on crash recovery. 
3. Simplify pre-commit management. 
4. Add crash recovery for updert-validator and chain migration elecitons.
2018-09-28 12:32:45 +02:00
Lev Berman 24ca0b32a9 Separate pending and effective validator updates. (#2556)
* Separate pending and effective validator updates.

- Pending validator updates do not prevent elections from concluding.
- ValidatorElection overrides has_conclude to not conclude when there is a pending update for the matching height.
- Effective validator updates deem past elections inconclusive.

* Problem: Looking for election block is inefficient.

Solution: Record placed elections, update the records upon election conclusion.

* Clarify the conclusion order in Election.process_blocks.

* Insert election records in bulk.

Otherwise, one can significantly slow nodes down by posting a whole bunch of unique elections.

* Change get_election to use find_one.

* Calculate total votes without making extra query.

* Fix the pending valset check.

* Fix election test setup.
2018-09-21 10:51:57 +02:00
Troy McConaghy 39be7a2fdf
Renamed "consensus" to "validation" where relevant (#2561) 2018-09-20 17:17:33 +02:00
Muawia Khan eb139fba00 Remove benchmark logging (#2565).
* Problem: Benchmark logging is not needed.

* Solution: Clean it up.
2018-09-20 14:30:30 +02:00
Zachary Bowen e6893632dc Create migration election class (#2535).
* Problem: We need a way to synchronize a halt to block production to allow for upgrades across breaking changes.

* Solution: Created `MigrationElection`.

* Problem: Need documentation for `migration` elections.

* Solution: Updated the docs.

* Problem: `MigrationElection` needs 'new' CLI method.

* Solution: Updated the definition of `election` to include the new `migration` type.

* Problem: The way `end_block` checks for concluded elections assumes there is only one type of election (so we can't conclude an `upsert-validator` and a `chain-migration` at the same height).

* Solution: Re-engineered the code in `Elections` to conclude multiple elections in the same block. If more than one election change the validator set, only one of them is applied.

* Problem: Tendermint change to store validator changes at height h+2 will break `Election.get_status`.

* Solution: Reworked `get_validator_change` to look at only the latest block height or less.
2018-09-17 13:59:57 +02:00
Muawia Khan bd39076522 Problem: Users trying to use an incompatible version of Tendermint (#2541)
-  Hard-wire the supported Tendermint version(s) right in the code of BigchainDB Server. Check the version of Tendermint and disconnect if Tendermint version is an unsupported one.
- Expose a CLI command bigchaindb tendermint-version to display the supported Tendermint versions.
- PR also takes care the long list of warnings we get when we run tests.
    - Updated deprecated pymongo methods
    - Do not call pytest fixtures directly.
    - Also added the doc for the new cli command
2018-09-14 15:37:18 +02:00
vrde 4b54e702f8 Problem: Events API is unreliable (#2529)
Solution: Stop getting events from the Tendermint events API. Get the
event right before returning from the COMMIT phase of Tendermint, and
publish it to the events queue.
2018-09-12 16:55:23 +02:00
Zachary Bowen 0fe749d830 Create abstract election class (#2498).
* 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.

* Problem: No need to store different types of elections in their own tables

Solution: Remove `DB_TABLE` property from `Election` class.

Solution: Created the `elections` table with secondary_index `election_id`.

* 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.

* Problem: `election_id` is not unique if two elections have the same properties.

Solution: Added a random `uuid4` seed to enforce uniqueness.
2018-09-11 15:39:46 +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
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
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
Vanshdeep Singh 01dba7e883 Problem: Cannot conclude validator election (#2445)
Solution: Gather votes and conclude election when supermajority is achieved
2018-08-20 16:57:32 +02:00
Troy McConaghy abdd23f5a6 Problem: Source files contain no license info (#2455)
* Problem: Source files contain no license info

Solution: Add comments with SPDX license info to source files

* Python 3 files don't need # -*- coding: utf-8 -*-
2018-08-16 12:31:32 +02:00
Vanshdeep Singh 2e9a9b1121 Problem: Validator set not tracked by BigchainDB (#2436)
* Problem: Validator set not tracked by BigchainDB

Solution: BigchainDB depends on tendermint's RPC API to get the validator set
which is not avaiable during replay so the validators set should be tracked
inside BigchainDB

* Problem: Unclear code and documentation

Solution: Fix decode_validator and docs strings

* Problem: Doc strings missing

Solution: Add doc string for store_validato_set
2018-08-06 11:37:43 +02:00
Zachary Bowen 2386ca9d71 Refactor tendermint directory to project root (#2401)
* Problem: core.py contains an unused class, `Bigchain`

Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.

* Problem: core.py contains an unused class, `Bigchain`

Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.

* Fixed flake8 complaint about too many blank lines

* Attempting to fix Sphinx docs. This may result in some redundant commits, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!

* Attempting to fix Sphinx docs. This may result in some redundant commits, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!

* Updating from master changed BigchainDB.process_post_response to a private method, so I had to align with that.

* Fixed a couple stale references to bigchaindb.Bigchain in docstrings

* Missed a reference to `Bigchain` in a patch call...

* Problem: BigchainDB class should be part of project root

Solution: Removed the /tendermint directory and moved its contents to project root

* Problem: Flake8 complained that imports were not at the top of the file

Solution: Had to play around with the order of imports to avoid cyclic dependencies, but its working and style compliant now

* Problem: Stale reference to /tendermint directory in the index

Solution: Removed the references to /tendermint

* Problem: Flake8 complaining of unused import in __init__.py

Solution: The import is there so I can import App directly from bigchaindb, rather than from bigchaindb.core (which I think improves code readability. I added a # noqa to silence Flake8.

* Problem: Stale references to `bigchaindb.tendermint.BigchainDB` in the rst files cause Sphinx to fail

Solution: Updated the autodoc files to use `bigchaindb.BigchainDB` instead

* Problem: Stale reference to the `tendermint` directory in an @patch in a disabled test

Solution: Updated the @patch for completeness

* Problem: BigchainDB class should be part of project root

Solution: Removed the /tendermint directory and moved its contents to project root

* Problem: Flake8 complained that imports were not at the top of the file

Solution: Had to play around with the order of imports to avoid cyclic dependencies, but its working and style compliant now

* Problem: Stale reference to /tendermint directory in the index

Solution: Removed the references to /tendermint

* Problem: Flake8 complaining of unused import in __init__.py

Solution: The import is there so I can import App directly from bigchaindb, rather than from bigchaindb.core (which I think improves code readability. I added a # noqa to silence Flake8.

* Problem: Stale references to `bigchaindb.tendermint.BigchainDB` in the rst files cause Sphinx to fail

Solution: Updated the autodoc files to use `bigchaindb.BigchainDB` instead

* Problem: Stale reference to the `tendermint` directory in an @patch in a disabled test

Solution: Updated the @patch for completeness
2018-07-25 16:59:25 +02:00
Zachary Bowen 4d2e58416c Problem: Bigchain class is unused and redundant (#2366)
* Problem: core.py contains an unused class, `Bigchain`

Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.

* Problem: core.py contains an unused class, `Bigchain`

Solution: Remove core.py. Refactor BigchainDB Class to remove inheritance from Bigchain.

* Fixed flake8 complaint about too many blank lines

* Attempting to fix Sphinx docs. This may result in some redundant commits, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!

* Attempting to fix Sphinx docs. This may result in some redundant commits, as I don't know what I'm doing, and I can't experiment without running the CI...

Sorry in advance!

* Updating from master changed BigchainDB.process_post_response to a private method, so I had to align with that.

* Fixed a couple stale references to bigchaindb.Bigchain in docstrings

* Missed a reference to `Bigchain` in a patch call...

* Merge with master and re-do some changes
2018-07-10 17:34:51 +02:00
Muawia Khan 1bad851e07
Problem: Tendermint configuration not present in BigchainDB config (#2342)
* Problem: Tendermint configuration not present in BigchainDB config

* Handle tendermint configurations properly

- Update docs

* Nitpick

* Missed some conflicts

* Make changes in tendermint/lib.py instead of deprecated core.py

- Also remove redundant info from docs about default values

* Fix docsserver automethod
2018-06-29 18:45:22 +05:00
codegeschrei 7449b026fa Problem: voting code is not used anymore (#2357)
* Problem: voting code is not used anymore
Solution: remove all voting related code

* Problem: Some voting functionality is still present.

Solution: Remove it. Update some of the related tests.

* Problem: some skipped tests are now running
Solution: remove pytest mark to not run them

* Problem: fastquery is not related to votes
Solution: remove it in another PR
2018-06-28 11:30:13 +02:00
Muawia Khan 2b39566a4b Problem: Some configurations are defunct (#2338)
* Problem: BigchainDB config has stale/deprecated parameters

- Remove `keyring` and `keypair` from config
- Update tests
- Add `tendermint` config

* Fix flake8

* Update some naming conventions and redundant changes

* Remove redundant routine `fast_query`

* Remove deprecated parameters and descriptions

* remove some more unwanted code

* Problem: Two flake8 errors made Travis fail

Solution: Fix the two flake8 errors

* Address comments

- Remove reference of nodes_except_me and me_private and me
  as attributes of BigchainDB instances
- Update and re-add test(s)
- Do not introduce `tendermint` in configuration instead handle that
  in a separate PR along with docs

* Address comments

- Remove tests that are already covered with 2.0
- Remove tests that are no longer relevant
- Add TODO for more cleanup

* Remove tendermint config from configure command
2018-06-08 15:50:50 +02:00
Troy McConaghy 241db4ee48 Problem: backlog_reassign_delay is defunct but still listed (#2332)
* Fixed 2 PEP257 compliance errors

* Upgrade Tendermint to 0.19.7 except for Docker image, which is still at 0.19.2

* Problem: backlog_reassign_delay is defunct but still listed

Solution: remove all mentions of & calls for backlog_reassign_delay
2018-06-04 12:19:24 +02:00
Ahmed Muawia Khan f537d061d5 Problem: Migrate-CLI changes were reverted because of travis changes (#2121)
* Testing tendermint docker compose for travis

* Typo tendermint*

* Re-do migrate cli changes

* don't skip event stream test

* Fix flake8 and unskip a test skipped during dev

* Revert styling changes made from editor

* skip a failing test case which was already disabled

* Remove reference to 'keypair' in commands
2018-03-09 13:08:37 +01:00
vrde 4157244df7 Problem: statsd config is no longer supported
Solution: remove monitoring code, completes #1138
2018-02-13 14:35:47 +01:00
Katha e377fb57af
Pre commit styling (#1914)
* run pre-commit and fix errors

* mention pre-commit in our guides
2017-11-30 15:04:14 +01:00
kansi 4eca26782c Change metadata model, fix tests and update docs 2017-11-14 00:13:06 +05:30
kansi 714c1782ac Support for metadata search api and its testing suite 2017-11-07 12:20:51 +05:30
kansi 94ce03cbec Decouple metadata from transaction 2017-11-07 10:50:07 +05:30
kansi d9d0585228 Added metadata table for mongodb 2017-11-06 20:20:06 +05:30
Ketan Bhatt 4056f315ae Rename validity to blocks_validity_status 2017-07-09 12:22:39 +05:30
Rodolphe Marques b523ba3fe5 Rename unspent -> spent in outputs endpoint
- If spent=None return all outputs
- If spent=True return only spent outputs
- If spent=False return only unspent outputs
- Updated documentation
- Add the ability to return only spent outputs in core
- Added and update tests
2017-06-16 10:31:46 +02:00
libscott 32fc9244e6 Benchmark for CREATE transactions (#1511)
* benchmark code, throughput stats collection with graphite

* benchmarks readme

* benchmark readme update with results

* Update README.md

* add comment on why 10000 backlog size in benchmark
2017-06-10 10:01:28 +02:00
libscott 479bb78d9b Merge pull request #1389 from bigchaindb/vote-order-bug
Resume voting on blocks in order
2017-06-01 12:48:22 +02:00
Tim Daubenschütz 8b7f86b63d Feat/1462/text search http api (#1471)
* Add assets text search endpoint

* Filter out assets from invalid transactions.

- Added the limit argument to limit the returned results
- Created and updated tests

* Added documentation for the assets endpoint.

- Added some docstrings

* Removed unnecessary fixtures
2017-05-30 11:21:26 +02:00
Scott Sadler 51be4be2f7 Merge remote-tracking branch 'origin/master' into vote-order-bug 2017-05-29 17:03:36 +02:00
Rodolphe Marques ef52c04808 Merge remote-tracking branch 'origin/master' into feat/1462/text-search 2017-05-29 13:07:38 +02:00
Rodolphe Marques 23954ccc8a Merge remote-tracking branch 'origin/master' into feat/1275/asset-decoupling 2017-05-24 12:44:04 +02:00
Rodolphe Marques cda8259e57 Fixed typos 2017-05-24 12:38:34 +02:00
Rodolphe Marques 285fc03ca9 Merge remote-tracking branch 'origin/master' into feat/1462/text-search 2017-05-24 11:59:49 +02:00
Rodolphe Marques 6900e86458 Filter out assets from invalid transactions
- Created docstrings
- Created tests
- Raise an exception when trying to use text search with RethinkDB.
2017-05-24 11:38:15 +02:00
Rodolphe Marques ce414e46f3 Added missing docstrings. Fixed typos. 2017-05-11 12:29:08 +02:00
Rodolphe Marques 92392b51a7 Initial implementation to decouple assets from transactions.
Most changes done to how we write and read blocks to the database.
Created schema, indexes and queries for mongodb.
Fixed tests.
2017-05-10 16:43:52 +02:00
Scott Sadler b4f14b26ce address nomenclature issues 2017-05-08 14:25:39 +02:00
Scott Sadler 5d767c1162 light refactoring to remove some redundancies and fix test coverage 2017-04-21 12:23:53 +02:00
Scott Sadler 4f99122758 fast unspents 2017-04-19 15:47:58 +02:00
Scott Sadler 3bb5973f60 fix block order bug 2017-04-12 17:29:17 +02:00
Rodolphe Marques de04dcda0c Fixed docstring.
Removed redundant `else` branch.
2017-04-06 16:07:35 +02:00
Rodolphe Marques 09a440ee91 Fix get_spent incorrectly raising CriticalDoubleSpent 2017-04-05 16:52:56 +02:00
Sylvain Bellemare 87eb070ed6 Refactor core.BigchainDB.get_outputs 2017-03-31 16:29:16 +02:00