-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for hard forks (BFT-420) (#65)
Added support for making hard forks in the chain. It works as follows: 1. Genesis struct is introduced which defines a fork. It includes: * the validator set * number of the first block of the fork and a parent hash (commitment to the chain built before the fork) * some information about the past forks (it will be removed once block syncing is upgraded) 2. BlockStore is equipped with genesis and it verifies that the inserted blocks are consistent with the genesis 3. nodes with different Genesis are unable to connect to each other (genesis hash is verified during a handshake) 4. BFT algorithm is restarted at each fork - views start from 0 again, all the quorum certificates from past forks get invalidated To perform a fork, use a `genesis.fork_set.push` method on the previous genesis and remove the blocks which do not belong to the new fork from the BlockStore. Additionally some refactoring has been performed: * consensusnet state now explicitly depends on gossipnet state * consensus message verification has been moved from bft crate to roles crate, so that quorum certificates can be verfied consistently from bft,sync_blocks and storage crates. * threshold computation has been moved to ValidatorSet and is considered a genesis property now (until we move to dynamic validator set) * tests have been adjusted to work with non-trivial forks
- Loading branch information
Showing
104 changed files
with
3,821 additions
and
3,745 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.