Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

omoindrot/simple_casper

Open more actions menu

Repository files navigation

A simple implementation of Casper

Authors: Charles Bournhonesque, Olivier Moindrot

Project realized for the class CS244b at Stanford.
Final report for the class: final_report.pdf

Original paper Casper from Vitalik Buterin and Virgil Griffith.

Running the code

The parameters of the experiment can be found in parameters.py.

To reproduce figure 1 in our report, use the following parameters and run python3 simulator.py.

NUM_VALIDATORS = 3  # number of validators at each checkpoint
VALIDATOR_IDS = list(range(0, NUM_VALIDATORS))  # set of validators
INITIAL_VALIDATORS = list(range(0, NUM_VALIDATORS))  # set of validators for root
BLOCK_PROPOSAL_TIME = 100  # adds a block every 100 ticks
EPOCH_SIZE = 5  # checkpoint every 5 blocks
AVG_LATENCY = 100  # average latency of the network (in number of ticks)

To reproduce figures 2 and 3, use the following parameters and run python3 metrics.py.

NUM_VALIDATORS = 100  # number of validators at each checkpoint
VALIDATOR_IDS = list(range(0, NUM_VALIDATORS))  # set of validators
INITIAL_VALIDATORS = list(range(0, NUM_VALIDATORS))  # set of validators for root
BLOCK_PROPOSAL_TIME = 100  # adds a block every 100 ticks
EPOCH_SIZE = 5  # checkpoint every 5 blocks
AVG_LATENCY = 100  # will be modified in metrics

About

A simple implementation of Casper in python

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.