Skip to content

Commit

Permalink
Merge pull request #50 from hyphacoop/v17-fresh-state
Browse files Browse the repository at this point in the history
Add pss launches
  • Loading branch information
dasanchez authored May 8, 2024
2 parents f007ee4 + b4fc53c commit 8f25e5d
Show file tree
Hide file tree
Showing 7 changed files with 531 additions and 20 deletions.
475 changes: 472 additions & 3 deletions .github/workflows/upgrade-gaia-v17-fresh-state.yml

Large diffs are not rendered by default.

27 changes: 17 additions & 10 deletions scripts/init_consumer_assign_keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,17 @@ echo "Submit key assignment tx..."
CON1_PUBKEY=$($CHAIN_BINARY tendermint show-validator --home $CONSUMER_HOME_1)
CON2_PUBKEY=$($CHAIN_BINARY tendermint show-validator --home $CONSUMER_HOME_2)
CON3_PUBKEY=$($CHAIN_BINARY tendermint show-validator --home $CONSUMER_HOME_3)
$CHAIN_BINARY tx provider assign-consensus-key $CONSUMER_CHAIN_ID $CON1_PUBKEY --from $WALLET_1 --gas auto --gas-adjustment $GAS_ADJUSTMENT --gas-prices $GAS_PRICE$DENOM --home $HOME_1 -y
sleep $COMMIT_TIMEOUT
if [ $TOPN -eq "0" ]; then
echo "Opting in with val1..."
txhash=$($CHAIN_BINARY tx provider opt-in $CONSUMER_CHAIN_ID $CON1_PUBKEY --from $WALLET_1 --gas auto --gas-adjustment $GAS_ADJUSTMENT --gas-prices $GAS_PRICE$DENOM --home $HOME_1 -y -o json | jq -r '.txhash')
echo "opt-in tx: $txhash"
sleep $(($COMMIT_TIMEOUT+2))
$CHAIN_BINARY q tx $txhash --home $HOME_1 -o json | jq '.'
else
$CHAIN_BINARY tx provider assign-consensus-key $CONSUMER_CHAIN_ID $CON1_PUBKEY --from $WALLET_1 --gas auto --gas-adjustment $GAS_ADJUSTMENT --gas-prices $GAS_PRICE$DENOM --home $HOME_1 -y
sleep $COMMIT_TIMEOUT
fi

$CHAIN_BINARY tx provider assign-consensus-key $CONSUMER_CHAIN_ID $CON2_PUBKEY --from $WALLET_2 --gas auto --gas-adjustment $GAS_ADJUSTMENT --gas-prices $GAS_PRICE$DENOM --home $HOME_1 -y
sleep $COMMIT_TIMEOUT
$CHAIN_BINARY tx provider assign-consensus-key $CONSUMER_CHAIN_ID $CON3_PUBKEY --from $WALLET_3 --gas auto --gas-adjustment $GAS_ADJUSTMENT --gas-prices $GAS_PRICE$DENOM --home $HOME_1 -y
Expand All @@ -39,11 +48,6 @@ $CHAIN_BINARY q provider validator-consumer-key $CONSUMER_CHAIN_ID $($CHAIN_BINA
echo "val3 key in consumer:"
$CHAIN_BINARY q provider validator-consumer-key $CONSUMER_CHAIN_ID $($CHAIN_BINARY tendermint show-address --home $HOME_3) --home $HOME_1

if [ $TOPN -eq "0" ]; then
echo "Opting in with val1..."
$CHAIN_BINARY tx provider opt-in $CONSUMER_CHAIN_ID --from $WALLET_1 --gas auto --gas-adjustment $GAS_ADJUSTMENT --gas-prices $GAS_PRICE$DENOM --home $HOME_1 -y
sleep $COMMIT_TIMEOUT
fi

# Update genesis file with right denom
# sed -i s%stake%$CONSUMER_DENOM%g $CONSUMER_HOME_1/config/genesis.json
Expand Down Expand Up @@ -96,9 +100,12 @@ fi
echo "Patching config files..."
# app.toml
# minimum_gas_prices
sed -i -e "/minimum-gas-prices =/ s^= .*^= \"0.0025$CONSUMER_DENOM\"^" $CONSUMER_HOME_1/config/app.toml
sed -i -e "/minimum-gas-prices =/ s^= .*^= \"0.0025$CONSUMER_DENOM\"^" $CONSUMER_HOME_2/config/app.toml
sed -i -e "/minimum-gas-prices =/ s^= .*^= \"0.0025$CONSUMER_DENOM\"^" $CONSUMER_HOME_3/config/app.toml
# sed -i -e "/minimum-gas-prices =/ s^= .*^= \"0.0025$CONSUMER_DENOM\"^" $CONSUMER_HOME_1/config/app.toml
# sed -i -e "/minimum-gas-prices =/ s^= .*^= \"0.0025$CONSUMER_DENOM\"^" $CONSUMER_HOME_2/config/app.toml
# sed -i -e "/minimum-gas-prices =/ s^= .*^= \"0.0025$CONSUMER_DENOM\"^" $CONSUMER_HOME_3/config/app.toml
toml set --toml-path $CONSUMER_HOME_1/config/app.toml minimum-gas-prices "$CONSUMER_GAS_PRICE$CONSUMER_DENOM"
toml set --toml-path $CONSUMER_HOME_2/config/app.toml minimum-gas-prices "$CONSUMER_GAS_PRICE$CONSUMER_DENOM"
toml set --toml-path $CONSUMER_HOME_3/config/app.toml minimum-gas-prices "$CONSUMER_GAS_PRICE$CONSUMER_DENOM"

# Enable API
toml set --toml-path $CONSUMER_HOME_1/config/app.toml api.enable true
Expand Down
1 change: 1 addition & 0 deletions scripts/prepare_consumer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ echo "Collecting the CCV state..."
$CHAIN_BINARY q provider consumer-genesis $CONSUMER_CHAIN_ID -o json --home $HOME_1 > ccv-pre.json
jq '.params |= . + {"soft_opt_out_threshold": "0.10"}' ccv-pre.json > ccv-optout.json

jq '.' ccv-optout.json

echo "Patching the CCV state with the provider reward denom"
jq --arg DENOM "$CONSUMER_DENOM" '.params.reward_denoms = [$DENOM]' ccv-optout.json > ccv-reward.json
Expand Down
28 changes: 28 additions & 0 deletions scripts/register_denoms.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

denom_hash=$1

echo "Patching template with consumer denom..."
jq -r --arg DENOMTOADD "ibc/$denom_hash" '.denoms_to_add |= [$DENOMTOADD]' templates/proposal-change-reward-denoms.json > proposal-denom-hash.json

echo "Submitting proposal..."

echo "Preparing proposal with v47 command..."
proposal="$CHAIN_BINARY tx gov submit-legacy-proposal change-reward-denoms proposal-denom-hash.json --gas $GAS --gas-adjustment $GAS_ADJUSTMENT --gas-prices $GAS_PRICE$DENOM --from $WALLET_2 --keyring-backend test --home $HOME_1 --chain-id $CHAIN_ID -y -o json"
txhash=$($proposal | jq -r .txhash)
# Wait for the proposal to go on chain
sleep $(($COMMIT_TIMEOUT+2))

# Get proposal ID from txhash
echo "Getting proposal ID from txhash..."
$CHAIN_BINARY q tx $txhash --home $HOME_1
proposal_id=$($CHAIN_BINARY q tx $txhash --home $HOME_1 --output json | jq -r '.logs[].events[] | select(.type=="submit_proposal") | .attributes[] | select(.key=="proposal_id") | .value')

echo "Voting on proposal $proposal_id..."
$CHAIN_BINARY tx gov vote $proposal_id yes --gas $GAS --gas-adjustment $GAS_ADJUSTMENT --fees $BASE_FEES$DENOM --from $WALLET_1 --keyring-backend test --home $HOME_1 --chain-id $CHAIN_ID -y
sleep $(($COMMIT_TIMEOUT+2))
$CHAIN_BINARY q gov tally $proposal_id --home $HOME_1

echo "Waiting for proposal to pass..."
sleep $VOTING_PERIOD
$CHAIN_BINARY q gov proposal $proposal_id --home $HOME_1 -o json | jq '.'
10 changes: 5 additions & 5 deletions templates/hermes-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ rpc_timeout = '15s'
account_prefix = 'cosmos'
key_name = 'wallet'
store_prefix = 'ibc'
gas_price = { price = 0.0025, denom = 'ucon' }
gas_price = { price = 0.005, denom = 'ucon' }
gas_multiplier = 1.2
max_gas = 10000000
clock_drift = '10s'
Expand All @@ -124,7 +124,7 @@ rpc_timeout = '15s'
account_prefix = 'cosmos'
key_name = 'wallet'
store_prefix = 'ibc'
gas_price = { price = 0.0025, denom = 'ucon' }
gas_price = { price = 0.005, denom = 'ucon' }
gas_multiplier = 1.2
max_gas = 10000000
clock_drift = '10s'
Expand All @@ -142,7 +142,7 @@ rpc_timeout = '15s'
account_prefix = 'consumer'
key_name = 'wallet'
store_prefix = 'ibc'
gas_price = { price = 0.0025, denom = 'ucon' }
gas_price = { price = 0.005, denom = 'ucon' }
gas_multiplier = 1.2
max_gas = 10000000
clock_drift = '10s'
Expand All @@ -160,7 +160,7 @@ rpc_timeout = '15s'
account_prefix = 'consumer'
key_name = 'wallet'
store_prefix = 'ibc'
gas_price = { price = 0.0025, denom = 'ucon' }
gas_price = { price = 0.005, denom = 'ucon' }
gas_multiplier = 1.2
max_gas = 10000000
clock_drift = '10s'
Expand Down Expand Up @@ -196,7 +196,7 @@ rpc_timeout = '15s'
account_prefix = 'stride'
key_name = 'wallet'
store_prefix = 'ibc'
gas_price = { price = 0.0025, denom = 'ustrd' }
gas_price = { price = 0.005, denom = 'ustrd' }
gas_multiplier = 1.2
max_gas = 10000000
clock_drift = '10s'
Expand Down
4 changes: 2 additions & 2 deletions templates/proposal-add-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"genesis_hash": "79054737030e8e4f15eeda0fe279427ad8932671377a3fc86e7af2da7ae2763b",
"binary_hash": "ec1848bd0018732f1ae771c2b0f857c5def9a5fb7736001d640e1da337b41d9e",
"spawn_time": "",
"blocks_per_distribution_transmission": 10,
"consumer_redistribution_fraction": "0.75",
"blocks_per_distribution_transmission": 5,
"consumer_redistribution_fraction": "0.50",
"historical_entries": 10000,
"transfer_timeout_period": 1800000000000,
"ccv_timeout_period": 2419200000000000,
Expand Down
6 changes: 6 additions & 0 deletions templates/proposal-change-reward-denoms.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "Change reward denoms",
"summary": "Change reward denoms",
"denoms_to_add": ["ibc/42C7464F6415DC7529A8C7581FE0991C7A090D60176BC90998B1DAF75B868635"],
"deposit": "10000000uatom"
}

0 comments on commit 8f25e5d

Please sign in to comment.