prysm-pulse/sharding
Preston Van Loon 0a458de73d Merge pull request #4 from enriquefynn/geth-sharding
Validator manager contract in solidity

Former-commit-id: 41453f9a6262ca73e52ed93aa5e9539b7d6edc46 [formerly 5c8e92adeb56fc7b3de84cc5cf50125bf52e84db]
Former-commit-id: 75b3b72fd7bd5468a6d41a01474db3da90dc9061
2018-02-05 14:49:51 -05:00
..
contracts Merge pull request #4 from enriquefynn/geth-sharding 2018-02-05 14:49:51 -05:00
client_test.go fix tests for to work properly 2018-01-28 15:57:05 -05:00
client.go deploy VMC rather than ValidatorContract 2018-01-27 14:57:37 -05:00
config_test.go working on sharding entrypoint 2018-01-14 19:10:02 -05:00
config.go finish lookahead period comment 2018-01-20 19:10:12 -05:00
genesis.json fix dynamic network id through json rpc 2018-01-22 07:30:06 -05:00
README.md update READMEs datadir path to /path/to/your/datadir 2018-01-22 12:51:12 -08:00
vmc.go Add minor comment to indicate that networkID == chainID 2018-01-27 21:24:23 -05:00

Go-Ethereum Sharding

Join the chat at https://gitter.im/prysmaticlabs/geth-sharding

This repository contains the sharding implementation for the go-ethereum client. The system consists of an entry point that serves as a bridge between a Validator Manager Contract and a Geth node running on the same network.

To get started with running the project, follow the instructions to initialize your own private Ethereum blockchain and geth node:

$ make geth
$ ./build/bin/geth init ./sharding/genesis.json -datadir /path/to/your/datadir
$ ./build/bin/geth --nodiscover console --datadir /path/to/your/datadir --networkid 12345

Then, the geth console can start up and you can start a miner as follows:

> personal.newAccount()
> miner.setEtherbase(eth.accounts[0])
> miner.start()

Then, once you are satisfied with mining for a few seconds, stop the miner with

> miner.stop()

Now, save the passphrase you used in the geth node into a text file called password.txt. Then, once you have this private geth node running on your local network, the sharding client can be started as a standalone geth command as follows in a separate terminal window:

$ ./build/bin/geth shard --datadir=/path/to/your/datadir --password=password.txt

The project consists of the following parts, with each of them requiring comprehensive tests:

Validator Manager Contract

The VMC is built in Solidity and deployed to the geth node upon launch of the client if it does not exist in the network at a specified address. If the contract already exists, the client simply sets up an interface to programmatically call the internal contract functions and listens to transactions broadcasted to the geth node to begin the sharding system.

VMC Wrapper & Sharding Client

As we will be interacting with a geth node, we will create a Golang interface that wraps over the VMC and a client that connects to the local geth node upon launch via JSON-RPC.

It will be the client's responsibility to listen to any new broadcasted transactions to the node and interact package validators up to be sent to the VMC.

Sharding VM

As sharding will require a different set of protocol primitives, we will have to specify new primitives for Blocks, Transactions, and even the low-level functioning of the EVM to accommodate this new structure.

We can implement a new ShardingEVM by overriding some of the regular EVM interface's methods in how it executes transactions. Our sharding client will process transactions using this modified vm.

An example of the current approach followed in the python implementation can be found here

In this case, the VM of the sharding client is set to be the subclassed ByzantiumVM that has its methods overwritten and sharding transactions primitives specified.

Contributing

We will be tracking progress on these major milestones as through WIP pull requests. If you have any thoughts on major parts of the system that will still need to be implemented, message the Prysmatic Labs team gitter channel.