A Tendermint implementation in Rust for Fuel.
fuellabs / fuel-bft Goto Github PK
View Code? Open in Web Editor NEWTendermint consensus in Rust
License: Apache License 2.0
Tendermint consensus in Rust
License: Apache License 2.0
A Tendermint implementation in Rust for Fuel.
The implementation won't reflect the strict form of pbft but instead will be based in tendermint.
We have some differences such as the block being proposed after precommit instead of commit and the round being declared as a tuple (height, round)
instead of an abstract descriptor.
Having fuel-pbft
is misleading because it suggests this is a general model for pbft, when in fact this is one concrete instance of pbft.
As suggestion: fuel-polka
Replace trait type usages such as <<Self as Message>::Keystore as Keystore>::Digest
by trait provided types so the code is more readable.
Example:
from
pub trait Message: Sized {
type Keystore: Keystore;
fn hash(&self) -> <<Self as Message>::Keystore as Keystore>::Digest;
}
to
pub trait Message: Sized {
type Keystore: Keystore;
type Digest = <<Self as Message>::Keystore as Keystore>::Digest;
fn hash(&self) -> Self::Digest;
}
blocked by: rust-lang/rust#29661
Rust doesn't support async traits as of the moment.
As soon as the feature lands in stable, we should remove async_trait
from our implementation in favor of the canonical implementation.
Blocked by: rust-lang/rust#44265
Originally posted by @adlerjohn in #9 (comment)
cross-reference tendermint go impl
I'm fine with merging without that for now. But eventually, this should include some kind of tokio task or executor that drives progress and handles timeouts etc.
(originally posted by @Voxelot)
why not use thiserror?
Originally posted by @Voxelot in #9 (comment)
This deviates from tendermint-style algorithms and could lead to rounds being arbitrarily skipped. This also doesn't allow for the eventuality guarantees of tendermint:
The timeouts prevent the algorithm from blocking and waiting forever for some condition to be true, ensure that processes continuously transition between rounds, and guarantee that eventually (after GST) communication between correct processes is timely and reliable so they can decide. The last role is achieved by increasing the timeouts with every new round r, i.e,
timeoutX(r) = initT imeoutX +r โ timeoutDelta;
they are reset for every new height (consensus instance).
Where timeoutX could be timeoutPropose, timeoutPrevote or timeoutPrecommit.
This means we should only increment the round after properly cycling through the appropriate steps and timeouts, rather than just taking the time since the last commit and dividing it by some constant round value. Otherwise, we won't be able to increase the timeout each round.
Additionally, we may want to consider a timeout vote in the future which would allow for ddos-resistant leader selection strategies.
Originally posted by @Voxelot in #9 (comment)
Listen to votes and follow the consensus for the network to import new blocks. Currently, the consensus mechanism will be idle unless it can vote (the keychain provides round public key).
We might benefit from having generic signature primitives for the consensus votes since the protocol might use validators from external networks
Originally posted by @leviathanbeak in #9 (comment)
Since voting power is stake weighted, we need to track validator state in the consensus metadata and use it for determining consensus thresholds.
The public key of a validator might change depending on the round.
Originally posted by @adlerjohn in #9 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.