GithubHelp home page GithubHelp logo

cbc-casper-msg's Introduction

CBC-casper abstract message lib

Minimal message and safe state creation, maintenance and transition based on https://github.com/cbc-casper/cbc-casper-paper

The purpose of this library is to abstractly define the CBC-Casper message stucture and define functions for the construction and proper execution of protocols of the casper family. We aimed at pushing as much functionality as possible directly to the abstract message layer, in such a way that a developer can create a protocol fairly easy using this library.

The design decision was to be as general as possible, and leave all the specific stuff for the implementer of the protocol. For the time being, we aim at mathematical correctness, and mostly purely functional protocol executions, rather than on performance.

The idea is to have a mathematical correct and possibly ineficient version of functions that can be used as ground truth for comparing with efficient versions.

To benefit from the casper-cbc safety proofs this library builds upon, developers using this library have to implement the CasperMsg trait. The CasperMsg trait in turn requires implementing other traits in this library, such as the Sender trait for validators, the Estimate trait for the estimate, and the Data trait if the estimate carries data.

One generic type implementing the CasperMsg trait, namely Message, is also provided that helps getting to a compliant CasperMsg trait concrete type implementation easily.

We present examples of naive consensus protocols: a binary consensus, and an integer consensus that use the generic type Message<Estimate, Sender> implementation to generate the protocols. We also present an example blockchain implementation.

In order to get started using the library, the best way is to study the examples folder. It is also instructive to run the tests. To run the unit tests, run cargo test -- --nocapture, or cargo test $TEST -- --nocapture, where TEST is the function name of a particular unit test. If the integration tests are to be run as well, issue cargo test --features integration_test -- --nocapture, or cargo test --features integration_test $TEST -- --nocapture, where TEST is the function name of a particular integration test.

This library is experimental and might change dramatically.

cargo clippy

Install clippy with rustup in Rust stable

rustup component add clippy

cargo fmt

Install rustfmt in Rust stable

rustup component add rustfmt

cargo fmt format with standard Rust guideline

cargo fmt -- --check fail if rustfmt should made some formating

cbc-casper-msg's People

Contributors

pz4 avatar lederstrumpf avatar ymaktepi avatar tshabs avatar dl3br avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.