37 Commits

Author SHA1 Message Date
Scott Sadler
7fd1de696c move voting logic out of block_election_status 2017-02-23 21:53:12 +01:00
libscott
c9ba7e6243 Merge branch 'master' into master 2017-02-22 12:20:35 +01:00
tymlez
78bd1ecd96 consensus plugin 2017-01-24 09:12:16 +00:00
Scott Sadler
bd048a3115 add flake8-quotes checker and cleanup double quotes 2017-01-23 17:30:37 +01:00
Brett Sun
8fa3245309 Rename any *util.py to *utils.py (#991) 2016-12-22 17:39:39 +01:00
Scott Sadler
4f83fce39d address some PR comments on coding style 2016-12-12 15:15:38 +01:00
Scott Sadler
f2e6e4d13d add tests to get coverage of consensus.py 2016-12-12 15:15:38 +01:00
Scott Sadler
ef5f3ddd28 better logging and arrangement for vote verification 2016-12-12 15:15:38 +01:00
Scott Sadler
c43bf10151 add call to vote schema validate in consensus.py 2016-12-12 15:15:38 +01:00
Sylvain Bellemare
50b0b3cef2 Rebase/feat/586/integrate tx model (#641)
* Adjust imports to bigchaindb_common

* Adjust get_spent function signature

* Adjust block serialization

* Fix BigchainApi Test

* Fix TestTransactionValidation tests

* Fix TestBlockValidation tests

* WIP: TestMultipleInputs

* Adjust tests to tx-model interface changes

- Fix old tests
- Fix tests in TestMultipleInputs class

* Remove fulfillment message tests

* Fix TransactionMalleability tests

* Remove Cryptoconditions tests

* Remove create_transaction

* Remove signing logic

* Remove consensus plugin

* Fix block_creation pipeline

* Fix election pipeline

* Replace some util functions with bdb_common ones

- timestamp ==> gen_timestamp
- serialize.

* Implement Block model

* Simplify function signatures for vote functions

Change parameter interface for the following functions:

- has_previous_vote
- verify_vote_signature
- block_election_status

so that they take a block's id and voters instead of a fake block.

* Integrate Block and Transaction model

* Fix leftover tests and cleanup conftest

* Add bigchaindb-common to install_requires

* Delete transactions after block is written (#609)

* delete transactions after block is written

* cleanup transaction_exists

* check for duplicate transactions

* delete invalid tx from backlog

* test duplicate transaction

* Remove dead code

* Test processes.py

* Test invalid tx in on server

* Fix tests for core.py

* Fix models tests

* Test commands main fn

* Add final coverage to vote pipeline

* Add more tests to voting pipeline

* Remove consensus plugin docs and misc

* Post rebase fixes

* Fix rebase mess

* Remove extra blank line

* Improve docstring

* Remove comment

handled in bigchaindb/cryptoconditions#27;
see https://github.com/bigchaindb/cryptoconditions/issues/27

* Fix block serialization in block creation

* Add signed_ prefix to transfer_tx

* Improve docs

* Add library documentation page on pipelines

* PR feedback for models.py

* Impr. readability of get_last_voted_block

* Use dict comprehension

* Add docker-compose file to build and serve docs

locally for development purposes

* Change private_key for signing_key

* Improve docstrings

* Remove consensus docs

* Document new consensus module

* Create different transactions for the block

* Cleanup variable names in block.py

* Create different transactions for the block

* Cleanup variable names in block.py
2016-09-29 10:29:41 +02:00
Sylvain Bellemare
6f159d3930 Closes #348 (#578) 2016-08-19 16:00:18 +02:00
Ryan Henderson
47e1b3cf4e treat genesis block as valid (#433) 2016-07-14 10:31:10 +02:00
Rodolphe Marques
a66a18b0d4 Pass a custom bigchain instance to util.sign_tx 2016-06-29 16:47:58 +02:00
Sylvain Bellemare
ac680cf5e9 Test consensus (#398)
* Remove unused import

* Simplify and group the imports

* Add extra space (pep 8)

* Remove NotImplementedError

the class BaseConsensusRules implements verify_vote_signature

* Add test module for consensus module
2016-06-28 14:19:07 +02:00
troymc
cd7070722f Renamed Bigchain.federation_nodes as Bigchain.nodes_except_me 2016-06-16 16:58:01 +02:00
Ryan Henderson
9f03b2b771 add election class, process starts (#221)
* add election class, process starts

* remove else clause

* resolve splitvote

* move quorum check to core

* remove comments

* fixed vote counting

* add test

* poison pill

* queue test

* generalize election status

* get correct part of block

* clean shut down

* test block liquidation

* add vote signature checking

* add tests

* user_public_key to user_vk

* python3 style floordivs

* correct verdict for odd number of voters, and tests

* remove whitespace

* simplify verify_vote_signature

* election checks pubkey is in block voters

* tests for elector pubkey

* count invalid votes as votes for invalid block

* test update

* test mismatched vote, block sigs

* variable name change

* comments on voting logic

* comments on voting logic

* remove unused queue

* correct block model

* imperative docstring

* election status class constants

* election tests use constants
2016-05-19 14:03:52 +02:00
diminator
da97c4c6b5
docstring update 2016-05-10 17:20:11 +02:00
diminator
a75eec9ad1
abstractmethod cleanup
docs update
2016-05-10 17:18:49 +02:00
diminator
ca34b58629
rename verify_signature to validate_fulfillments 2016-05-10 17:12:38 +02:00
Dimitri De Jonghe
4f28e873dc Merge pull request #233 from bigchaindb/bug/229/check-block-signature-and-pub-key
validate_block now checks if a federation node created the block.
2016-05-03 11:24:39 +02:00
Rodolphe Marques
1813c26879 validate_block now checks if a federation node created the block.
It checks to see if node_pubkey is a federation node and if the
signature is correct.

Created tests
2016-04-28 13:54:50 +02:00
diminator
8775e7e8d7
added get_hash_data() 2016-04-13 10:36:46 +02:00
diminator
32ca586bc8
Added condition/fulfillment tests
isolated get_fulfillment_message(...)
2016-04-11 15:15:47 +02:00
diminator
8dc0c48681
fixed tests 2016-04-08 15:56:51 +02:00
diminator
8b7478365e
fixing tests WIP 2016-04-08 14:43:11 +02:00
diminator
a7ca11a593
Merge remote-tracking branch 'remotes/origin/feat/128/multiple-input-output' into feat/127/crypto-conditions-ilp-bigchain-integration
Conflicts:
	bigchaindb/core.py
2016-04-07 15:43:35 +02:00
Rodolphe Marques
ade6bfb1c0 Updated validate_transaction to work with crypto conditions.
Updated get_spent to work with multiple inputs
2016-04-07 15:38:38 +02:00
diminator
ce945e3409
Merge remote-tracking branch 'remotes/origin/feat/128/multiple-input-output' into feat/127/crypto-conditions-ilp-bigchain-integration
Conflicts:
	bigchaindb/consensus.py
	bigchaindb/util.py
2016-04-06 16:27:56 +02:00
Rodolphe Marques
784350a5c8 updated validate transaction. Fixed genesis block 2016-04-06 16:20:36 +02:00
diminator
dd20737bb9 Merge remote-tracking branch 'remotes/origin/feat/128/multiple-input-output' into feat/127/crypto-conditions-ilp-bigchain-integration
Conflicts:
	bigchaindb/util.py
2016-04-06 12:41:56 +02:00
diminator
ce1302dd90 imports from crypto 2016-03-31 15:10:43 +02:00
diminator
4138842eed import keys from cryptoconditions
set ed25519 as default
2016-03-23 19:14:59 +01:00
Rodolphe Marques
194bf8c6bd initial implementation of multi input support 2016-03-22 19:30:53 +01:00
Matt Smith
2aa003578c Typos 2016-03-18 16:50:21 -07:00
Matt Smith
a5243e43f6 This large (sorry) commit
1. switches from a composable plugin model to a single-plugin model
2. switches class methods to static methods in the BaseConsensusRules class
3. adds create_transaction, sign_transaction, and verify_transaction to
the plugin API

TODO: If we adopt this model, all references in e.g. client.py to util
methods like `sign_tx` need to be routed through the plugin methods, and
possibly need to be added to the plugin interface.
2016-03-08 18:33:31 -08:00
Matt Smith
14b71537d6 Made AbstractConsensusRules use python's abc and enforcing that ConsensusRules plugins subclass it 2016-03-08 18:32:25 -08:00
Matt Smith
01d706ac56 Moved consensus package files into single consensus.py module 2016-03-08 18:24:21 -08:00