Skip to content

Aman-Hassan/ChainPaxos

Repository files navigation

ChainPaxos

Overview

Reactor-based implementation of the ChainPaxos protocol for COL862 2501 Course Project.

How to Build

  1. Ensure you have Rust installed. You can get it from here.
  2. Clone the repository:
     git clone https://github.com/Aman-Hassan/ChainPaxos.git
  3. Run the following commands to build the project using the Makefile:
  • Build node (Installs reactor and builds the node in one terminal):

    make node

    The following log messages indicate succesful installation and build (The last error message can be ignored for now):

    Killing process on port 3000 if any...
    cargo install \
        --git https://github.com/satyamjay-iitd/reactor.git \
        --branch master \
        reactor_nctrl \
            --features "jaeger"
        Updating git repository `https://github.com/satyamjay-iitd/reactor.git`
        Ignored package `reactor_nctrl v0.1.0 (https://github.com/satyamjay-iitd/reactor.git?branch=master#224468d2)` is already installed, use --force to override
    cargo build --release --features verbose
        Finished `release` profile [optimized] target(s) in 0.13s
    reactor_nctrl --port 3000 target/release
    2025-11-02T13:49:32.282339Z  INFO init_node_controller:load_ops{operator_dir="target/release"}: loaded_lib: lib_name="chainpaxos"
    2025-11-02T13:49:32.282712Z  INFO init_node_controller: reactor_node: msg="spawned_http_server" port=3000
    2025-11-02T13:49:32.282742Z  INFO init_node_controller: reactor_node: msg="spawned_http_server" ops=OpLibrary { container: {"chainpaxos": (Library@0x61de16ab1990, [])} }
    2025-11-02T13:49:40.203936Z ERROR opentelemetry_sdk:  name="BatchSpanProcessor.ExportError" error="Operation failed: status: Unavailable, message: \"tcp connect error\", details: [], metadata: MetadataMap { headers: {} }"
  • Alternateively, you can also Build the node along whilst saving logs to a file:

    make node_log LOG=logfile.log
    • This will create a logfile named logfile.log in the logs directory containing all the log messages.
  • Build job controller (Installs reactor and builds the job controller in one terminal):

    make job

    The following log messages indicate succesful installation and build:

    cargo install \
        --git https://github.com/satyamjay-iitd/reactor.git \
        --branch master \
        reactor_jctrl
        Updating git repository `https://github.com/satyamjay-iitd/reactor.git`
        Ignored package `reactor_jctrl v0.1.0 (https://github.com/satyamjay-iitd/reactor.git?branch=master#224468d2)` is already installed, use --force to override
    reactor_jctrl ./chainpaxos.toml
  1. The project is now built and the appropriate log messages should be visible in the terminal 1 (running make node).

Configuration (WIP)

The configuration for the protocol is specified in the chainpaxos.toml file. You can modify the parameters as needed. The following behaviours can be configured:

  • Number of nodes in the chain
  • Failure scenarios (e.g., node crashes, message delays, message losses)
  • Client request patterns (e.g., read_ratio, zipf_skew, target_rps, key_space_size)

Generating graphs

We try to simulate the same avg latency - throughput graph under CPU load (graph 4) of the paper

To generate the graph, follow the steps:

  • Update chainpaxos.toml file client setup to have the following parameters:
[placement]
[[placement.client]]
nodename = "node1"
actor_name = "Client_"
replicas = 3
servers = ["cp1", "cp2", "cp3"]

[placement.client.workload]
target_rps = <input_your_required_rps> # Modify!!
key_space_size = 10
zipf_skew = 0.0 # Uniform distribution
read_ratio = 0.0 # Write only workload
run_duration = 85 # in seconds
  • Use 3 server setup (i.e. cp1, cp2, cp3), with no crashes/join_after
  • Run make_node LOG=logfile_<rps_value>rps.log for each rps value that you test with
  • Once all rps value runs have been completed call the analyze_results.py script
python3 analyze_results.py

Resources

About

COL862 Major Project: ChainPaxos

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •