smart-shard

command module
v0.0.0-...-c6b7977 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

README

Guaranteed-TX Simulator

The Guaranteed-TX simulator is a graphical interface written in Golang to simulate visualise the working of Guaranteed-TX. It was created as a graduation project to create a guaranteed cross-shard transaction execution protocol for Ethereum 2.0.

About Guaranteed-TX

Guaranteed-TX is a guaranteed cross-shard transaction execution protocol for Ethereum 2.0. Guaranteed-TX allows shards to process cross-shard transactions before being finalised in the block it was created - a property called optimistic execution - which significantly improves cross-shard transaction latencies. In addition, it provides economic guarantees that all cross-shard transaction will eventually be processed. In order to achieve both Guaranteed-TX introduces a messaging layer which records the created and processed cross-shard transactions and is shared with every shard. The messaging layer is used to finalise consistent blocks and punish validators in a shard committee for not processing cross-shard transactions. Consequently, cross-shard transactions are either processed or slowly drain the stake of the validators within the addressed shard.

Compiling the Guaranteed-TX source code

The graphic interface provides some features to modify the simulation, however, many more variables can be modified in the source code.

For building the Guaranteed-TX Simulator the source code needs to be available on the build system and Golang version >1.4+. Guaranteed-TX uses Go bindings for nuklear.h — a small ANSI C gui library and requires a GNU Compiler Collection to build nuklear. Windows users can use MinGW. An extended installation description for nuklear can be found in the Nuklear Go binding repository.

Subsequently, one can compile the code with go build.

Using the simulator

The simulator simulates an abstracted version of above protocol. For every shard the block headers are plotted as circles over time. The color of the circle indicates the status and the lines between circles a parent-child relation, with the parent always on earlier in time on the left side. Clicking on a circle shows the txOut and txIn transaction list of the related block header. Moreover, the beacon chain finalises blocks in the background.

Status colors selected shard (full node):

  • Green -> Finalised
  • Red -> Invalid (block includes inconsistent txIn which is not part of the canonical chain of the sourceshard)
  • Yelllow -> Canonical chain
  • Purple -> Stale block
  • Blue -> Genisis block

Status colors other shards (light client):

  • White -> Pruned canonical chain
  • Yellow - >Canonical chain
  • Blue -> Last finalised block

A detailed description about the visualiser can be found in my thesis document.

IMPORTANT: The simulator is used to get insights in Guaranteed-TX and is not formally proven.

screenshot

screenshot2

Documentation

Overview

See also examples on https://github.com/golang-ui/nuklear

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL