Add test runs and instructions for reproducing simulation results (#3)

- Update main simulation instructions to inline hyperlinked content
- Add test runs (generated data + tests output)
- Add instructions to reproduce results from one of the added test runs

Reviewed-on: #3
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
Prathamesh Musale 2025-08-14 11:44:09 +00:00 committed by nabarun
parent 652c69cbee
commit 0e57539780
24 changed files with 1304944 additions and 101 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
venv
__pycache__
generated
.ipynb_checkpoints

View File

@ -30,7 +30,7 @@ This guide explains how to use the interactive notebook to experiment with diffe
3. **Use the Interactive Interface**
The notebook will open automatically in your browser. Execute it by clicking "Run All" from `Run` tab in order to start experimenting with different participation scenarios.
The notebook will open automatically in your browser. Execute it by clicking "Run All Cells" from `Run` tab in order to start experimenting with different participation scenarios.
## Using the Interactive Interface

312
README.md
View File

@ -1,5 +1,27 @@
# lockdrop-simulation
This repository includes the simulation of Zenith Network's token lockdrop distribution and tests to validate the simulation run. It simulates a realistic lockdrop scenario using mock participants and validates token allocation calculations against a live zenithd node.
## Table of Contents
- [Overview](#overview)
- [Interactive Experimentation](#interactive-experimentation)
- [Full Simulation and Validation](#full-simulation-and-validation)
- [Approach](#approach)
- [Simulation Features](#simulation-features)
- [Prerequisites](#prerequisites)
- [Configuration](#configuration)
- [Service Configuration](#service-configuration)
- [View Configuration](#view-configuration)
- [Setup](#setup)
- [Run Simulation](#run-simulation)
- [Step 1: Simulated Token Genesis Event](#step-1-simulated-token-genesis-event)
- [Step 2: Genesis Transaction (Gentx) Signing](#step-2-genesis-transaction-gentx-signing)
- [Step 3: Start Validator Node](#step-3-start-validator-node)
- [Step 4: Run Lockdrop Distribution Notebook](#step-4-run-lockdrop-distribution-notebook)
- [Step 5: Run Simulation Tests](#step-5-run-simulation-tests)
- [Cleanup](#cleanup)
## Overview
This repository provides two main ways to work with lockdrop calculations:
@ -11,7 +33,11 @@ For independent experimentation with lockdrop allocation scenarios, see [EXPERIM
- Test various scenarios (balanced, five-year focused, short-term focused, etc.)
- Export timestamped results for analysis
### Full Simulation & Validation
### Full Simulation and Validation
To reproduce results from pre-generated simulation runs, see [test-runs](./test-runs). There are several test runs with existing participant data and test outputs for validation.
OR
Continue reading below for the complete simulation workflow that validates token distribution against a live zenithd node.
@ -22,6 +48,7 @@ Continue reading below for the complete simulation workflow that validates token
The lockdrop simulation validates the Zenith Network's token distribution mechanism by creating a realistic test environment without requiring real Ethereum data or live participants.
- **Generate mock participants** with proper Ethereum/Zenith addresses and distribute Urbit points (galaxies/stars) based on configurable participation rates
- **Generate watcher events** to simulate Ethereum Lockdrop contract interactions
- **Simulate the TGE event** to process participants and generate a genesis file with treasury allocations and unlock schedules as per [distribution-simulate-lockdrop.json](./distribution-simulate-lockdrop.json)
- **Deploy a test zenithd validator** using the simulated genesis file to validate the actual token distribution and accrual implementation
- **Compare expected calculations** (via Jupyter notebook) against live node's API responses to ensure mathematical correctness
@ -35,92 +62,199 @@ The lockdrop simulation validates the Zenith Network's token distribution mechan
- **Realistic Attestations**: Create attestations following the expected format
- **Token Calculations**: Treasury calculations for lockdrop participants based on total supply and participant count
## Prerequisites
- Set zenith-stack version to use:
```bash
ZENITH_STACK_VERSION=v0.2.9
```
Check [releases](https://git.vdb.to/LaconicNetwork/zenith-stack/releases) page for version history.
- **lockdrop-simulation repository**
Clone the lockdrop simulation repository containing the simulation test suite:
```bash
git clone git@git.vdb.to:LaconicNetwork/lockdrop-simulation.git
```
- **zenith-stack repository**
Clone the zenith-stack repository containing required Ansible playbooks:
```bash
git clone git@git.vdb.to:LaconicNetwork/zenith-stack.git
# Checkout to the required version
cd zenith-stack
git checkout $ZENITH_STACK_VERSION
```
**Note**: Replace `<path/to/zenith-stack>` in the further commands in deployment with the actual path where you cloned the zenith-stack repository.
- **zenith-ansible binary**
**Note**: Set `OUTPUT_DIR` in the following command to output directory of your choice. Make sure that it exists and is in your [`PATH`](https://unix.stackexchange.com/a/26059).
You may need to run the following commands with necessary permissions, as root or through sudo.
```bash
# Download the binary from generic package registry
OUTPUT_DIR=~/bin
curl -L -o $OUTPUT_DIR/zenith-ansible https://git.vdb.to/api/packages/LaconicNetwork/generic/zenith-stack/$ZENITH_STACK_VERSION/zenith-ansible
```
Make it executable:
```bash
chmod +x $OUTPUT_DIR/zenith-ansible
```
Verify installation:
```bash
which zenith-ansible
zenith-ansible --help
```
**Always run zenith-ansible from the ansible directory on the control node.**
- **configure-zenith-vars binary**
`configure-zenith-vars` is an interactive CLI tool to simplify the configuration process.
```bash
# Navigate to the ansible directory
cd <path/to/zenith-stack>/ansible
# Run a playbook to install configure-zenith-vars
# Use the same OUTPUT_DIR used for zenith-ansible
zenith-ansible install-zenith-config-cli.yml -e "cli_install_dir=${OUTPUT_DIR}" -K
```
Verify installation:
```bash
which configure-zenith-vars
# Working directory: <path/to/zenith-stack>/ansible
configure-zenith-vars --help
```
**Always run configure-zenith-vars from the ansible directory on the control node**: The CLI creates `inventories/` directory relative to your current working directory by default.
## Configuration
Before running a lockdrop simulation for Stage 1 of the Zenith Stack, we need to configure the required parameters.
```bash
# Navigate to ansible directory where `inventories` directory is present
cd <path/to/zenith-stack>/ansible
configure-zenith-vars --stage stage1-lockdrop-simulation
```
Set **`Generate fresh participants data` to `true`**.
This interactive tool will guide you through configuring all the necessary variables for your lockdrop simulation deployment.
It allows flexible simulation parameters:
- **Participant count**: Configure the total number of mock participants
- **Galaxy allocation**: Determines how many participants will be validators
- **Star distribution**: Controls the total star pool available for allocation
**To update or edit the generated configuration**, simply re-run the `configure-zenith-vars` command before proceeding with further system setup.
### Service Configuration
**Genesis Generator Configuration**
- **Data directory for lockdrop simulation deployments**: Absolute path to the parent directory where deployments for lockdrop simulation will be created.
- **Ethereum RPC endpoint**: RPC endpoint for fetching current ETH block height.
```bash
Example: https://eth.rpc.laconic.com/<API_KEY>
```
- **Number of participants**: Total number of mock participants to generate for simulation (default: 400).
- **Galaxy count**: Number of galaxies to allocate among participants - determines validator count in real scenario (default: 200).
- **Star count**: Number of stars to allocate among participants - each participant needs at least 1 (default: 2000).
**Bootstrap Validator Configuration**
- **Bootstrap validator data directory**: Absolute path to the parent directory where the bootstrap validator deployment will be created (can use the same parent directory as set for Genesis Generator).
- **Validator display name (moniker)**: Human-readable validator name for the simulation (default: ZodNode).
**Gentx Signer Configuration**
- **Gentx signer data directory**: Absolute path to the parent directory where gentx will be signed and the genesis file created (can use the same parent directory as set for Genesis Generator).
### View Configuration
To view existing variables configuration, run with `list` flag:
```bash
# Working directory: <path/to/zenith-stack>/ansible
configure-zenith-vars --stage stage1-lockdrop-simulation --list
# Select `development` environment when prompted
```
## Setup
1. **Install Prerequisites**
Create the data directory required for simulation (must be same as the path configured for `lockdrop simulation deployments directory` in previous step to configure variables):
Clone the zenith-stack repository which contains the Ansible playbooks:
```bash
# For example:
mkdir -p /home/$USER/stage1-lockdrop-simulation
```
```bash
git clone git@git.vdb.to:LaconicNetwork/zenith-stack.git
```
Setup the deployment directories and pull required docker images to generate base genesis file along with other artifacts:
**Note**: Replace `<path/to/zenith-stack>` in the commands below with the actual path where you cloned the zenith-stack repository.
```bash
# Make sure you are in ansible directory:
cd <path/to/zenith-stack>/ansible
Run following commands with necessary permissions, as root or through sudo
zenith-ansible -i ./inventories/development/hosts.yml tge-site.yml -e "mode=setup"
```
Install `zenith-ansible` at `/usr/local/bin`:
Setup the deployment directories and pull required docker images to sign the gentx and setup stage 1 validator node:
```bash
# Download the binary from generic package registry
curl -L https://git.vdb.to/api/packages/LaconicNetwork/generic/zenith-stack/v0.2.5/zenith-ansible -o /usr/local/bin/zenith-ansible
```
```bash
zenith-ansible -i ./inventories/development/hosts.yml stage1-site.yml -e "mode=setup" --skip-tags onboarding
```
**NOTE**: Make sure `/usr/local/bin` is in your `$PATH`
Make it executable:
```bash
chmod +x /usr/local/bin/zenith-ansible
```
Verify installation:
```bash
which zenith-ansible
```
<!-- TODO: Update tag -->
For more details about `zenith-ansible` check this [doc](https://git.vdb.to/LaconicNetwork/zenith-stack/src/tag/v0.2.5/ansible/zenith-ansible-shiv/README.md)
2. **Configure Variables**
Configure variables required for this simulation by following [this guide](https://git.vdb.to/LaconicNetwork/zenith-stack/src/tag/v0.2.5/ansible/zenith-config-cli/docs/stage1-lockdrop-simulation.md).
The configuration tool allows flexible simulation parameters:
- **Participant count**: Configure the total number of mock participants
- **Galaxy allocation**: Determines how many participants will be validators
- **Star distribution**: Controls the total star pool available for allocation
3. **Setup Deployment Directories**
Create the data directory required for simulation (must be same as the path configured for `lockdrop simulation data directory` in previous step to configure variables):
```bash
# For example:
mkdir -p /home/$USER/stage1-lockdrop-simulation
```
Make sure you are in ansible directory:
```bash
cd <path/to/zenith-stack>/ansible
```
Setup the deployment directories and pull required docker images to generate base genesis file along with other artifacts:
```bash
zenith-ansible -i ./inventories/development/hosts.yml tge-site.yml -e "mode=setup"
```
Setup the deployment directories and pull required docker images to sign the gentx and setup stage 1 validator node:
```bash
zenith-ansible -i ./inventories/development/hosts.yml stage1-site.yml -e "mode=setup" --skip-tags onboarding
```
These steps will create following in the [configured](#view-configuration) deployments directory:
- `mock-lockdrop-watcher-deployment`
- `mainnet-zenithd-deployment`
## Run Simulation
Now that all the deployment directories are setup, we are ready to run the simulation.
### Step 1: Simulated Token Genesis Event
Following command allows users to create the base genesis file while simulating lockdrop participants:
Remove any existing data from previous runs:
```bash
rm -rf <path/to/zenith-stack>/generated
```
Following command generates the simulated participants with respective point lockup events. It also creates a base genesis file with treasury initialized with the participants data:
```bash
zenith-ansible -i ./inventories/development/hosts.yml tge-site.yml -e "mode=simulate-lockdrop"
```
This will generate base genesis file at `<path/to/zenith-stack>/base-genesis-file/genesis.json`
This will also generate following files in `<path/to/zenith-stack>/generated`:
This will generate following files in `<path/to/zenith-stack>/generated`:
```bash
<path/to/zenith-stack>/generated/
@ -130,6 +264,10 @@ This will also generate following files in `<path/to/zenith-stack>/generated`:
└── watcher-events.json # Simulated lockdrop contract events
```
And a base genesis file at `<path/to/zenith-stack>/base-genesis-file/genesis.json`.
Note the path to `<path/to/zenith-stack>/generated` directory as it will be required in [Step 4](#step-4-run-lockdrop-distribution-notebook).
[distribution-simulate-lockdrop.json](./distribution-simulate-lockdrop.json) is used for category-wise allocation of `$Z` with respective vesting/unlock schedules (unlock frequency reduced to 60 seconds or 30 blocks for lockdrop participants for demo purposes).
### Step 2: Genesis Transaction (Gentx) Signing
@ -160,7 +298,7 @@ This will:
- Generate the final genesis file
- Copy final genesis to `<path/to/zenith-stack>/genesis-file/genesis.json`
### Step 3: Start Bootstrap Validator
### Step 3: Start Validator Node
Now, we can use this genesis file to run the stage 1 validator node:
@ -171,33 +309,27 @@ zenith-ansible -i ./inventories/development/hosts.yml stage1-site.yml -e "mode=s
After starting the node, verify it's running correctly:
```bash
# Set data directory (should match configuration)
export DATA_DIRECTORY=/absolute/path/to/data/directory
# Set deployments data directory (should match configuration)
DATA_DIRECTORY=/absolute/path/to/deployments/directory
# Check validator logs
laconic-so deployment --dir $DATA_DIRECTORY/mainnet-zenithd-deployment logs zenithd -f
```
Now we have a zenithd node running with the simulated participants data.
### Step 4: Run Lockdrop Distribution Notebook
Execute the Jupyter notebook to perform lockdrop allocation calculations and generate analysis outputs:
Now we can execute the reference Jupyter notebook to perform lockdrop allocation calculations on the generated data and produce analysis outputs. The notebook output is used further in the simulation test suite.
1. **Create Virtual Environment and Install Dependencies**
Clone lockdrop simulation directory:
```bash
git clone git@git.vdb.to:LaconicNetwork/lockdrop-simulation.git
# Navigate to lockdrop-simulation directory
cd lockdrop-simulation
```
Checkout to the latest [release](https://git.vdb.to/LaconicNetwork/lockdrop-simulation/releases)
Create and activate a Python virtual environment:
```bash
# Navigate to the directory where you had cloned the lockdrop-simulation repo
cd lockdrop-simulation
python3 -m venv venv
source venv/bin/activate
```
@ -208,7 +340,7 @@ Execute the Jupyter notebook to perform lockdrop allocation calculations and gen
pip install -r requirements.txt
```
Configure path to the `generated` directory that was generated in `zenith-stack` repo in above steps:
Export path to the `generated` directory in `zenith-stack` repo from [Step 1](#step-1-simulated-token-genesis-event):
```bash
export GENERATED_DIR="<path/to/zenith-stack>/generated"
@ -239,7 +371,7 @@ Execute the Jupyter notebook to perform lockdrop allocation calculations and gen
### Step 5: Run Simulation Tests
Run comprehensive tests to validate that the zenithd node's TGE allocations and run-time accruals match the notebook results:
Now we can run the comprehensive test suite to validate that the zenithd node's TGE allocations match notebook results and run-time accruals happen as expected.
1. **Set Environment Variables**
@ -295,13 +427,13 @@ Run comprehensive tests to validate that the zenithd node's TGE allocations and
The tests provide detailed tabular output showing:
- Comparison between notebook calculations and zenithd responses
- Any differences or mismatches
- Comprehensive validation of the lockdrop implementation
- Validation of the lockdrop implementation
## Cleanup
### Validator Deployment Cleanup
### Validator Deployment
Go to `ansible` directory:
Navigate to the Ansible directory:
```bash
cd <path/to/zenith-stack>/ansible
@ -319,9 +451,9 @@ Clean up validator deployment:
zenith-ansible -i ./inventories/development/hosts.yml stage1-site.yml -e "mode=cleanup" --skip-tags onboarding -K
```
### Python Virtual Environment Cleanup
### Python Virtual Environment
Go to `lockdrop-simulation` directory:
Go to the `lockdrop-simulation` directory:
```bash
cd <path/to/lockdrop-simulation>

421
test-runs/README.md Normal file
View File

@ -0,0 +1,421 @@
# Simulation Test Runs
This directory contains pre-generated data and outputs from simulation test runs. These can be used to reproduce test results using existing participant data instead of generating it afresh.
## Table of Contents
- [Overview](#overview)
- [Prerequisites](#prerequisites)
- [Configuration](#configuration)
- [Service Configuration](#service-configuration)
- [View Configuration](#view-configuration)
- [Setup](#setup)
- [Run Simulation](#run-simulation)
- [Step 0: Place Existing Generated Data](#step-0-place-existing-generated-data)
- [Step 1: Simulated Token Genesis Event](#step-1-simulated-token-genesis-event)
- [Step 2: Genesis Transaction (Gentx) Signing](#step-2-genesis-transaction-gentx-signing)
- [Step 3: Start Validator Node](#step-3-start-validator-node)
- [Step 4: Run Lockdrop Distribution Notebook](#step-4-run-lockdrop-distribution-notebook)
- [Step 5: Run Simulation Tests](#step-5-run-simulation-tests)
- [Compare Results](#compare-results)
- [Cleanup](#cleanup)
## Overview
This directory contains the following simulation test runs with pre-generated data and test suite outputs:
- run1: [run1/output.log](./run1/output.log)
- run2: [run2/output.log](./run2/output.log)
- run3: [run3/output.log](./run3/output.log)
To reproduce the results from any one of the test runs, follow these steps to run through the simulation with existing generated data.
## Prerequisites
- Set zenith-stack version to use:
```bash
ZENITH_STACK_VERSION=v0.2.9
```
Check [releases](https://git.vdb.to/LaconicNetwork/zenith-stack/releases) page for version history.
- **lockdrop-simulation repository**
Clone the lockdrop simulation repository containing the simulation test suite and test runs:
```bash
git clone git@git.vdb.to:LaconicNetwork/lockdrop-simulation.git
```
- **zenith-stack repository**
Clone the zenith-stack repository containing required Ansible playbooks:
```bash
git clone git@git.vdb.to:LaconicNetwork/zenith-stack.git
# Checkout to the required version
cd zenith-stack
git checkout $ZENITH_STACK_VERSION
```
**Note**: Replace `<path/to/zenith-stack>` in the further commands in deployment with the actual path where you cloned the zenith-stack repository.
- **zenith-ansible binary**
**Note**: Set `OUTPUT_DIR` in the following command to output directory of your choice. Make sure that it exists and is in your [`PATH`](https://unix.stackexchange.com/a/26059).
You may need to run the following commands with necessary permissions, as root or through sudo.
```bash
# Download the binary from generic package registry
OUTPUT_DIR=~/bin
curl -L -o $OUTPUT_DIR/zenith-ansible https://git.vdb.to/api/packages/LaconicNetwork/generic/zenith-stack/$ZENITH_STACK_VERSION/zenith-ansible
```
Make it executable:
```bash
chmod +x $OUTPUT_DIR/zenith-ansible
```
Verify installation:
```bash
which zenith-ansible
zenith-ansible --help
```
**Always run zenith-ansible from the ansible directory on the control node.**
- **configure-zenith-vars binary**
`configure-zenith-vars` is an interactive CLI tool to simplify the configuration process.
```bash
# Navigate to the ansible directory
cd <path/to/zenith-stack>/ansible
# Run a playbook to install configure-zenith-vars
# Use the same OUTPUT_DIR used for zenith-ansible
zenith-ansible install-zenith-config-cli.yml -e "cli_install_dir=${OUTPUT_DIR}" -K
```
Verify installation:
```bash
which configure-zenith-vars
# Working directory: <path/to/zenith-stack>/ansible
configure-zenith-vars --help
```
**Always run configure-zenith-vars from the ansible directory on the control node**: The CLI creates `inventories/` directory relative to your current working directory by default.
## Configuration
Before running a lockdrop simulation for Stage 1 of the Zenith Stack, we need to configure the required parameters.
```bash
# Navigate to ansible directory where `inventories` directory is present
cd <path/to/zenith-stack>/ansible
configure-zenith-vars --stage stage1-lockdrop-simulation
```
Set **`Generate fresh participants data` to `false`** since we will be using existing generated data from a test run.
This interactive tool will guide you through configuring all the necessary variables for your lockdrop simulation deployment.
**To update or edit the generated configuration**, simply re-run the `configure-zenith-vars` command before proceeding with further system setup.
### Service Configuration
**Genesis Generator Configuration**
- **Data directory for lockdrop simulation deployments**: Absolute path to the parent directory where deployments for lockdrop simulation will be created.
- **Ethereum RPC endpoint**: RPC endpoint for fetching current ETH block height.
```bash
Example: https://eth.rpc.laconic.com/<API_KEY>
```
- **Number of participants**: Total number of mock participants to generate for simulation (default: 400).
- **Galaxy count**: Number of galaxies to allocate among participants - determines validator count in real scenario (default: 200).
- **Star count**: Number of stars to allocate among participants - each participant needs at least 1 (default: 2000).
**Bootstrap Validator Configuration**
- **Bootstrap validator data directory**: Absolute path to the parent directory where the bootstrap validator deployment will be created (can use the same parent directory as set for Genesis Generator).
- **Validator display name (moniker)**: Human-readable validator name for the simulation (default: ZodNode).
**Gentx Signer Configuration**
- **Gentx signer data directory**: Absolute path to the parent directory where gentx will be signed and the genesis file created (can use the same parent directory as set for Genesis Generator).
### View Configuration
To view existing variables configuration, run with `list` flag:
```bash
# Working directory: <path/to/zenith-stack>/ansible
configure-zenith-vars --stage stage1-lockdrop-simulation --list
# Select `development` environment when prompted
```
## Setup
Create the data directory required for simulation (must be same as the path configured for `lockdrop simulation deployments directory` in previous step to configure variables):
```bash
# For example:
mkdir -p /home/$USER/stage1-lockdrop-simulation
```
Setup the deployment directories and pull required docker images to generate base genesis file along with other artifacts:
```bash
# Make sure you are in ansible directory:
cd <path/to/zenith-stack>/ansible
zenith-ansible -i ./inventories/development/hosts.yml tge-site.yml -e "mode=setup"
```
Setup the deployment directories and pull required docker images to sign the gentx and setup stage 1 validator node:
```bash
zenith-ansible -i ./inventories/development/hosts.yml stage1-site.yml -e "mode=setup" --skip-tags onboarding
```
These steps will create following in the [configured](#view-configuration) deployments directory:
- `mock-lockdrop-watcher-deployment`
- `mainnet-zenithd-deployment`
## Run Simulation
Now that all the deployment directories are setup, we are ready to run the simulation.
### Step 0: Place Existing Generated Data
Copy the generated folder from your chosen test run to zenith-stack:
```bash
# Example for run1
cp -r <path/to/lockdrop-simulation>/test-runs/run1/generated <path/to/zenith-stack>/generated
# Verify
ls <path/to/zenith-stack>/generated
# generated-accounts.json generated-participants.json point-allocation-stats.json watcher-events.json
```
### Step 1: Simulated Token Genesis Event
Since we've placed existing generated data in zenith-stack, following command skips generating any new data. It creates a base genesis file with treasury initialized with the participants data:
```bash
zenith-ansible -i ./inventories/development/hosts.yml tge-site.yml -e "mode=simulate-lockdrop"
```
This will generate a base genesis file at `<path/to/zenith-stack>/base-genesis-file/genesis.json`.
Note the path to `<path/to/zenith-stack>/generated` directory as it will be required in [Step 4](#step-4-run-lockdrop-distribution-notebook).
[distribution-simulate-lockdrop.json](./distribution-simulate-lockdrop.json) is used for category-wise allocation of `$Z` with respective vesting/unlock schedules (unlock frequency reduced to 60 seconds or 30 blocks for lockdrop participants for demo purposes).
### Step 2: Genesis Transaction (Gentx) Signing
Since we have dummy accounts from the test run, we can access there private keys present in `generated-accounts.json`.
Get the private key of first account present in this file:
```bash
# Working directory: <path/to/zenith-stack>/ansible
jq -r '.[0].zenithPrivateKey' ../generated/generated-accounts.json
```
Note this private key down as it will be required in next step.
Now run the playbook to sign the gentx and generate final genesis file:
```bash
zenith-ansible -i ./inventories/development/hosts.yml stage1-site.yml -e "mode=sign"
```
Use the private key noted above when prompted.
This will:
- Automatically extract the pubkey of your validator node
- Create a genesis transaction (gentx) using the validator public key and private key
- Combine the base genesis file with the bootstrap validator gentx
- Generate the final genesis file
- Copy final genesis to `<path/to/zenith-stack>/genesis-file/genesis.json`
### Step 3: Start Validator Node
Now, we can use this genesis file to run the stage 1 validator node:
```bash
zenith-ansible -i ./inventories/development/hosts.yml stage1-site.yml -e "mode=start" --skip-tags onboarding
```
After starting the node, verify it's running correctly:
```bash
# Set deployments data directory (should match configuration)
DATA_DIRECTORY=/absolute/path/to/deployments/directory
# Check validator logs
laconic-so deployment --dir $DATA_DIRECTORY/mainnet-zenithd-deployment logs zenithd -f
```
Now we have a zenithd node running with the simulated participants data.
### Step 4: Run Lockdrop Distribution Notebook
Now we can execute the reference Jupyter notebook to perform lockdrop allocation calculations on the test participants data and produce analysis outputs. The notebook output is used further in the simulation test suite.
1. **Create Virtual Environment and Install Dependencies**
Create and activate a Python virtual environment:
```bash
# Navigate to the directory where you had cloned the lockdrop-simulation repo
cd lockdrop-simulation
python3 -m venv venv
source venv/bin/activate
```
Install required Python packages:
```bash
pip install -r requirements.txt
```
Export path to the `generated` directory in `zenith-stack` repo from [Step 1](#step-1-simulated-token-genesis-event):
```bash
export GENERATED_DIR="<path/to/zenith-stack>/generated"
```
2. **Execute the Notebook**
Run the notebook to generate allocation calculations:
```bash
jupyter nbconvert --to notebook --execute --inplace --log-level WARN lockdrop-calculations-simulated.ipynb
```
This will:
- Process the lockdrop participants data from chosen test run
- Calculate allocation amounts for different lock periods
- Generate artifacts (`lockdrop_allocations_notebook.json`) for comparison with the data from zenithd node
3. **View Notebook Results (Optional)**
To view the analysis on participants data, open the notebook in your browser at <http://localhost:8888/notebooks/lockdrop-calculations-simulated.ipynb>:
```bash
jupyter notebook lockdrop-calculations-simulated.ipynb
```
The notebook contains useful visualizations including allocation distributions, lock period analysis, and participant statistics.
### Step 5: Run Simulation Tests
Now we can run the comprehensive test suite to validate that the zenithd node's TGE allocations match notebook results and run-time accruals happen as expected.
1. **Set Environment Variables**
Configure API endpoints for the running zenithd node:
```bash
export REST_API_ENDPOINT="http://localhost:1317"
export RPC_API_ENDPOINT="http://localhost:26657"
```
2. **Run All Tests**
Navigate to the lockdrop-simulation directory (if not already there):
```bash
cd <path/to/lockdrop-simulation>
```
Activate `venv`:
```bash
source venv/bin/activate
```
Execute the complete test suite:
```bash
python3 tests/run_all_tests.py
```
This will run tests in the following order:
- **Allocation Tests**: Compare star, galaxy, and total allocations between notebook and zenithd
- **Unlock Schedule Tests**: Validate unlock block calculations (considering each point's locking time) and initial unlock amounts
- **Accrual State Tests**: Verify accrual state calculations at current block height
## Compare Results
After running the tests, compare your output from the tests above to output from the chosen test run (eg. `test-runs/run1/output.log`):
- Allocations: The allocations comparisons (`STAR ALLOCATIONS COMPARISON`, `GALAXY ALLOCATIONS COMPARISON` and `TOTAL ALLOCATIONS COMPARISON`) should match exactly as the TGE process is time-invariant
- Token unlock schedules:
- Since the chain from your run starts at a later time than that from the original test run, the effective calculated unlock schedule for points will be different
- In `UNLOCK BLOCKS COMPARISON`, the `Expected Blocks` (your run) should be `<` `Expected Blocks` (test run)
- In `INITIAL UNLOCK AMOUNTS COMPARISON`, the `Expected ($sZ)` (your run) should be `>` `Expected ($sZ)` (test run)
- Accrual states: Since this checks accrual state at time of running the test, in `TOTAL UNLOCKED AT BLOCK X`, the `Expected ($sZ)` will be different across runs
If all the tests pass and above conditions hold, it confirms that the simulation produces consistent results.
## Cleanup
### Validator Deployment
Navigate to the Ansible directory:
```bash
cd <path/to/zenith-stack>/ansible
```
Stop validator deployment:
```bash
zenith-ansible -i ./inventories/development/hosts.yml stage1-site.yml -e "mode=stop" --skip-tags onboarding
```
Clean up validator deployment:
```bash
zenith-ansible -i ./inventories/development/hosts.yml stage1-site.yml -e "mode=cleanup" --skip-tags onboarding -K
```
### Python Virtual Environment
Go to the `lockdrop-simulation` directory:
```bash
cd <path/to/lockdrop-simulation>
```
Clean up Python virtual environment:
```bash
# Deactivate virtual environment (if currently active)
deactivate
# Remove virtual environment directory
rm -rf venv
```

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
{
"totalParticipants": 400,
"validators": 200,
"delegators": 200,
"galaxiesAllocated": 200,
"starsAllocated": 30000,
"config": {
"totalParticipants": 400,
"galaxyCount": 200,
"starCount": 30000,
"outputDir": "/app/generated"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
{
"metadata": {
"source": "lockdrop-calculations-simulated.ipynb",
"participation_counts": {
"stars_1_years": 5962,
"galaxies_1_years": 49,
"stars_2_years": 5880,
"galaxies_2_years": 36,
"stars_3_years": 6033,
"galaxies_3_years": 35,
"stars_4_years": 6117,
"galaxies_4_years": 43,
"stars_5_years": 6008,
"galaxies_5_years": 37
}
},
"allocations": {
"stars": {
"1_years": 855210960000,
"2_years": 1710421920000,
"3_years": 2565632880000,
"4_years": 3420843840000,
"5_years": 12780607328988
},
"galaxies": {
"1_years": 501765840000,
"2_years": 1003531680000,
"3_years": 1505297520000,
"4_years": 2007063360000,
"5_years": 8205775018378
},
"total": 128849018879999890
}
}

144
test-runs/run1/output.log Normal file
View File

@ -0,0 +1,144 @@
================================================================================
LOCKDROP ALLOCATION COMPARISON TESTS
================================================================================
test_0_star_allocations (test_allocations.AllocationTest.test_0_star_allocations)
Test star allocations for all lock periods ...
STAR ALLOCATIONS COMPARISON
+---------------+---------+-----------------------------------------------+--------------------+--------------------+--------------+
| Lock Period | Point | Zenith Address | Notebook ($sZ) | zenithd ($sZ) | Difference |
+===============+=========+===============================================+====================+====================+==============+
| 1 years | ~milzod | zenith1udqej93xhavjrpaxeazkgtz4m2x4tr7l07ptcj | 855,210,960,000 | 855,210,960,000 | 0 |
+---------------+---------+-----------------------------------------------+--------------------+--------------------+--------------+
| 2 years | ~disbec | zenith1udqej93xhavjrpaxeazkgtz4m2x4tr7l07ptcj | 1,710,421,920,000 | 1,710,421,920,000 | 0 |
+---------------+---------+-----------------------------------------------+--------------------+--------------------+--------------+
| 3 years | ~famtul | zenith1udqej93xhavjrpaxeazkgtz4m2x4tr7l07ptcj | 2,565,632,880,000 | 2,565,632,880,000 | 0 |
+---------------+---------+-----------------------------------------------+--------------------+--------------------+--------------+
| 4 years | ~lorsut | zenith1udqej93xhavjrpaxeazkgtz4m2x4tr7l07ptcj | 3,420,843,840,000 | 3,420,843,840,000 | 0 |
+---------------+---------+-----------------------------------------------+--------------------+--------------------+--------------+
| 5 years | ~tortyp | zenith1udqej93xhavjrpaxeazkgtz4m2x4tr7l07ptcj | 12,780,607,328,988 | 12,780,607,328,988 | 0 |
+---------------+---------+-----------------------------------------------+--------------------+--------------------+--------------+
ok
test_1_galaxy_allocations (test_allocations.AllocationTest.test_1_galaxy_allocations)
Test galaxy allocations for all lock periods ...
GALAXY ALLOCATIONS COMPARISON
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| Lock Period | Point | Zenith Address | Notebook ($sZ) | zenithd ($sZ) | Difference |
+===============+=========+===============================================+===================+===================+==============+
| 1 years | ~tec | zenith1p22wyjr0epplr8cktnc73dpeynph8n3vknvhnl | 501,765,840,000 | 501,765,840,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 2 years | ~tem | zenith1ghpvwrwjwr9fgazunpsy300l672ev25z330we7 | 1,003,531,680,000 | 1,003,531,680,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 3 years | ~sed | zenith1teqcdpzqslgtrwul2ac2h6x4vp7ld8adzm2gzf | 1,505,297,520,000 | 1,505,297,520,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 4 years | ~nec | zenith1qtf9hffx738fl4ddkk8tar9989qr7u0g59d5h0 | 2,007,063,360,000 | 2,007,063,360,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 5 years | ~byl | zenith1udqej93xhavjrpaxeazkgtz4m2x4tr7l07ptcj | 8,205,775,018,378 | 8,205,775,018,378 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
ok
test_2_total_allocations (test_allocations.AllocationTest.test_2_total_allocations)
Test total allocations for all participants ...
TOTAL ALLOCATIONS COMPARISON
+------------+--------------------------+
| Source | Total Allocation ($sZ) |
+============+==========================+
| Notebook | 128,849,018,879,999,890 |
+------------+--------------------------+
| zenithd | 128,849,018,879,999,890 |
+------------+--------------------------+
| Difference | 0 |
+------------+--------------------------+
ok
test_unlock_schedule_calculation (test_unlock_schedule.UnlockScheduleTest.test_unlock_schedule_calculation)
Test unlock schedule calculations for all lock periods ...
UNLOCK BLOCKS COMPARISON
+---------+---------------+---------------------+-------------------+------------------+--------------+
| Point | Lock Period | Start Time | Expected Blocks | zenithd Blocks | Difference |
+=========+===============+=====================+===================+==================+==============+
| ~milzod | 1 years | 2025-07-07T14:43:58 | 14,172,264 | 14,172,264 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~tec | 1 years | 2025-05-03T23:34:40 | 11,380,185 | 11,380,185 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~disbec | 2 years | 2025-07-07T14:43:58 | 29,951,064 | 29,951,064 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~tem | 2 years | 2025-05-24T04:03:39 | 28,031,054 | 28,031,054 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~famtul | 3 years | 2025-07-07T14:43:58 | 45,729,864 | 45,729,864 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~sed | 3 years | 2025-07-07T10:55:28 | 45,723,009 | 45,723,009 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~lorsut | 4 years | 2025-07-07T14:43:58 | 61,508,664 | 61,508,664 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~nec | 4 years | 2025-05-08T09:19:35 | 58,906,932 | 58,906,932 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~tortyp | 5 years | 2025-07-07T14:43:58 | 77,287,464 | 77,287,464 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~byl | 5 years | 2025-07-07T14:43:58 | 77,287,464 | 77,287,464 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
INITIAL UNLOCK AMOUNTS COMPARISON
+---------+---------------+---------------------+------------------+-----------------+--------------+
| Point | Lock Period | Start Time | Expected ($sZ) | zenithd ($sZ) | Difference |
+=========+===============+=====================+==================+=================+==============+
| ~milzod | 1 years | 2025-07-07T14:43:58 | 87,074,251,200 | 87,074,251,200 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~tec | 1 years | 2025-05-03T23:34:40 | 139,875,957,000 | 139,875,957,000 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~disbec | 2 years | 2025-07-07T14:43:58 | 87,074,251,200 | 87,074,251,200 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~tem | 2 years | 2025-05-24T04:03:39 | 112,144,162,800 | 112,144,162,800 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~famtul | 3 years | 2025-07-07T14:43:58 | 87,074,251,200 | 87,074,251,200 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~sed | 3 years | 2025-07-07T10:55:28 | 51,305,833,800 | 51,305,833,800 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~lorsut | 4 years | 2025-07-07T14:43:58 | 87,074,251,200 | 87,074,251,200 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~nec | 4 years | 2025-05-08T09:19:35 | 133,822,922,400 | 133,822,922,400 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~tortyp | 5 years | 2025-07-07T14:43:58 | 260,254,338,427 | 260,254,338,427 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~byl | 5 years | 2025-07-07T14:43:58 | 167,096,014,588 | 167,096,014,588 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
ok
test_accrual_state_calculation (test_accrual_state.AccrualStateTest.test_accrual_state_calculation)
Test accrual state calculations after some blocks ...
TOTAL UNLOCKED AT BLOCK 612
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| Point | Lock Period | Block Height | Last Unlocked At | Expected ($sZ) | zenithd ($sZ) | Difference |
+=========+===============+================+====================+==================+=================+==============+
| ~milzod | 1 years | Block 612 | Block 600 | 87,106,771,200 | 87,106,771,200 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~tec | 1 years | Block 612 | Block 600 | 139,895,037,000 | 139,895,037,000 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~disbec | 2 years | Block 612 | Block 600 | 87,106,771,200 | 87,106,771,200 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~tem | 2 years | Block 612 | Block 600 | 112,163,242,800 | 112,163,242,800 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~famtul | 3 years | Block 612 | Block 600 | 87,106,771,200 | 87,106,771,200 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~sed | 3 years | Block 612 | Block 600 | 51,324,913,800 | 51,324,913,800 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~lorsut | 4 years | Block 612 | Block 600 | 87,106,771,200 | 87,106,771,200 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~nec | 4 years | Block 612 | Block 600 | 133,842,002,400 | 133,842,002,400 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~tortyp | 5 years | Block 612 | Block 600 | 260,351,536,748 | 260,351,536,748 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~byl | 5 years | Block 612 | Block 600 | 167,158,420,664 | 167,158,420,664 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
ok
----------------------------------------------------------------------
Ran 5 tests in 2.939s
OK

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
{
"totalParticipants": 400,
"validators": 210,
"delegators": 190,
"galaxiesAllocated": 210,
"starsAllocated": 15000,
"config": {
"totalParticipants": 400,
"galaxyCount": 210,
"starCount": 15000,
"outputDir": "/app/generated"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
{
"metadata": {
"source": "lockdrop-calculations-simulated.ipynb",
"participation_counts": {
"stars_1_years": 3008,
"galaxies_1_years": 44,
"stars_2_years": 2983,
"galaxies_2_years": 43,
"stars_3_years": 3027,
"galaxies_3_years": 43,
"stars_4_years": 2986,
"galaxies_4_years": 39,
"stars_5_years": 2996,
"galaxies_5_years": 41
}
},
"allocations": {
"stars": {
"1_years": 1710421920000,
"2_years": 3420843840000,
"3_years": 5131265760000,
"4_years": 6841687680000,
"5_years": 25712535120801
},
"galaxies": {
"1_years": 478097640000,
"2_years": 956195280000,
"3_years": 1434292920000,
"4_years": 1912390560000,
"5_years": 7436730717073
},
"total": 128849018879999789
}
}

144
test-runs/run2/output.log Normal file
View File

@ -0,0 +1,144 @@
================================================================================
LOCKDROP ALLOCATION COMPARISON TESTS
================================================================================
test_0_star_allocations (test_allocations.AllocationTest.test_0_star_allocations)
Test star allocations for all lock periods ...
STAR ALLOCATIONS COMPARISON
+---------------+---------+-----------------------------------------------+--------------------+--------------------+--------------+
| Lock Period | Point | Zenith Address | Notebook ($sZ) | zenithd ($sZ) | Difference |
+===============+=========+===============================================+====================+====================+==============+
| 1 years | ~datner | zenith19uhxfy49a35gdywvdn4q3k0grg5r2lmzpp7gjv | 1,710,421,920,000 | 1,710,421,920,000 | 0 |
+---------------+---------+-----------------------------------------------+--------------------+--------------------+--------------+
| 2 years | ~falryl | zenith19uhxfy49a35gdywvdn4q3k0grg5r2lmzpp7gjv | 3,420,843,840,000 | 3,420,843,840,000 | 0 |
+---------------+---------+-----------------------------------------------+--------------------+--------------------+--------------+
| 3 years | ~laprud | zenith19uhxfy49a35gdywvdn4q3k0grg5r2lmzpp7gjv | 5,131,265,760,000 | 5,131,265,760,000 | 0 |
+---------------+---------+-----------------------------------------------+--------------------+--------------------+--------------+
| 4 years | ~tamfyl | zenith19uhxfy49a35gdywvdn4q3k0grg5r2lmzpp7gjv | 6,841,687,680,000 | 6,841,687,680,000 | 0 |
+---------------+---------+-----------------------------------------------+--------------------+--------------------+--------------+
| 5 years | ~talret | zenith19uhxfy49a35gdywvdn4q3k0grg5r2lmzpp7gjv | 25,712,535,120,801 | 25,712,535,120,801 | 0 |
+---------------+---------+-----------------------------------------------+--------------------+--------------------+--------------+
ok
test_1_galaxy_allocations (test_allocations.AllocationTest.test_1_galaxy_allocations)
Test galaxy allocations for all lock periods ...
GALAXY ALLOCATIONS COMPARISON
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| Lock Period | Point | Zenith Address | Notebook ($sZ) | zenithd ($sZ) | Difference |
+===============+=========+===============================================+===================+===================+==============+
| 1 years | ~rex | zenith1utk4hg6x0jg4s30wyazkg9uezhvtuql44lfmvr | 478,097,640,000 | 478,097,640,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 2 years | ~bep | zenith1cr693w3x5knc8k9vgvy0rah69pew374zud2fjg | 956,195,280,000 | 956,195,280,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 3 years | ~sul | zenith1d77nw76k00uhulfvsrdmg7anqauraz7mpsnxpr | 1,434,292,920,000 | 1,434,292,920,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 4 years | ~tuc | zenith18rrscz5kmmy3tajd7a97cfe5ez0gcs85uxtr83 | 1,912,390,560,000 | 1,912,390,560,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 5 years | ~fyr | zenith19uhxfy49a35gdywvdn4q3k0grg5r2lmzpp7gjv | 7,436,730,717,073 | 7,436,730,717,073 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
ok
test_2_total_allocations (test_allocations.AllocationTest.test_2_total_allocations)
Test total allocations for all participants ...
TOTAL ALLOCATIONS COMPARISON
+------------+--------------------------+
| Source | Total Allocation ($sZ) |
+============+==========================+
| Notebook | 128,849,018,879,999,789 |
+------------+--------------------------+
| zenithd | 128,849,018,879,999,789 |
+------------+--------------------------+
| Difference | 0 |
+------------+--------------------------+
ok
test_unlock_schedule_calculation (test_unlock_schedule.UnlockScheduleTest.test_unlock_schedule_calculation)
Test unlock schedule calculations for all lock periods ...
UNLOCK BLOCKS COMPARISON
+---------+---------------+---------------------+-------------------+------------------+--------------+
| Point | Lock Period | Start Time | Expected Blocks | zenithd Blocks | Difference |
+=========+===============+=====================+===================+==================+==============+
| ~datner | 1 years | 2025-02-24T19:24:19 | 8,398,207 | 8,398,207 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~rex | 1 years | 2025-08-06T17:55:51 | 15,437,153 | 15,437,153 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~falryl | 2 years | 2025-02-24T19:24:19 | 24,177,007 | 24,177,007 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~bep | 2 years | 2025-04-04T11:10:19 | 25,846,987 | 25,846,987 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~laprud | 3 years | 2025-02-24T19:24:19 | 39,955,807 | 39,955,807 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~sul | 3 years | 2025-07-17T03:49:48 | 46,105,372 | 46,105,372 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~tamfyl | 4 years | 2025-02-24T19:24:19 | 55,734,607 | 55,734,607 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~tuc | 4 years | 2025-04-09T15:22:47 | 57,628,161 | 57,628,161 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~talret | 5 years | 2025-02-24T19:24:19 | 71,513,407 | 71,513,407 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~fyr | 5 years | 2025-02-24T19:24:19 | 71,513,407 | 71,513,407 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
INITIAL UNLOCK AMOUNTS COMPARISON
+---------+---------------+---------------------+-------------------+-------------------+--------------+
| Point | Lock Period | Start Time | Expected ($sZ) | zenithd ($sZ) | Difference |
+=========+===============+=====================+===================+===================+==============+
| ~datner | 1 years | 2025-02-24T19:24:19 | 800,056,281,200 | 800,056,281,200 | 0 |
+---------+---------------+---------------------+-------------------+-------------------+--------------+
| ~rex | 1 years | 2025-08-06T17:55:51 | 10,351,904,100 | 10,351,904,100 | 0 |
+---------+---------------+---------------------+-------------------+-------------------+--------------+
| ~falryl | 2 years | 2025-02-24T19:24:19 | 800,056,281,200 | 800,056,281,200 | 0 |
+---------+---------------+---------------------+-------------------+-------------------+--------------+
| ~bep | 2 years | 2025-04-04T11:10:19 | 173,031,573,900 | 173,031,573,900 | 0 |
+---------+---------------+---------------------+-------------------+-------------------+--------------+
| ~laprud | 3 years | 2025-02-24T19:24:19 | 800,056,281,200 | 800,056,281,200 | 0 |
+---------+---------------+---------------------+-------------------+-------------------+--------------+
| ~sul | 3 years | 2025-07-17T03:49:48 | 37,300,148,400 | 37,300,148,400 | 0 |
+---------+---------------+---------------------+-------------------+-------------------+--------------+
| ~tamfyl | 4 years | 2025-02-24T19:24:19 | 800,056,281,200 | 800,056,281,200 | 0 |
+---------+---------------+---------------------+-------------------+-------------------+--------------+
| ~tuc | 4 years | 2025-04-09T15:22:47 | 166,257,281,700 | 166,257,281,700 | 0 |
+---------+---------------+---------------------+-------------------+-------------------+--------------+
| ~talret | 5 years | 2025-02-24T19:24:19 | 2,405,426,987,157 | 2,405,426,987,157 | 0 |
+---------+---------------+---------------------+-------------------+-------------------+--------------+
| ~fyr | 5 years | 2025-02-24T19:24:19 | 695,711,748,337 | 695,711,748,337 | 0 |
+---------+---------------+---------------------+-------------------+-------------------+--------------+
ok
test_accrual_state_calculation (test_accrual_state.AccrualStateTest.test_accrual_state_calculation)
Test accrual state calculations after some blocks ...
TOTAL UNLOCKED AT BLOCK 168
+---------+---------------+----------------+--------------------+-------------------+-------------------+--------------+
| Point | Lock Period | Block Height | Last Unlocked At | Expected ($sZ) | zenithd ($sZ) | Difference |
+=========+===============+================+====================+===================+===================+==============+
| ~datner | 1 years | Block 168 | Block 150 | 800,072,541,200 | 800,072,541,200 | 0 |
+---------+---------------+----------------+--------------------+-------------------+-------------------+--------------+
| ~rex | 1 years | Block 168 | Block 150 | 10,356,449,100 | 10,356,449,100 | 0 |
+---------+---------------+----------------+--------------------+-------------------+-------------------+--------------+
| ~falryl | 2 years | Block 168 | Block 150 | 800,072,541,200 | 800,072,541,200 | 0 |
+---------+---------------+----------------+--------------------+-------------------+-------------------+--------------+
| ~bep | 2 years | Block 168 | Block 150 | 173,036,118,900 | 173,036,118,900 | 0 |
+---------+---------------+----------------+--------------------+-------------------+-------------------+--------------+
| ~laprud | 3 years | Block 168 | Block 150 | 800,072,541,200 | 800,072,541,200 | 0 |
+---------+---------------+----------------+--------------------+-------------------+-------------------+--------------+
| ~sul | 3 years | Block 168 | Block 150 | 37,304,693,400 | 37,304,693,400 | 0 |
+---------+---------------+----------------+--------------------+-------------------+-------------------+--------------+
| ~tamfyl | 4 years | Block 168 | Block 150 | 800,072,541,200 | 800,072,541,200 | 0 |
+---------+---------------+----------------+--------------------+-------------------+-------------------+--------------+
| ~tuc | 4 years | Block 168 | Block 150 | 166,261,826,700 | 166,261,826,700 | 0 |
+---------+---------------+----------------+--------------------+-------------------+-------------------+--------------+
| ~talret | 5 years | Block 168 | Block 150 | 2,405,475,874,021 | 2,405,475,874,021 | 0 |
+---------+---------------+----------------+--------------------+-------------------+-------------------+--------------+
| ~fyr | 5 years | Block 168 | Block 150 | 695,725,887,683 | 695,725,887,683 | 0 |
+---------+---------------+----------------+--------------------+-------------------+-------------------+--------------+
ok
----------------------------------------------------------------------
Ran 5 tests in 2.086s
OK

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
{
"totalParticipants": 500,
"validators": 150,
"delegators": 350,
"galaxiesAllocated": 150,
"starsAllocated": 45000,
"config": {
"totalParticipants": 500,
"galaxyCount": 150,
"starCount": 45000,
"outputDir": "/app/generated"
}
}

File diff suppressed because it is too large Load Diff

144
test-runs/run3/output.log Normal file
View File

@ -0,0 +1,144 @@
================================================================================
LOCKDROP ALLOCATION COMPARISON TESTS
================================================================================
test_0_star_allocations (test_allocations.AllocationTest.test_0_star_allocations)
Test star allocations for all lock periods ...
STAR ALLOCATIONS COMPARISON
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| Lock Period | Point | Zenith Address | Notebook ($sZ) | zenithd ($sZ) | Difference |
+===============+=========+===============================================+===================+===================+==============+
| 1 years | ~witmyr | zenith1429hr8jl4ucpagh0l4yljet6pg823cg8k6k2je | 569,614,680,000 | 569,614,680,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 2 years | ~difwen | zenith1429hr8jl4ucpagh0l4yljet6pg823cg8k6k2je | 1,139,229,360,000 | 1,139,229,360,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 3 years | ~winsel | zenith1429hr8jl4ucpagh0l4yljet6pg823cg8k6k2je | 1,708,844,040,000 | 1,708,844,040,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 4 years | ~rilbyt | zenith1429hr8jl4ucpagh0l4yljet6pg823cg8k6k2je | 2,278,458,720,000 | 2,278,458,720,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 5 years | ~tocfur | zenith1429hr8jl4ucpagh0l4yljet6pg823cg8k6k2je | 8,505,886,434,146 | 8,505,886,434,146 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
ok
test_1_galaxy_allocations (test_allocations.AllocationTest.test_1_galaxy_allocations)
Test galaxy allocations for all lock periods ...
GALAXY ALLOCATIONS COMPARISON
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| Lock Period | Point | Zenith Address | Notebook ($sZ) | zenithd ($sZ) | Difference |
+===============+=========+===============================================+===================+===================+==============+
| 1 years | ~byl | zenith1zlx6fewfd0c5ln9e0746qv2qlg4qrhp9vjqlxl | 670,599,000,000 | 670,599,000,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 2 years | ~nel | zenith1msqxk2plmj0hhwc73ejlvlhcm2q4maedprnxua | 1,341,198,000,000 | 1,341,198,000,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 3 years | ~dut | zenith1fg0uaa4avyfgq9skk9mm7cxp7dessjw07lh7er | 2,011,797,000,000 | 2,011,797,000,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 4 years | ~tyl | zenith17sefau4gd2gkr2urc6g8jmek9ly38uuzhlgfpg | 2,682,396,000,000 | 2,682,396,000,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
| 5 years | ~pes | zenith1429hr8jl4ucpagh0l4yljet6pg823cg8k6k2je | 9,691,219,900,000 | 9,691,219,900,000 | 0 |
+---------------+---------+-----------------------------------------------+-------------------+-------------------+--------------+
ok
test_2_total_allocations (test_allocations.AllocationTest.test_2_total_allocations)
Test total allocations for all participants ...
TOTAL ALLOCATIONS COMPARISON
+------------+--------------------------+
| Source | Total Allocation ($sZ) |
+============+==========================+
| Notebook | 128,849,018,879,996,906 |
+------------+--------------------------+
| zenithd | 128,849,018,879,996,906 |
+------------+--------------------------+
| Difference | 0 |
+------------+--------------------------+
ok
test_unlock_schedule_calculation (test_unlock_schedule.UnlockScheduleTest.test_unlock_schedule_calculation)
Test unlock schedule calculations for all lock periods ...
UNLOCK BLOCKS COMPARISON
+---------+---------------+---------------------+-------------------+------------------+--------------+
| Point | Lock Period | Start Time | Expected Blocks | zenithd Blocks | Difference |
+=========+===============+=====================+===================+==================+==============+
| ~witmyr | 1 years | 2025-03-10T02:16:32 | 8,971,462 | 8,971,462 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~byl | 1 years | 2025-02-25T14:35:28 | 8,432,030 | 8,432,030 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~difwen | 2 years | 2025-03-10T02:16:32 | 24,750,262 | 24,750,262 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~nel | 2 years | 2025-04-29T17:51:48 | 26,938,320 | 26,938,320 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~winsel | 3 years | 2025-03-10T02:16:32 | 40,529,062 | 40,529,062 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~dut | 3 years | 2025-06-06T22:27:38 | 44,366,995 | 44,366,995 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~rilbyt | 4 years | 2025-03-10T02:16:32 | 56,307,862 | 56,307,862 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~tyl | 4 years | 2025-06-14T22:41:19 | 60,491,806 | 60,491,806 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~tocfur | 5 years | 2025-03-10T02:16:32 | 72,086,662 | 72,086,662 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
| ~pes | 5 years | 2025-03-10T02:16:32 | 72,086,662 | 72,086,662 | 0 |
+---------+---------------+---------------------+-------------------+------------------+--------------+
INITIAL UNLOCK AMOUNTS COMPARISON
+---------+---------------+---------------------+------------------+-----------------+--------------+
| Point | Lock Period | Start Time | Expected ($sZ) | zenithd ($sZ) | Difference |
+=========+===============+=====================+==================+=================+==============+
| ~witmyr | 1 years | 2025-03-10T02:16:32 | 245,744,901,800 | 245,744,901,800 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~byl | 1 years | 2025-02-25T14:35:28 | 312,237,725,000 | 312,237,725,000 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~difwen | 2 years | 2025-03-10T02:16:32 | 245,744,901,800 | 245,744,901,800 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~nel | 2 years | 2025-04-29T17:51:48 | 196,319,400,000 | 196,319,400,000 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~winsel | 3 years | 2025-03-10T02:16:32 | 245,744,901,800 | 245,744,901,800 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~dut | 3 years | 2025-06-06T22:27:38 | 126,199,712,500 | 126,199,712,500 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~rilbyt | 4 years | 2025-03-10T02:16:32 | 245,744,901,800 | 245,744,901,800 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~tyl | 4 years | 2025-06-14T22:41:19 | 111,494,245,000 | 111,494,245,000 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~tocfur | 5 years | 2025-03-10T02:16:32 | 733,927,091,373 | 733,927,091,373 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
| ~pes | 5 years | 2025-03-10T02:16:32 | 836,203,126,874 | 836,203,126,874 | 0 |
+---------+---------------+---------------------+------------------+-----------------+--------------+
ok
test_accrual_state_calculation (test_accrual_state.AccrualStateTest.test_accrual_state_calculation)
Test accrual state calculations after some blocks ...
TOTAL UNLOCKED AT BLOCK 84
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| Point | Lock Period | Block Height | Last Unlocked At | Expected ($sZ) | zenithd ($sZ) | Difference |
+=========+===============+================+====================+==================+=================+==============+
| ~witmyr | 1 years | Block 84 | Block 60 | 245,747,067,800 | 245,747,067,800 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~byl | 1 years | Block 84 | Block 60 | 312,240,275,000 | 312,240,275,000 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~difwen | 2 years | Block 84 | Block 60 | 245,747,067,800 | 245,747,067,800 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~nel | 2 years | Block 84 | Block 60 | 196,321,950,000 | 196,321,950,000 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~winsel | 3 years | Block 84 | Block 60 | 245,747,067,800 | 245,747,067,800 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~dut | 3 years | Block 84 | Block 60 | 126,202,262,500 | 126,202,262,500 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~rilbyt | 4 years | Block 84 | Block 60 | 245,747,067,800 | 245,747,067,800 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~tyl | 4 years | Block 84 | Block 60 | 111,496,795,000 | 111,496,795,000 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~tocfur | 5 years | Block 84 | Block 60 | 733,933,560,219 | 733,933,560,219 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
| ~pes | 5 years | Block 84 | Block 60 | 836,210,497,183 | 836,210,497,183 | 0 |
+---------+---------------+----------------+--------------------+------------------+-----------------+--------------+
ok
----------------------------------------------------------------------
Ran 5 tests in 4.311s
OK

View File

@ -6,10 +6,12 @@ from base_test import BaseAllocationTest
class AccrualStateTest(BaseAllocationTest):
"""Test accrual state calculations"""
def tearDown(self):
# Blank line after each test
print("\n")
def test_accrual_state_calculation(self):
"""Test accrual state calculations after some blocks"""
print("\nACCRUAL STATE CALCULATIONS")
# Get latest block height for testing
test_block_height = self._get_latest_block_height_from_api()
if not test_block_height:
@ -90,7 +92,7 @@ class AccrualStateTest(BaseAllocationTest):
f"Diff={difference:+,} $sZ")
# Print table
print(f"\nTotal Unlocked at Block {test_block_height}:")
print(f"\nTOTAL UNLOCKED AT BLOCK {test_block_height}")
headers = ["Point", "Lock Period", "Block Height", "Last Unlocked At", "Expected ($sZ)", "zenithd ($sZ)", "Difference"]
print(tabulate(accrual_data, headers=headers, tablefmt="grid"))

View File

@ -6,9 +6,12 @@ from base_test import BaseAllocationTest
class AllocationTest(BaseAllocationTest):
"""Test allocation comparisons between notebook and zenithd"""
def tearDown(self):
# Blank line after each test
print("\n")
def test_0_star_allocations(self):
"""Test star allocations for all lock periods"""
print("\nSTAR ALLOCATIONS COMPARISON")
table_data = []
headers = ["Lock Period", "Point", "Zenith Address", "Notebook ($sZ)", "zenithd ($sZ)", "Difference"]
@ -51,11 +54,11 @@ class AllocationTest(BaseAllocationTest):
f"zenithd={api_allocation:,} $sZ, "
f"Diff={difference:+,} $sZ")
print("\nSTAR ALLOCATIONS COMPARISON")
print(tabulate(table_data, headers=headers, tablefmt="grid"))
def test_1_galaxy_allocations(self):
"""Test galaxy allocations for all lock periods"""
print("\nGALAXY ALLOCATIONS COMPARISON")
table_data = []
headers = ["Lock Period", "Point", "Zenith Address", "Notebook ($sZ)", "zenithd ($sZ)", "Difference"]
@ -98,11 +101,11 @@ class AllocationTest(BaseAllocationTest):
f"zenithd={api_allocation:,} $sZ, "
f"Diff={difference:+,} $sZ")
print("\nGALAXY ALLOCATIONS COMPARISON")
print(tabulate(table_data, headers=headers, tablefmt="grid"))
def test_2_total_allocations(self):
"""Test total allocations for all participants"""
print("\nTOTAL ALLOCATIONS COMPARISON")
notebook_total = self.notebook_allocations.get('total', 0)
@ -127,6 +130,7 @@ class AllocationTest(BaseAllocationTest):
]
headers = ["Source", "Total Allocation ($sZ)"]
print("\nTOTAL ALLOCATIONS COMPARISON")
print(tabulate(table_data, headers=headers, tablefmt="grid"))
self.assertEqual(notebook_total, api_total,

View File

@ -7,9 +7,12 @@ from base_test import BaseAllocationTest, SECONDS_PER_YEAR, BLOCK_DURATION_SECON
class UnlockScheduleTest(BaseAllocationTest):
"""Test unlock schedule calculations"""
def tearDown(self):
# Blank line after each test
print("\n")
def test_unlock_schedule_calculation(self):
"""Test unlock schedule calculations for all lock periods"""
print("\nUNLOCK SCHEDULE CALCULATIONS")
genesis_timestamp = self._get_genesis_time_from_api()
if not genesis_timestamp:
@ -98,11 +101,11 @@ class UnlockScheduleTest(BaseAllocationTest):
f"Diff={unlock_diff:+,} $sZ")
# Print tables
print("\nUnlock Blocks Comparison:")
print("\nUNLOCK BLOCKS COMPARISON")
unlock_blocks_headers = ["Point", "Lock Period", "Start Time", "Expected Blocks", "zenithd Blocks", "Difference"]
print(tabulate(unlock_blocks_data, headers=unlock_blocks_headers, tablefmt="grid"))
print("\nInitial Unlock Amounts Comparison:")
print("\nINITIAL UNLOCK AMOUNTS COMPARISON")
initial_unlock_headers = ["Point", "Lock Period", "Start Time", "Expected ($sZ)", "zenithd ($sZ)", "Difference"]
print(tabulate(initial_unlock_data, headers=initial_unlock_headers, tablefmt="grid"))