pbft-typescript v0.0.48
PBFT-Typescript
Work in progress, do not use in production.
This library is a PBFT implementation of the PBFT algorithm (Practical Byzantine Fault Tolerance).
To do
- Remove node types from the tests
- PBFT onLeaderChange should count itself
- Generate new block via a blocks provider?
- on new-view the new leader is not counting itself (not logging the PP before sending the new-view)
- implement new-view
- we should have a timer for each view. new-view shouldn't restart a timer if it's already started.
- suggest block in new-view (inside PP)
- Convert getBlock of "BlocksProvider" to async.
- the onElected will trigger new-view more than once
- new-view shouldn't restart a timer if it's already started.
- Unsubscribe gossip on dispose of PBFT
- Separate the PBFT to a 1-Height-PBFT and a full PBFT.
- add isMember, and call it from pbft
- missing protection against byzantine attacks with wrong term/senderId etc.
- make sure on onReceiveNewView the PP.view === view
- protect against wrong view in PBFTTerm
- protect against bad leader messages
- publish on npm
- the PP validation should be extracted and used on new view PP
- onReceiveNewView should match the PP.view with the view
- onReceiveNewView should validate the given PP
- use BlockStorage interface
- publish the public types on the root of the library (import { Config } from 'pbft-typescript')
- intellisense is not working for pbft-typescript imports
- BlockStorage interface async compatible.
- BlockStorage interface remove 'appendBlockToChain'.
- add the git repo to the npm site
- Rename OnNewBlock to OnCommitted(Block)
- BlcokStorage.getTopMostBlock() => convert to BlcokStorage.getLastBlockHash()
- BlocksProvider.getBlock() change to requestNewBlock(blockHeight: number)
- BlockStorage: remove getBlockHashOnHeight(), getBlockChainHeight().
- Convert "registerOnCommitted" to async.
- Default implementations of: PBFTStorage.
- Add "restart" to PBFT api
- term should be taken from the height of the latest block (Use the BlockStorage)
- Implement "registerOnCommitted" to async.
- Implement "restart" to PBFT api
- KeyManager passed in config
- NetworkCommunication interface: {
getMembersPKs(height, seed)
,sendToMembers([pk])
,subscribeToMessages(cb)
,unsubscribeFromMessages
} - Remove senderId from Gossip -> Use PK instead
- Network rename NetworkCommunication
- Block interface {header}
- getNetworkMembersPKs(seed: string): string[]; // ordered
- getHeight should by async
- BlockUtils.calculateBlockHash(blockHeader) - bytes vs string?
- Remove BlockStorage, instead cache the last committed block
- BlockUtils - requestNewBlock and validate => use lastBlockHeader
- KeyManager implementation.
- Make BlockUtils external
- remove blockProvider & blockValidator
- PBFT.start should work with height
- TDD trigger once
- Cache future messages and consume on each new term
CommitBlock - commit the matching preprepared block in the pbftstorage - not the temp in state (this.CB)
None Blockers
- call the clear pbftStorage after commit.
- set the committee members pks in the PBFTTerm constructor
- clear the pbftStorage
- suggest block in new-view (inside PP), with proofs from other nodes.
- choose the "best" block (Out of view-change proofs) to offer on new-view
- on new-view verify that the leader offered the "best" block
- PrePrepare Compare given blockHash with the hash of the given block
- Storage - store payloads
- GetLatestPreparedProof from storage
- Add proof validator that can validate the prepred proof
- Test for matching view/leader
- Make sure the preprepare hold a block
- count null as a valid proof
- Verify the payloads
- Test that the pk is in the committee!
- Make sure that the prepares are not from the leader
- Prepared proof is valid only if it has 2f+1
- send the proof on view change
- validate the proof on view change
- on generate new-view add the view-change proof.
- extract ViewChange tests from onReceiveViewChange to a reusable function
- onReceiveNewView verify the proof
- not undefined
- isArray
- 2f+1 proofs
- validate using isViewChangePayloadValid
- all proofs senders a unique
- all VC terms match the given term
- all VC views match the given view
- validate all signed messages
- Check state still holds after async await functions (ex: when returning from requestNewBlock - view has changed)
- Think about view-change counting, when to count myself.
- add isACommitteeMember to PBFTTerm
- Change logging methodology - warning - added metadata
- Have a better (Readable) tests solution to await nextTick
- documentation
- monitoring/debug
- Optimizations: IData - Signature only on hash(header).
V1 stuff
- PBFT-BC onCommitted - adds header.pbftData.pbftProof
- implement
verifyBlock
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago