/synchronous-gossip-protocol

Python implementation of a synchronous gossip protocol with Byzantine nodes

Primary LanguageJupyter Notebook

unittest codecov Python 3.11

synchronous-gossip-protocol

Python implementation of a synchronous gossip protocol.

For a (blazingly fast) implementation in Rust see dineshpinto/gossip-protocol-rs

Schema

flowchart TD
    GossipProtocolParams --> NodeGenerator;
    NodeGenerator -- list --> NonSampleNode;
    NodeGenerator -- list --> Adversarial;
    NodeGenerator -- list --> Honest;
    Adversarial --> Nodes;
    Honest --> Nodes;
    NonSampleNode --> Nodes;
    Nodes --> NetworkState;
    subgraph NetworkState
        NodeState --> StateTransitionFunction
        StateTransitionFunction --> NodeState;
        NodeState --o Counter;
        NodeState --o Storage;
    end
Loading
  • Protocol library code is located in synchronous_gossip_protocol/
  • Theory and simulation code are in a JupyterLab Notebook synchronous_gossip.ipynb
  • Unittest cases are in tests/

Installation

git clone https://github.com/dineshpinto/synchronous-gossip-protocol.git
cd synchronous-gossip-protocol
poetry install --with dev
poetry run python -m ipykernel install --user --name=synchronous-gossip-protocol

Usage

poetry run jupyter lab

Open synchronous_gossip.ipynb and run all cells.