* 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.
* 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.
* 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 -*-
* Problem: Node operator cannot vote on a ValidatorElection
Solution: Implement validator election voting spec
* Problem: Incorrent code comments
Solution: Update comments with correct context
* Problem: Delegated vote not casted back to election
Solution: Update test to cast votes back to election id and assert their validity
- Created three new JSON Schema files for the v2.0 transaction schema, based on the v1.0 files. The only change is the allowed value of version (from "^1\\.0$" to "^2\\.0$").
- I didn't delete the v1.0 JSON Schema files because we might want those some day (to validate old transactions).
- Updated the __init__.py in the directory with the JSON Schema files so that it now uses the version 2.0 JSON Schema files.
- Updated all relevant tests. I only found one, in tests/validation/test_transaction_structure.py
- Updated VERSION in common/transaction.py
- Checked to make sure the example HTTP API docs show "version" with value "2.0". They do.
- Updated the docs page about "The Transaction Model". It just points to the IPDB Transaction Spec.
- If someone submits a transaction with "version" having value "1.0" then the error message comes from the JSON Schema checker.
Commit messages for posterity:
* wip transaction schema definition
* test for SchemaObject
* test SchemaObject definions meta property
* schema documentation updates
* test for basic validation
* commit before change to .json file definiton + rst generation
* move to straight .json schema, test for additionalProperties on each object
* add asset to transaction definiton
* remove outdated tx validation
* make all tests pass
* create own exception for validation error and start validating transactions
* more tx validation fixes
* move to yaml file for schema
* automatic schema documentation generator
* remove redundant section
* use YAML safe loading
* change current_owners to owners_before in tx schema
* re-run tests and make correct yaml schema
* fix some broken tests
* update Release_Process.md
* move tx validation into it's own method
* add jsonschema dependency
* perform schema validation after ID validation on Transaction
* Release_Process.md, markdown auto numbering
* remove old transaction.json
* resolve remaining TODOs in schema docuementation
* add `id` and `$schema` to transaction.yaml
* add transaction.yaml to setup.py so it gets copied
* address some concernes in PR for transaction.yaml
* address more PR concerns in transaction.yaml
* refactor validtion exceptions and move transaction schema validation into it's own function in bigchaindb.common.schema.__init__
* add note to generated schema.rst indicating when and how it's generated
* move tx schema validation back above ID validation in Transaction.validate_structure, test that structurally invalid transaction gets caught and 400 returned in TX POST handler
* remove timestamp from transaction schema index
* Add README.md to bigchaindb.common.schema for introduction to JSON Schema and reasons for YAML
* Use constant for schema definitions' base prefix
* Move import of ValidationError exception into only the tests that require it
* Move validate transaction test helper to tests/common/util.py
* move ordered transaction schema load to generate_schema_documentation.py where it's needed
* use double backticks to render terms in schema docs
* change more backticks and change transaction version description in transaction schema
* make details a mandatory property of condition
* Many more documentation fixes
* rename schema.rst to schema/transaction.rst
* Fix documentation for Metadata
* Add more links to documentation
* Various other documentation fixes
* Rename section titles in rendered documentation
* use to manage file handle
* fix extrenuous comma in test_tx_serialization_with_incorrect_hash args
* 'a' * 64
* remove schema validation until we can analyze properly impact on downstream consumers
* fix flake8 error
* use `with` always