From 53d2362a599b00a68a4874eb23efe5be43bc3f9c Mon Sep 17 00:00:00 2001 From: Nabarun Date: Wed, 18 Jun 2025 18:56:57 +0000 Subject: [PATCH] Skip allocation of LPS tokens for early supports account (#27) Reviewed-on: https://git.vdb.to/cerc-io/laconicd-stack/pulls/27 Co-authored-by: Nabarun Co-committed-by: Nabarun --- docs/demo.md | 10 +--------- docs/run-first-validator.md | 14 +------------- scripts/genesis.sh | 23 ++++++++++++++++------- 3 files changed, 18 insertions(+), 29 deletions(-) diff --git a/docs/demo.md b/docs/demo.md index 2a09fd6..c5f0a68 100644 --- a/docs/demo.md +++ b/docs/demo.md @@ -51,9 +51,6 @@ ```bash export EXPORTED_STATE_PATH=$CWD/testnet-state.json export LPS_DISTRIBUTION_PATH=~/cerc/laconicd-stack/data/distribution.json - - # Test address that does not exist on testnet chain - export EARLY_SUPPORTS_ACC_ADDR=laconic1gwytamfk3m5n0gsawh5vpwxkwd3vapmvzpp6nz ``` - Copy the example variables file: @@ -65,7 +62,7 @@ - Run playbook to use exported state for generating mainnet genesis: ```bash - ansible-playbook -v -i localhost, -c local ~/cerc/laconicd-stack/playbooks/first-validator/generate-genesis.yml -e "exported_state_path=$EXPORTED_STATE_PATH" -e "lps_distribution_path=$LPS_DISTRIBUTION_PATH" -e "early_supports_acc_address=$EARLY_SUPPORTS_ACC_ADDR" + ansible-playbook -v -i localhost, -c local ~/cerc/laconicd-stack/playbooks/first-validator/generate-genesis.yml -e "exported_state_path=$EXPORTED_STATE_PATH" -e "lps_distribution_path=$LPS_DISTRIBUTION_PATH" ``` - Genesis file will be generated in output directory along with a file specifying the staking amount @@ -179,9 +176,6 @@ export CWD=$(pwd) export DATA_DIRECTORY=$CWD export MAINNET_DEPLOYMENT_DIR=mainnet-laconicd-deployment - - # Test address that does not exist on testnet chain - export EARLY_SUPPORTS_ACC_ADDR=laconic1gwytamfk3m5n0gsawh5vpwxkwd3vapmvzpp6nz ``` - Enable TMKMS in the laconicd node configuration: @@ -242,8 +236,6 @@ lockup_account_address=$(laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'laconicd query auth module-account lps_lockup -o json | jq -r .account.value.base_account.address') laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd "laconicd query bank balances $lockup_account_address" - - laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd "laconicd query bank balances $EARLY_SUPPORTS_ACC_ADDR" ``` - Copy the genesis file to [config](./config) folder: diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index ef2530e..902f448 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -125,8 +125,6 @@ # File path where LPS distribution JSON file will be created export LPS_DISTRIBUTION_PATH= - export EARLY_SUPPORTS_ACC_ADDR= - # Parent directory where the deployment directory will be setup (required for generating genesis) export DATA_DIRECTORY= ``` @@ -173,7 +171,7 @@ - Run playbook for generating mainnet genesis file with gentx: ```bash - ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/first-validator/generate-genesis.yml -e "exported_state_path=$EXPORTED_STATE_PATH" -e "lps_distribution_path=$LPS_DISTRIBUTION_PATH" -e "early_supports_acc_address=$EARLY_SUPPORTS_ACC_ADDR" + ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/first-validator/generate-genesis.yml -e "exported_state_path=$EXPORTED_STATE_PATH" -e "lps_distribution_path=$LPS_DISTRIBUTION_PATH" ``` - When prompted for private key, use key of the existing account that was exported in [export-testnet.md](./export-testnet.md#export-testnet-state) @@ -311,16 +309,6 @@ laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd "laconicd query bank balances $lockup_account_address" ``` -- Query the early supports account balance: - - ```bash - # Set the early supports account address - export EARLY_SUPPORTS_ACC_ADDR= - - # Check balance - laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd "laconicd query bank balances $EARLY_SUPPORTS_ACC_ADDR" - ``` - ## Publish required artifacts - Run the following steps in machine where the genesis file and staking amount files were generated (machine 3) diff --git a/scripts/genesis.sh b/scripts/genesis.sh index c84d937..986dbc9 100755 --- a/scripts/genesis.sh +++ b/scripts/genesis.sh @@ -11,15 +11,22 @@ NODE_HOME="/root/.laconicd" EARLY_SUPPORTS_ACC_ADDRESS=${EARLY_SUPPORTS_ACC_ADDRESS} -if [ -z "$EARLY_SUPPORTS_ACC_ADDRESS" ]; then - echo "EARLY_SUPPORTS_ACC_ADDRESS not provided, exiting..." - exit 1 -fi +# Skipping early supports account allocation +# if [ -z "$EARLY_SUPPORTS_ACC_ADDRESS" ]; then +# echo "EARLY_SUPPORTS_ACC_ADDRESS not provided, exiting..." +# exit 1 +# fi # lps allocations # Total supply: 129600 lps -EARLY_SUPPORTS_ALLOC="25920" # Early supports: 25920 lps (20% of total supply) -LOCKUP_ALLOC="103680" # Lockup: 103680 lps (80% of total supply) + +# Old plan, will allocate 100% to lockup module instead +# EARLY_SUPPORTS_ALLOC="25920" # Early supports: 25920 lps (20% of total supply) +# LOCKUP_ALLOC="103680" # Lockup: 103680 lps (80% of total supply) + + +LOCKUP_ALLOC="129600" # Lockup: 129600 lps (100% of total supply) + LPS_LOCKUP_MODULE_ACCOUNT="lps_lockup" LPS_DENOM="lps" @@ -44,8 +51,10 @@ update_genesis '.app_state["gov"]["params"]["expedited_threshold"]="1.0000000000 # Set normal threshold to 99% since it needs to be lesser than expedited threshold update_genesis '.app_state["gov"]["params"]["threshold"]="0.990000000000000000"' +# Skipping early supports account allocation +# laconicd genesis add-genesis-account $EARLY_SUPPORTS_ACC_ADDRESS $EARLY_SUPPORTS_ALLOC$LPS_DENOM --keyring-backend $KEYRING --append + # Perform lps allocations -laconicd genesis add-genesis-account $EARLY_SUPPORTS_ACC_ADDRESS $EARLY_SUPPORTS_ALLOC$LPS_DENOM --keyring-backend $KEYRING --append laconicd genesis add-genesis-lockup-account lps_lockup $distribution_file $LOCKUP_ALLOC$LPS_DENOM # Ensure that resulting genesis file is valid