Skip to content

WIP on sharding and Ethereum 2.0 with enshrined-in-consensus data availability and Rust: fast, concurrent, safe and practical

License

Notifications You must be signed in to change notification settings

jamesray1/diamond_drops

 
 

Repository files navigation

Diamond Drops (diamond_drops)

Diamond Drops image

Twitter TravisCI License: Unlicense Average time to resolve an issue Percentage of issues still open Built with cargo-make codecov Gitter: DropsOfDiamond/Lobby Gitter: DropsOfDiamond/Development Gitter: sharding standard-readme compliant

WIP on sharding and Ethereum 2.0 with enshrined-in-consensus data availability and Rust: a fast, safe, concurrent and practical programming language

We are working on a sharding implementation for Ethereum with the Rust programming language, which is fast, safe and concurrent. Ethereum can theoretically be used for any kind of economic and governance activity, at lower costs than conventional approaches, in a decentralized, trustless, and censorship-resistant fashion. Sharding plans to scale Ethereum, at first quadratically, then exponentially.

We're implementing sharding according to collaboration with Ethereum research at https://ethresear.ch and other teams, which includes tasks outlined in the projects and issues. In the first phase of the roadmap, we only enshrine data availabilty, without execution, thus abstracting execution, and enabling faster and simpler implementation, with each phase being useful. For further information, please refer to our wiki. The plan is for this codebase to eventually be integrated into the Rust implementation of the EVM, Parity. diamond_drops is used as the name of the cargo crate for compatibility, and so the repo name also follows this.

Contents

Background

For an introduction to Ethereum, see https://ethereum.org/ or https://github.com/ethereum/wiki/wiki/Ethereum-introduction. For information on sharding and implementations, refer to here.

Install

Install dependencies

  • Install Rust

  • Update Rust

    rustup update
  • Install Rust Formatter

    rustup component add rustfmt-preview
  • Install Cargo-make Task runner and build tool

    cargo install --force cargo-make
  • Execute specific task runner flow. Default is Makefile.toml

    cargo make --makefile tasks.toml <TASK_NAME>

Show help menus

  • Command help
cd ~/diamond_drops; # you may wish to rename this to dod for convenience
cargo run -- --help
  • Sub-command "mode" help
cargo run -- mode --help

Clone a fork of the repository

  • Fork the repository https://github.com/Drops-of-Diamond/diamond_drops

  • Clone your fork of the repository (replace below with your Github username):

    git clone https://github.com/<USERNAME>/diamond_drops;
    cd diamond_drops
  • Add the "upstream" repository to your remotes and show your list of remotes verbosely

    git remote add upstream https://github.com/Drops-of-Diamond/diamond_drops;
    git remote --verbose
  • Change from the "master" branch to the "develop" branch to see the latest features that are being integrated but are not officially ready for production

Follow us on Twitter for release updates

Click on the Twitter badge above.

Usage

Build and Run the code

  • Proposer Mode

    cargo make p
  • Notary Mode

    cargo make n
  • Both Proposer and Notary Modes

    cargo make b
  • All above

    cargo make all
  • All above with collation example

    cargo make all-with-collation

Unit and Integration Tests

  • Run all tests (unit and integration tests for main package and libraries)

    cargo make test-all
  • Watch all tests (polls continuously for code changes during development, automatically running tests, and reports issues)

    cargo make build;
    cargo install cargo-watch;
    cargo make watch;

Show Rust Docs

cargo make docs

View UML Diagram

  • View UML with Google Chrome, Mozilla Firefox, or Brave browser

    cargo make uml-default-recommended;
    # The below options will only work for Mac OS X, otherwise use the above.
    cargo make uml-chrome;
    cargo make uml-firefox;
    cargo make uml-brave;
    • On a Mac you can also use ls /Applications; open SVG-COMPATIBLE-APPLICATION ./diagrams/ml.svg.
    • Optionally create a Pull Request to update Makefile.toml or open the diagrams/ml.svg file manually after building with the graphviz dependency for MML or an alternative installed.

Contibuting guidelines

See this wiki article here.

Security

This is WIP, pre-release software. It is planned to be integrated into Parity. There is a lot of research available on security alone; for example, CTRL+F "security" here or search in the pages here

Help support us

Send a donation to jamesray.eth. All contributors will be paid according to their contributions and timesheets, once a grant is received. As an example, my timesheet is available here. A multisig will be used when other developers are contributing full-time.<!omitting until other regular contributors are well established, although I still vouch that contributions will be paid for according to assessing hours on timesheets--our multi-sig wallet at 0x6D446f9545dBC380A6BBDde8A285A7A8030D4381-->

We're looking for more developers

See here for information. There is a lot of work to do in the sharding roadmap.

Why Rust?

After comparing languages such as Rust, C++, Go, Javascript and Python, as well as implementations (e.g. Parity, cppethereum, Go-ethereum, ethereumJS and Py-EVM), Rust is most preferable, while I haven't tried being a user much of other implementations, so I can't comment on a comparison. Rust has advantages such as safety, concurrency, practicality, better memory safety, zero-cost abstractions, and support for functional and imperative-procedural paradigms.

About

WIP on sharding and Ethereum 2.0 with enshrined-in-consensus data availability and Rust: fast, concurrent, safe and practical

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 98.1%
  • Shell 1.9%