pheymann / scala.bft Goto Github PK
View Code? Open in Web Editor NEWParallel Byzantine Fault Tolerance (R&D)
License: MIT License
Parallel Byzantine Fault Tolerance (R&D)
License: MIT License
From time to time the duration is ignored while waiting for a result in the specs. Thus leading to failing tests/builds.
What happens: The Await.result
instantaneously throws a TimeoutException
.
19:04:50.243 [INFO ][a.event.slf4j.Slf4jLogger] Slf4jLogger started
19:04:50.243 [INFO ][c.g.p.s.b.c.LeaderConsensus] {1,0,[0]}.aborted
19:04:50.243 [DEBUG][c.g.p.s.b.c.PrepareRound] {1,0,[0]}.prepare.consensus.messages: 1
19:04:50.246 [DEBUG][c.g.p.s.b.c.CommitRound] {1,0,[0]}.commit.consensus.messages: 1
19:04:50.246 [DEBUG][c.g.p.s.b.c.CommitRound] {1,0,[0]}.commit.consensus.messages: 2
19:04:50.246 [INFO ][c.g.p.s.b.c.CommitRound] {1,0,[0]}.commit.consensus.reached
19:04:50.246 [INFO ][c.g.p.s.b.c.PrepareRound] {1,0,[0]}.prepare.consensus.reached
19:04:50.246 [INFO ][c.g.p.s.b.c.PrepareRound] {1,0,[0]}.prepare.start
19:04:50.246 [DEBUG][c.g.p.s.b.c.PrepareRound] {1,0,[0]}.prepare.start.consensus.reached
19:04:50.246 [INFO ][c.g.p.s.b.c.CommitRound] {1,0,[0]}.commit.start
19:04:50.246 [DEBUG][c.g.p.s.b.c.CommitRound] {1,0,[0]}.commit.start.consensus.reached
As the storage system can be implemented in multiple ways (in-memory, persistent (RDB, key-value store, ...)) a flexible api is needed. This can be achieved by using akka actors. The current LogStorage
extension shall not provide the storage code directly but send messages to the available implementation. Therefore, a number of messages are defined which have to be used by the storage modules:
r
The api has to wait until the storage process is completed for each message before continuing.
The determine the implementation during runtime the names of the actors receiving the above messages have to be set (configured) in code or config file.
See parameter description here.
As described in the overview the consensus consists of three rounds:
pre-prepare
: ((PRE_PREPARE, v
, n
, D(r)
), r
) r
to all followers. When the request is delivered to all replicas the consensus proceeds with the prepare
phase.prepare
: (PREPARE, v
, n
, D(r)
, Id(R_i)
) 2f
acknowledgments. When received the messages the consensus proceeds with the commit
phase.commit
: (COMMIT, v
, n
, D(r)
, Id(R_i)
) 2f + 1
acknowledgements. When the messages are received the request operation is executed. For this issue the execution code is only available as api call.This first implementation shall use seed replicas to integrate new instances into the running system. The protocol looks like follows:
1. there are k
replicas R
known (host and port defined in a config) and called seeds
2. when a new instances is added to the system it sends a join message to the seed nodes
3. the seeds send a cluster update message to all other replicas including the new instance
note: All replicas could send the cluster update message so that the probability of replicas which do not receive the message decreases (config).
The reference to the remote replicas is stored as remote actor references
.
All seed replicas could be faulty and return wrong results. That doesn't work.
Instead:
Use a static solution using a predefined number of replicas with known hosts and ports.
Messages and request needs to be authenticated to hold the consistence guarantees. Thereby, authentication has to be separated into:
prerequisite: every node (including clients) have a 16 Byte session key they share with each replica
MACs are created as follows:
h_r
from the client request r
h_r
with a session key and apply MD5 again to get h_rk
h_rk
Scenarios:
They have to be signed with a strong cryptographic strategy like RSA.
Use Scala cats
library to apply functional programming design and pattern on the current state (feature/authentication). This includes:
Message transmission is separated into two types:
Byte Array
and partitioned into n
units regarding to the chunk size,k
sender actors and sent to the replicas. Multiple sender actors can serve one replica (config) to speed up transmission,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.