From fb490cd883648120305a2be3e5cbfa140e2cb458 Mon Sep 17 00:00:00 2001 From: Teddy Ding Date: Wed, 24 Apr 2024 11:22:40 -0400 Subject: [PATCH 1/9] setup upgrade from v4.1.0 on chain on v5.x --- .../protocol-build-and-push-snapshot.yml | 1 + .github/workflows/protocol-build-and-push.yml | 1 + protocol/testing/genesis.sh | 67 ++++--------------- protocol/testing/snapshotting/snapshot.sh | 16 ++++- protocol/testing/testnet-dev/dev.sh | 28 ++++++-- protocol/testing/testnet-local/local.sh | 22 ++++-- protocol/testing/testnet-staging/staging.sh | 28 ++++++-- 7 files changed, 93 insertions(+), 70 deletions(-) diff --git a/.github/workflows/protocol-build-and-push-snapshot.yml b/.github/workflows/protocol-build-and-push-snapshot.yml index ae94a69a836..96c3b0bb2bb 100644 --- a/.github/workflows/protocol-build-and-push-snapshot.yml +++ b/.github/workflows/protocol-build-and-push-snapshot.yml @@ -3,6 +3,7 @@ name: Protocol Build & Push Image to AWS ECR on: # yamllint disable-line rule:truthy push: branches: + - td/upgrade-test-at-v5-branch - main - 'release/protocol/v[0-9]+.[0-9]+.x' # e.g. release/protocol/v0.1.x - 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x diff --git a/.github/workflows/protocol-build-and-push.yml b/.github/workflows/protocol-build-and-push.yml index 3e9adfcf809..bbc810888e6 100644 --- a/.github/workflows/protocol-build-and-push.yml +++ b/.github/workflows/protocol-build-and-push.yml @@ -3,6 +3,7 @@ name: Protocol Build & Push Image to AWS ECR on: # yamllint disable-line rule:truthy push: branches: + - td/upgrade-test-at-v5-branch - main - 'release/protocol/v[0-9]+.[0-9]+.x' # e.g. release/protocol/v0.1.x - 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x diff --git a/protocol/testing/genesis.sh b/protocol/testing/genesis.sh index 461500fe7a3..2fa4c506a47 100755 --- a/protocol/testing/genesis.sh +++ b/protocol/testing/genesis.sh @@ -82,9 +82,8 @@ function edit_genesis() { dasel put -t string -f "$GENESIS" '.genesis_time' -v "$GENESIS_TIME" # Consensus params - dasel put -t string -f "$GENESIS" '.consensus.params.block.max_bytes' -v '4194304' - dasel put -t string -f "$GENESIS" '.consensus.params.block.max_gas' -v '-1' - dasel put -t string -f "$GENESIS" '.consensus.params.abci.vote_extensions_enable_height' -v '1' + dasel put -t string -f "$GENESIS" '.consensus_params.block.max_bytes' -v '4194304' + dasel put -t string -f "$GENESIS" '.consensus_params.block.max_gas' -v '-1' # Update crisis module. dasel put -t string -f "$GENESIS" '.app_state.crisis.constant_fee.denom' -v "$NATIVE_TOKEN" @@ -104,6 +103,9 @@ function edit_genesis() { # require 75% of votes for an expedited proposal to pass dasel put -t string -f "$GENESIS" '.app_state.gov.params.expedited_threshold' -v '0.75000' # 75% + dasel put -t string -f "$GENESIS" '.app_state.gov.params.voting_period' -v "120s" + dasel put -t string -f "$GENESIS" '.app_state.gov.params.quorum' -v "0.000000000000000100" + # Update staking module. dasel put -t string -f "$GENESIS" '.app_state.staking.params.unbonding_time' -v '1814400s' # 21 days dasel put -t string -f "$GENESIS" '.app_state.staking.params.bond_denom' -v "$NATIVE_TOKEN" @@ -131,7 +133,6 @@ function edit_genesis() { # Update perpetuals module. # Liquidity Tiers. - # TODO(OTE-208): Finalize default values for open interest caps. dasel put -t json -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers' -v "[]" # Liquidity Tier: Large-Cap dasel put -t json -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[]' -v "{}" @@ -140,8 +141,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[0].initial_margin_ppm' -v '20000' # 2% dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[0].maintenance_fraction_ppm' -v '600000' # 60% of IM dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[0].impact_notional' -v '10000000000' # 10_000 USDC (500 USDC / 5%) - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[0].open_interest_lower_cap' -v '0' # OIMF doesn't apply to Large-Cap - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[0].open_interest_upper_cap' -v '0' # OIMF doesn't apply to Large-Cap # Liquidity Tier: Small-Cap dasel put -t json -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[]' -v "{}" @@ -150,8 +149,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[1].initial_margin_ppm' -v '100000' # 10% dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[1].maintenance_fraction_ppm' -v '500000' # 50% of IM dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[1].impact_notional' -v '5000000000' # 5_000 USDC (500 USDC / 10%) - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[1].open_interest_lower_cap' -v '20000000000000' # 20 million USDC - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[1].open_interest_upper_cap' -v '50000000000000' # 50 million USDC # Liquidity Tier: Long-Tail dasel put -t json -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[]' -v "{}" @@ -160,8 +157,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[2].initial_margin_ppm' -v '200000' # 20% dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[2].maintenance_fraction_ppm' -v '500000' # 50% of IM dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[2].impact_notional' -v '2500000000' # 2_500 USDC (500 USDC / 20%) - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[2].open_interest_lower_cap' -v '5000000000000' # 5 million USDC - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[2].open_interest_upper_cap' -v '10000000000000' # 10 million USDC # Liquidity Tier: Safety dasel put -t json -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[]' -v "{}" @@ -170,9 +165,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[3].initial_margin_ppm' -v '1000000' # 100% dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[3].maintenance_fraction_ppm' -v '200000' # 20% of IM dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[3].impact_notional' -v '2500000000' # 2_500 USDC (2_500 USDC / 100%) - # For `Safety` IMF is already at 100%; still we set OIMF for completeness. - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[3].open_interest_lower_cap' -v '2000000000000' # 2 million USDC - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[3].open_interest_upper_cap' -v '5000000000000' # 5 million USDC # Liquidity Tier: Isolated dasel put -t json -f "$GENESIS" '.app_state.perpetuals.liquidity_tiers.[]' -v "{}" @@ -220,7 +212,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[0].params.atomic_resolution' -v '-10' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[0].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[0].params.liquidity_tier' -v '0' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[0].params.market_type' -v '1' # Perpetual: ETH-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -230,7 +221,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[1].params.atomic_resolution' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[1].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[1].params.liquidity_tier' -v '0' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[1].params.market_type' -v '1' # Perpetual: LINK-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -240,7 +230,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[2].params.atomic_resolution' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[2].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[2].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[2].params.market_type' -v '1' # Perpetual: POL-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -250,7 +239,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[3].params.atomic_resolution' -v '-5' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[3].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[3].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[3].params.market_type' -v '1' # Perpetual: CRV-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -260,7 +248,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[4].params.atomic_resolution' -v '-5' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[4].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[4].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[4].params.market_type' -v '1' # Perpetual: SOL-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -270,7 +257,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[5].params.atomic_resolution' -v '-7' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[5].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[5].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[5].params.market_type' -v '1' # Perpetual: ADA-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -280,7 +266,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[6].params.atomic_resolution' -v '-5' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[6].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[6].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[6].params.market_type' -v '1' # Perpetual: AVAX-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -290,7 +275,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[7].params.atomic_resolution' -v '-7' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[7].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[7].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[7].params.market_type' -v '1' # Perpetual: FIL-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -300,7 +284,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[8].params.atomic_resolution' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[8].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[8].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[8].params.market_type' -v '1' # Perpetual: LTC-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -310,7 +293,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[9].params.atomic_resolution' -v '-7' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[9].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[9].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[9].params.market_type' -v '1' # Perpetual: DOGE-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -320,7 +302,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[10].params.atomic_resolution' -v '-4' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[10].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[10].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[10].params.market_type' -v '1' # Perpetual: ATOM-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -330,7 +311,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[11].params.atomic_resolution' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[11].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[11].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[11].params.market_type' -v '1' # Perpetual: DOT-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -340,7 +320,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[12].params.atomic_resolution' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[12].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[12].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[12].params.market_type' -v '1' # Perpetual: UNI-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -350,7 +329,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[13].params.atomic_resolution' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[13].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[13].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[13].params.market_type' -v '1' # Perpetual: BCH-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -360,7 +338,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[14].params.atomic_resolution' -v '-8' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[14].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[14].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[14].params.market_type' -v '1' # Perpetual: TRX-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -370,7 +347,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[15].params.atomic_resolution' -v '-4' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[15].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[15].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[15].params.market_type' -v '1' # Perpetual: NEAR-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -380,7 +356,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[16].params.atomic_resolution' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[16].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[16].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[16].params.market_type' -v '1' # Perpetual: MKR-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -390,7 +365,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[17].params.atomic_resolution' -v '-9' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[17].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[17].params.liquidity_tier' -v '2' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[17].params.market_type' -v '1' # Perpetual: XLM-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -400,7 +374,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[18].params.atomic_resolution' -v '-5' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[18].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[18].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[18].params.market_type' -v '1' # Perpetual: ETC-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -410,7 +383,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[19].params.atomic_resolution' -v '-7' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[19].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[19].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[19].params.market_type' -v '1' # Perpetual: COMP-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -420,7 +392,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[20].params.atomic_resolution' -v '-7' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[20].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[20].params.liquidity_tier' -v '2' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[20].params.market_type' -v '1' # Perpetual: WLD-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -430,7 +401,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[21].params.atomic_resolution' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[21].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[21].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[21].params.market_type' -v '1' # Perpetual: APE-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -440,7 +410,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[22].params.atomic_resolution' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[22].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[22].params.liquidity_tier' -v '2' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[22].params.market_type' -v '1' # Perpetual: APT-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -450,7 +419,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[23].params.atomic_resolution' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[23].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[23].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[23].params.market_type' -v '1' # Perpetual: ARB-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -460,7 +428,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[24].params.atomic_resolution' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[24].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[24].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[24].params.market_type' -v '1' # Perpetual: BLUR-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -470,7 +437,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[25].params.atomic_resolution' -v '-5' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[25].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[25].params.liquidity_tier' -v '2' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[25].params.market_type' -v '1' # Perpetual: LDO-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -480,7 +446,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[26].params.atomic_resolution' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[26].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[26].params.liquidity_tier' -v '2' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[26].params.market_type' -v '1' # Perpetual: OP-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -490,7 +455,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[27].params.atomic_resolution' -v '-6' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[27].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[27].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[27].params.market_type' -v '1' # Perpetual: PEPE-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -500,7 +464,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[28].params.atomic_resolution' -v '1' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[28].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[28].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[28].params.market_type' -v '1' # Perpetual: SEI-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -510,7 +473,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[29].params.atomic_resolution' -v '-5' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[29].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[29].params.liquidity_tier' -v '2' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[29].params.market_type' -v '1' # Perpetual: SHIB-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -520,7 +482,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[30].params.atomic_resolution' -v '0' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[30].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[30].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[30].params.market_type' -v '1' # Perpetual: SUI-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -530,7 +491,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[31].params.atomic_resolution' -v '-5' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[31].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[31].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[31].params.market_type' -v '1' # Perpetual: XRP-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -540,7 +500,6 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[32].params.atomic_resolution' -v '-5' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[32].params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[32].params.liquidity_tier' -v '1' - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.[32].params.market_type' -v '1' # Perpetual (Isolated): EIGEN-USD dasel put -t json -f "$GENESIS" '.app_state.perpetuals.perpetuals.[]' -v "{}" @@ -2133,10 +2092,14 @@ function edit_genesis() { dasel put -t int -f "$GENESIS" '.app_state.clob.liquidations_config.fillable_price_config.spread_to_maintenance_margin_ratio_ppm' -v '1500000' # 150% # Block Rate Limit - # Max 400 short term orders/cancels per block - dasel put -t json -f "$GENESIS" '.app_state.clob.block_rate_limit_config.max_short_term_orders_and_cancels_per_n_blocks.[]' -v "{}" - dasel put -t int -f "$GENESIS" '.app_state.clob.block_rate_limit_config.max_short_term_orders_and_cancels_per_n_blocks.[0].limit' -v '400' - dasel put -t int -f "$GENESIS" '.app_state.clob.block_rate_limit_config.max_short_term_orders_and_cancels_per_n_blocks.[0].num_blocks' -v '1' + # Max 50 short term orders per block + dasel put -t json -f "$GENESIS" '.app_state.clob.block_rate_limit_config.max_short_term_orders_per_n_blocks.[]' -v "{}" + dasel put -t int -f "$GENESIS" '.app_state.clob.block_rate_limit_config.max_short_term_orders_per_n_blocks.[0].limit' -v '200' + dasel put -t int -f "$GENESIS" '.app_state.clob.block_rate_limit_config.max_short_term_orders_per_n_blocks.[0].num_blocks' -v '1' + # Max 50 short term order cancellations per block + dasel put -t json -f "$GENESIS" '.app_state.clob.block_rate_limit_config.max_short_term_order_cancellations_per_n_blocks.[]' -v "{}" + dasel put -t int -f "$GENESIS" '.app_state.clob.block_rate_limit_config.max_short_term_order_cancellations_per_n_blocks.[0].limit' -v '200' + dasel put -t int -f "$GENESIS" '.app_state.clob.block_rate_limit_config.max_short_term_order_cancellations_per_n_blocks.[0].num_blocks' -v '1' # Max 2 stateful orders per block dasel put -t json -f "$GENESIS" '.app_state.clob.block_rate_limit_config.max_stateful_orders_per_n_blocks.[]' -v "{}" dasel put -t int -f "$GENESIS" '.app_state.clob.block_rate_limit_config.max_stateful_orders_per_n_blocks.[0].limit' -v '2' @@ -2373,8 +2336,6 @@ function update_genesis_use_test_volatile_market() { dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.last().params.atomic_resolution' -v '-10' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.last().params.default_funding_ppm' -v '100' dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.last().params.liquidity_tier' -v "${NUM_LIQUIDITY_TIERS}" - dasel put -t int -f "$GENESIS" '.app_state.perpetuals.perpetuals.last().params.market_type' -v '1' - # Clob: TEST-USD NUM_CLOB_PAIRS=$(jq -c '.app_state.clob.clob_pairs | length' < ${GENESIS}) @@ -2465,4 +2426,4 @@ set_denom_metadata() { dasel put -t string -f "$GENESIS" ".app_state.bank.denom_metadata.[0].name" -v "$COIN_NAME" dasel put -t string -f "$GENESIS" ".app_state.bank.denom_metadata.[0].display" -v "$WHOLE_COIN_DENOM" dasel put -t string -f "$GENESIS" ".app_state.bank.denom_metadata.[0].symbol" -v "$WHOLE_COIN_DENOM" -} +} \ No newline at end of file diff --git a/protocol/testing/snapshotting/snapshot.sh b/protocol/testing/snapshotting/snapshot.sh index 215891deccf..8e52abbb270 100755 --- a/protocol/testing/snapshotting/snapshot.sh +++ b/protocol/testing/snapshotting/snapshot.sh @@ -51,6 +51,8 @@ now_date() { echo -n $(TZ="UTC" date '+%Y-%m-%d_%H:%M:%S') } +PREUPGRADE_BINARY_PATH="/bin/dydxprotocold_preupgrade" + install_prerequisites() { apk add dasel jq curl apk add --no-cache \ @@ -62,12 +64,23 @@ install_prerequisites() { && rm -rf /var/cache/apk/* } +setup_preupgrade_binary() { + tar_url='https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv4.1.0/dydxprotocold-v4.1.0-linux-amd64.tar.gz' + tar_path='/tmp/dydxprotocold/dydxprotocold.tar.gz' + mkdir -p /tmp/dydxprotocold + curl -vL $tar_url -o $tar_path + dydxprotocold_path=$(tar -xvf $tar_path --directory /tmp/dydxprotocold) + mv /tmp/dydxprotocold/$dydxprotocold_path $PREUPGRADE_BINARY_PATH +} + setup_cosmovisor() { VAL_HOME_DIR="$HOME/chain/local_node" export DAEMON_NAME=dydxprotocold export DAEMON_HOME="$HOME/chain/local_node" - cosmovisor init /bin/dydxprotocold + cosmovisor init $PREUPGRADE_BINARY_PATH + mkdir -p "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/" + ln -s /bin/dydxprotocold "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/dydxprotocold" } install_prerequisites @@ -96,6 +109,7 @@ sed -i 's/min-retain-blocks = 0/min-retain-blocks = 2/' /dydxprotocol/chain/loca # Do not index tx_index.db sed -i 's/indexer = "kv"/indexer = "null"/' /dydxprotocol/chain/local_node/config/config.toml +setup_preupgrade_binary setup_cosmovisor # TODO: add metrics around snapshot upload latency/frequency/success rate diff --git a/protocol/testing/testnet-dev/dev.sh b/protocol/testing/testnet-dev/dev.sh index 91e20a45ff6..4f5a8b6c3fa 100755 --- a/protocol/testing/testnet-dev/dev.sh +++ b/protocol/testing/testnet-dev/dev.sh @@ -97,10 +97,12 @@ VAULT_NUMBERS=( 4 # CRV clob pair ID ) +PREUPGRADE_BINARY_PATH="/bin/dydxprotocold_preupgrade" + # Define dependencies for this script. # `jq` and `dasel` are used to manipulate json and yaml files respectively. install_prerequisites() { - apk add dasel jq + apk add curl dasel jq } # Create all validators for the chain including a full-node. @@ -110,7 +112,7 @@ create_validators() { for i in "${!FULL_NODE_KEYS[@]}"; do FULL_NODE_HOME_DIR="$HOME/chain/.full-node-$i" FULL_NODE_CONFIG_DIR="$FULL_NODE_HOME_DIR/config" - dydxprotocold init "full-node" -o --chain-id=$CHAIN_ID --home "$FULL_NODE_HOME_DIR" + $PREUPGRADE_BINARY_PATH init "full-node" -o --chain-id=$CHAIN_ID --home "$FULL_NODE_HOME_DIR" # Note: `dydxprotocold init` non-deterministically creates `node_id.json` for each validator. # This is inconvenient for persistent peering during testing in Terraform configuration as the `node_id` @@ -132,7 +134,7 @@ create_validators() { VAL_CONFIG_DIR="$VAL_HOME_DIR/config" # Initialize the chain and validator files. - dydxprotocold init "${MONIKERS[$i]}" -o --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR" + $PREUPGRADE_BINARY_PATH init "${MONIKERS[$i]}" -o --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR" # Overwrite the randomly generated `priv_validator_key.json` with a key generated deterministically from the mnemonic. dydxprotocold tendermint gen-priv-key --home "$VAL_HOME_DIR" --mnemonic "${MNEMONICS[$i]}" @@ -163,7 +165,7 @@ create_validators() { dydxprotocold add-genesis-account "$acct" 900000000000000000$USDC_DENOM,$TESTNET_VALIDATOR_NATIVE_TOKEN_BALANCE$NATIVE_TOKEN --home "$VAL_HOME_DIR" done - dydxprotocold gentx "${MONIKERS[$i]}" $TESTNET_VALIDATOR_SELF_DELEGATE_AMOUNT$NATIVE_TOKEN --moniker="${MONIKERS[$i]}" --keyring-backend=test --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR" + $PREUPGRADE_BINARY_PATH gentx "${MONIKERS[$i]}" $TESTNET_VALIDATOR_SELF_DELEGATE_AMOUNT$NATIVE_TOKEN --moniker="${MONIKERS[$i]}" --keyring-backend=test --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR" # Copy the gentx to a shared directory. cp -a "$VAL_CONFIG_DIR/gentx/." /tmp/gentx @@ -202,13 +204,24 @@ create_validators() { done } +setup_preupgrade_binary() { + tar_url='https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv4.1.0/dydxprotocold-v4.1.0-linux-amd64.tar.gz' + tar_path='/tmp/dydxprotocold/dydxprotocold.tar.gz' + mkdir -p /tmp/dydxprotocold + curl -vL $tar_url -o $tar_path + dydxprotocold_path=$(tar -xvf $tar_path --directory /tmp/dydxprotocold) + mv /tmp/dydxprotocold/$dydxprotocold_path $PREUPGRADE_BINARY_PATH +} + setup_cosmovisor() { for i in "${!FULL_NODE_KEYS[@]}"; do FULL_NODE_HOME_DIR="$HOME/chain/.full-node-$i" export DAEMON_NAME=dydxprotocold export DAEMON_HOME="$HOME/chain/.full-node-$i" - cosmovisor init /bin/dydxprotocold + cosmovisor init $PREUPGRADE_BINARY_PATH + mkdir -p "$FULL_NODE_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/" + ln -s /bin/dydxprotocold "$FULL_NODE_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/dydxprotocold" done for i in "${!MONIKERS[@]}"; do @@ -216,7 +229,9 @@ setup_cosmovisor() { export DAEMON_NAME=dydxprotocold export DAEMON_HOME="$HOME/chain/.${MONIKERS[$i]}" - cosmovisor init /bin/dydxprotocold + cosmovisor init $PREUPGRADE_BINARY_PATH + mkdir -p "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/" + ln -s /bin/dydxprotocold "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/dydxprotocold" done } @@ -235,5 +250,6 @@ edit_config() { } install_prerequisites +setup_preupgrade_binary create_validators setup_cosmovisor diff --git a/protocol/testing/testnet-local/local.sh b/protocol/testing/testnet-local/local.sh index a90bc06c0d9..b1c14a1f00d 100755 --- a/protocol/testing/testnet-local/local.sh +++ b/protocol/testing/testnet-local/local.sh @@ -75,10 +75,12 @@ VAULT_NUMBERS=( 1 # ETH clob pair ID ) +PREUPGRADE_BINARY_PATH="/bin/dydxprotocold_preupgrade" + # Define dependencies for this script. # `jq` and `dasel` are used to manipulate json and yaml files respectively. install_prerequisites() { - apk add dasel jq + apk add curl dasel jq } # Create all validators for the chain including a full-node. @@ -93,7 +95,7 @@ create_validators() { VAL_CONFIG_DIR="$VAL_HOME_DIR/config" # Initialize the chain and validator files. - dydxprotocold init "${MONIKERS[$i]}" -o --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR" + $PREUPGRADE_BINARY_PATH init "${MONIKERS[$i]}" -o --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR" # Overwrite the randomly generated `priv_validator_key.json` with a key generated deterministically from the mnemonic. dydxprotocold tendermint gen-priv-key --home "$VAL_HOME_DIR" --mnemonic "${MNEMONICS[$i]}" @@ -126,7 +128,7 @@ create_validators() { dydxprotocold add-genesis-account "$acct" 900000000000000000$USDC_DENOM,$TESTNET_VALIDATOR_NATIVE_TOKEN_BALANCE$NATIVE_TOKEN --home "$VAL_HOME_DIR" done - dydxprotocold gentx "${MONIKERS[$i]}" $TESTNET_VALIDATOR_SELF_DELEGATE_AMOUNT$NATIVE_TOKEN --moniker="${MONIKERS[$i]}" --keyring-backend=test --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR" + $PREUPGRADE_BINARY_PATH gentx "${MONIKERS[$i]}" $TESTNET_VALIDATOR_SELF_DELEGATE_AMOUNT$NATIVE_TOKEN --moniker="${MONIKERS[$i]}" --keyring-backend=test --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR" # Copy the gentx to a shared directory. cp -a "$VAL_CONFIG_DIR/gentx/." /tmp/gentx @@ -157,13 +159,24 @@ create_validators() { done } +setup_preupgrade_binary() { + tar_url='https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv4.1.0/dydxprotocold-v4.1.0-linux-amd64.tar.gz' + tar_path='/tmp/dydxprotocold/dydxprotocold.tar.gz' + mkdir -p /tmp/dydxprotocold + curl -vL $tar_url -o $tar_path + dydxprotocold_path=$(tar -xvf $tar_path --directory /tmp/dydxprotocold) + mv /tmp/dydxprotocold/$dydxprotocold_path $PREUPGRADE_BINARY_PATH +} + setup_cosmovisor() { for i in "${!MONIKERS[@]}"; do VAL_HOME_DIR="$HOME/chain/.${MONIKERS[$i]}" export DAEMON_NAME=dydxprotocold export DAEMON_HOME="$HOME/chain/.${MONIKERS[$i]}" - cosmovisor init /bin/dydxprotocold + cosmovisor init $PREUPGRADE_BINARY_PATH + mkdir -p "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/" + ln -s /bin/dydxprotocold "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/dydxprotocold" done } @@ -193,5 +206,6 @@ edit_config() { } install_prerequisites +setup_preupgrade_binary create_validators setup_cosmovisor diff --git a/protocol/testing/testnet-staging/staging.sh b/protocol/testing/testnet-staging/staging.sh index 57fcbcf4c85..d84966c3854 100755 --- a/protocol/testing/testnet-staging/staging.sh +++ b/protocol/testing/testnet-staging/staging.sh @@ -151,10 +151,12 @@ VAULT_NUMBERS=( 4 # CRV clob pair ID ) +PREUPGRADE_BINARY_PATH="/bin/dydxprotocold_preupgrade" + # Define dependencies for this script. # `jq` and `dasel` are used to manipulate json and yaml files respectively. install_prerequisites() { - apk add dasel jq + apk add curl dasel jq } # Create all validators for the chain including a full-node. @@ -164,7 +166,7 @@ create_validators() { for i in "${!FULL_NODE_KEYS[@]}"; do FULL_NODE_HOME_DIR="$HOME/chain/.full-node-$i" FULL_NODE_CONFIG_DIR="$FULL_NODE_HOME_DIR/config" - dydxprotocold init "full-node" -o --chain-id=$CHAIN_ID --home "$FULL_NODE_HOME_DIR" + $PREUPGRADE_BINARY_PATH init "full-node" -o --chain-id=$CHAIN_ID --home "$FULL_NODE_HOME_DIR" # Note: `dydxprotocold init` non-deterministically creates `node_id.json` for each validator. # This is inconvenient for persistent peering during testing in Terraform configuration as the `node_id` @@ -186,7 +188,7 @@ create_validators() { VAL_CONFIG_DIR="$VAL_HOME_DIR/config" # Initialize the chain and validator files. - dydxprotocold init "${MONIKERS[$i]}" -o --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR" + $PREUPGRADE_BINARY_PATH init "${MONIKERS[$i]}" -o --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR" # Overwrite the randomly generated `priv_validator_key.json` with a key generated deterministically from the mnemonic. dydxprotocold tendermint gen-priv-key --home "$VAL_HOME_DIR" --mnemonic "${MNEMONICS[$i]}" @@ -217,7 +219,7 @@ create_validators() { dydxprotocold add-genesis-account "$acct" 900000000000000000$USDC_DENOM,$TESTNET_VALIDATOR_NATIVE_TOKEN_BALANCE$NATIVE_TOKEN --home "$VAL_HOME_DIR" done - dydxprotocold gentx "${MONIKERS[$i]}" $TESTNET_VALIDATOR_SELF_DELEGATE_AMOUNT$NATIVE_TOKEN --moniker="${MONIKERS[$i]}" --keyring-backend=test --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR" + $PREUPGRADE_BINARY_PATH gentx "${MONIKERS[$i]}" $TESTNET_VALIDATOR_SELF_DELEGATE_AMOUNT$NATIVE_TOKEN --moniker="${MONIKERS[$i]}" --keyring-backend=test --chain-id=$CHAIN_ID --home "$VAL_HOME_DIR" # Copy the gentx to a shared directory. cp -a "$VAL_CONFIG_DIR/gentx/." /tmp/gentx @@ -256,13 +258,24 @@ create_validators() { done } +setup_preupgrade_binary() { + tar_url='https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv4.1.0/dydxprotocold-v4.1.0-linux-amd64.tar.gz' + tar_path='/tmp/dydxprotocold/dydxprotocold.tar.gz' + mkdir -p /tmp/dydxprotocold + curl -vL $tar_url -o $tar_path + dydxprotocold_path=$(tar -xvf $tar_path --directory /tmp/dydxprotocold) + mv /tmp/dydxprotocold/$dydxprotocold_path /bin/dydxprotocold_preupgrade +} + setup_cosmovisor() { for i in "${!FULL_NODE_KEYS[@]}"; do FULL_NODE_HOME_DIR="$HOME/chain/.full-node-$i" export DAEMON_NAME=dydxprotocold export DAEMON_HOME="$HOME/chain/.full-node-$i" - cosmovisor init /bin/dydxprotocold + cosmovisor init $PREUPGRADE_BINARY_PATH + mkdir -p "$FULL_NODE_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/" + ln -s /bin/dydxprotocold "$FULL_NODE_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/dydxprotocold" done for i in "${!MONIKERS[@]}"; do @@ -270,7 +283,9 @@ setup_cosmovisor() { export DAEMON_NAME=dydxprotocold export DAEMON_HOME="$HOME/chain/.${MONIKERS[$i]}" - cosmovisor init /bin/dydxprotocold + cosmovisor init $PREUPGRADE_BINARY_PATH + mkdir -p "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/" + ln -s /bin/dydxprotocold "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/dydxprotocold" done } @@ -289,5 +304,6 @@ edit_config() { } install_prerequisites +setup_preupgrade_binary create_validators setup_cosmovisor From dc8e76f689d64c24bd0988b44df15fea8ae7d35f Mon Sep 17 00:00:00 2001 From: Justin Barnett Date: Fri, 24 Oct 2025 15:25:23 -0400 Subject: [PATCH 2/9] Change to current --- .github/workflows/protocol-build-and-push-snapshot.yml | 2 +- .github/workflows/protocol-build-and-push.yml | 2 +- protocol/testing/testnet-dev/dev.sh | 10 +++++----- protocol/testing/testnet-local/local.sh | 6 +++--- protocol/testing/testnet-staging/staging.sh | 10 +++++----- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/protocol-build-and-push-snapshot.yml b/.github/workflows/protocol-build-and-push-snapshot.yml index 96c3b0bb2bb..cddeaa8af33 100644 --- a/.github/workflows/protocol-build-and-push-snapshot.yml +++ b/.github/workflows/protocol-build-and-push-snapshot.yml @@ -3,7 +3,7 @@ name: Protocol Build & Push Image to AWS ECR on: # yamllint disable-line rule:truthy push: branches: - - td/upgrade-test-at-v5-branch + - upgrade_test* - main - 'release/protocol/v[0-9]+.[0-9]+.x' # e.g. release/protocol/v0.1.x - 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x diff --git a/.github/workflows/protocol-build-and-push.yml b/.github/workflows/protocol-build-and-push.yml index bbc810888e6..60e10a478ea 100644 --- a/.github/workflows/protocol-build-and-push.yml +++ b/.github/workflows/protocol-build-and-push.yml @@ -3,7 +3,7 @@ name: Protocol Build & Push Image to AWS ECR on: # yamllint disable-line rule:truthy push: branches: - - td/upgrade-test-at-v5-branch + - upgrade_test* - main - 'release/protocol/v[0-9]+.[0-9]+.x' # e.g. release/protocol/v0.1.x - 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x diff --git a/protocol/testing/testnet-dev/dev.sh b/protocol/testing/testnet-dev/dev.sh index 4f5a8b6c3fa..8ec7d88a35b 100755 --- a/protocol/testing/testnet-dev/dev.sh +++ b/protocol/testing/testnet-dev/dev.sh @@ -205,7 +205,7 @@ create_validators() { } setup_preupgrade_binary() { - tar_url='https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv4.1.0/dydxprotocold-v4.1.0-linux-amd64.tar.gz' + tar_url='https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv9.3.0/dydxprotocold-v9.3.0-linux-amd64.tar.gz' tar_path='/tmp/dydxprotocold/dydxprotocold.tar.gz' mkdir -p /tmp/dydxprotocold curl -vL $tar_url -o $tar_path @@ -220,8 +220,8 @@ setup_cosmovisor() { export DAEMON_HOME="$HOME/chain/.full-node-$i" cosmovisor init $PREUPGRADE_BINARY_PATH - mkdir -p "$FULL_NODE_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/" - ln -s /bin/dydxprotocold "$FULL_NODE_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/dydxprotocold" + mkdir -p "$FULL_NODE_HOME_DIR/cosmovisor/upgrades/v9.4.0/bin/" + ln -s /bin/dydxprotocold "$FULL_NODE_HOME_DIR/cosmovisor/upgrades/v9.4.0/bin/dydxprotocold" done for i in "${!MONIKERS[@]}"; do @@ -230,8 +230,8 @@ setup_cosmovisor() { export DAEMON_HOME="$HOME/chain/.${MONIKERS[$i]}" cosmovisor init $PREUPGRADE_BINARY_PATH - mkdir -p "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/" - ln -s /bin/dydxprotocold "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/dydxprotocold" + mkdir -p "$VAL_HOME_DIR/cosmovisor/upgrades/v9.4.0/bin/" + ln -s /bin/dydxprotocold "$VAL_HOME_DIR/cosmovisor/upgrades/v9.4.0/bin/dydxprotocold" done } diff --git a/protocol/testing/testnet-local/local.sh b/protocol/testing/testnet-local/local.sh index b1c14a1f00d..3a2d08d914b 100755 --- a/protocol/testing/testnet-local/local.sh +++ b/protocol/testing/testnet-local/local.sh @@ -160,7 +160,7 @@ create_validators() { } setup_preupgrade_binary() { - tar_url='https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv4.1.0/dydxprotocold-v4.1.0-linux-amd64.tar.gz' + tar_url='https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv9.3.0/dydxprotocold-v9.3.0-linux-amd64.tar.gz' tar_path='/tmp/dydxprotocold/dydxprotocold.tar.gz' mkdir -p /tmp/dydxprotocold curl -vL $tar_url -o $tar_path @@ -175,8 +175,8 @@ setup_cosmovisor() { export DAEMON_HOME="$HOME/chain/.${MONIKERS[$i]}" cosmovisor init $PREUPGRADE_BINARY_PATH - mkdir -p "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/" - ln -s /bin/dydxprotocold "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/dydxprotocold" + mkdir -p "$VAL_HOME_DIR/cosmovisor/upgrades/v9.4.0/bin/" + ln -s /bin/dydxprotocold "$VAL_HOME_DIR/cosmovisor/upgrades/v9.4.0/bin/dydxprotocold" done } diff --git a/protocol/testing/testnet-staging/staging.sh b/protocol/testing/testnet-staging/staging.sh index d84966c3854..30cb2b2c900 100755 --- a/protocol/testing/testnet-staging/staging.sh +++ b/protocol/testing/testnet-staging/staging.sh @@ -259,7 +259,7 @@ create_validators() { } setup_preupgrade_binary() { - tar_url='https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv4.1.0/dydxprotocold-v4.1.0-linux-amd64.tar.gz' + tar_url='https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv9.3.0/dydxprotocold-v9.3.0-linux-amd64.tar.gz' tar_path='/tmp/dydxprotocold/dydxprotocold.tar.gz' mkdir -p /tmp/dydxprotocold curl -vL $tar_url -o $tar_path @@ -274,8 +274,8 @@ setup_cosmovisor() { export DAEMON_HOME="$HOME/chain/.full-node-$i" cosmovisor init $PREUPGRADE_BINARY_PATH - mkdir -p "$FULL_NODE_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/" - ln -s /bin/dydxprotocold "$FULL_NODE_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/dydxprotocold" + mkdir -p "$FULL_NODE_HOME_DIR/cosmovisor/upgrades/v9.4.0/bin/" + ln -s /bin/dydxprotocold "$FULL_NODE_HOME_DIR/cosmovisor/upgrades/v9.4.0/bin/dydxprotocold" done for i in "${!MONIKERS[@]}"; do @@ -284,8 +284,8 @@ setup_cosmovisor() { export DAEMON_HOME="$HOME/chain/.${MONIKERS[$i]}" cosmovisor init $PREUPGRADE_BINARY_PATH - mkdir -p "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/" - ln -s /bin/dydxprotocold "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/dydxprotocold" + mkdir -p "$VAL_HOME_DIR/cosmovisor/upgrades/v9.4.0/bin/" + ln -s /bin/dydxprotocold "$VAL_HOME_DIR/cosmovisor/upgrades/v9.4.0/bin/dydxprotocold" done } From 58a24ecf06d4aa3d8e7f15fbd16ba0c7fe7ed64a Mon Sep 17 00:00:00 2001 From: Justin Barnett Date: Fri, 24 Oct 2025 17:41:37 -0400 Subject: [PATCH 3/9] Remove aff params --- proto/dydxprotocol/affiliates/genesis.proto | 3 --- protocol/x/affiliates/genesis.go | 15 +-------------- protocol/x/affiliates/types/genesis.go | 3 +-- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/proto/dydxprotocol/affiliates/genesis.proto b/proto/dydxprotocol/affiliates/genesis.proto index a653747ed29..4dd0dd22918 100644 --- a/proto/dydxprotocol/affiliates/genesis.proto +++ b/proto/dydxprotocol/affiliates/genesis.proto @@ -9,7 +9,4 @@ option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/affiliates/type message GenesisState { // The list of affiliate tiers AffiliateTiers affiliate_tiers = 1 [ (gogoproto.nullable) = false ]; - - // The affiliate parameters - AffiliateParameters affiliate_parameters = 2 [ (gogoproto.nullable) = false ]; } \ No newline at end of file diff --git a/protocol/x/affiliates/genesis.go b/protocol/x/affiliates/genesis.go index 0d27c8d5866..fd6c3d4ec78 100644 --- a/protocol/x/affiliates/genesis.go +++ b/protocol/x/affiliates/genesis.go @@ -12,13 +12,6 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) if err != nil { panic(err) } - - err = k.UpdateAffiliateParameters(ctx, &types.MsgUpdateAffiliateParameters{ - AffiliateParameters: genState.AffiliateParameters, - }) - if err != nil { - panic(err) - } } // ExportGenesis returns the module's exported genesis. @@ -28,13 +21,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { panic(err) } - affiliateParameters, err := k.GetAffiliateParameters(ctx) - if err != nil { - panic(err) - } - return &types.GenesisState{ - AffiliateTiers: affiliateTiers, - AffiliateParameters: affiliateParameters, + AffiliateTiers: affiliateTiers, } } diff --git a/protocol/x/affiliates/types/genesis.go b/protocol/x/affiliates/types/genesis.go index 5510b780ea4..0fac6ad5611 100644 --- a/protocol/x/affiliates/types/genesis.go +++ b/protocol/x/affiliates/types/genesis.go @@ -3,8 +3,7 @@ package types // DefaultGenesis returns the default stats genesis state. func DefaultGenesis() *GenesisState { return &GenesisState{ - AffiliateTiers: DefaultAffiliateTiers, - AffiliateParameters: DefaultAffiliateParameters, + AffiliateTiers: DefaultAffiliateTiers, } } From 57e93ce1516cd30d1b983ff34bf9309f1b25e13f Mon Sep 17 00:00:00 2001 From: Justin Barnett Date: Mon, 27 Oct 2025 09:13:12 -0400 Subject: [PATCH 4/9] Remove genesis --- protocol/app/testdata/default_genesis_state.json | 5 ----- protocol/testing/testnet/genesis.json | 7 ------- 2 files changed, 12 deletions(-) diff --git a/protocol/app/testdata/default_genesis_state.json b/protocol/app/testdata/default_genesis_state.json index 40ab66b567f..100c9aedf80 100644 --- a/protocol/app/testdata/default_genesis_state.json +++ b/protocol/app/testdata/default_genesis_state.json @@ -43,11 +43,6 @@ } ] }, - "affiliate_parameters": { - "maximum_30d_affiliate_revenue_per_referred_user_quote_quantums": "10000000000", - "maximum_30d_attributable_volume_per_referred_user_quote_quantums": "100000000000000", - "referee_minimum_fee_tier_idx": 2 - } }, "auth": { "params": { diff --git a/protocol/testing/testnet/genesis.json b/protocol/testing/testnet/genesis.json index 982b7dbbdee..30da2b92a6b 100644 --- a/protocol/testing/testnet/genesis.json +++ b/protocol/testing/testnet/genesis.json @@ -36,13 +36,6 @@ } ] }, - "affiliates": { - "affiliate_parameters": { - "maximum_30d_attributable_volume_per_referred_user_quote_quantums": "100000000000000", - "referee_minimum_fee_tier_idx": 2, - "maximum_30d_affiliate_revenue_per_referred_user_quote_quantums": "10000000000" - } - }, "auth": { "params": { "max_memo_characters": "256", From 968ba3f1aa5c6de561a29c7acc1849043b229a70 Mon Sep 17 00:00:00 2001 From: Justin Barnett Date: Mon, 27 Oct 2025 09:43:38 -0400 Subject: [PATCH 5/9] REmove parameters from genesis --- protocol/scripts/genesis/sample_pregenesis.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/protocol/scripts/genesis/sample_pregenesis.json b/protocol/scripts/genesis/sample_pregenesis.json index 46052e336ce..d5877e3f4fd 100644 --- a/protocol/scripts/genesis/sample_pregenesis.json +++ b/protocol/scripts/genesis/sample_pregenesis.json @@ -3,11 +3,6 @@ "app_name": "dydxprotocold", "app_state": { "affiliates": { - "affiliate_parameters": { - "maximum_30d_affiliate_revenue_per_referred_user_quote_quantums": "10000000000", - "maximum_30d_attributable_volume_per_referred_user_quote_quantums": "100000000000000", - "referee_minimum_fee_tier_idx": 2 - }, "affiliate_tiers": { "tiers": [ { From 2a69d03aa61ab44a31edcbd18b1178098d3b435e Mon Sep 17 00:00:00 2001 From: Justin Barnett Date: Mon, 27 Oct 2025 09:51:43 -0400 Subject: [PATCH 6/9] Reset genesis --- protocol/app/testdata/default_genesis_state.json | 11 ++++++++--- protocol/scripts/genesis/sample_pregenesis.json | 11 ++++++++--- protocol/testing/testnet/genesis.json | 10 ++++++++-- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/protocol/app/testdata/default_genesis_state.json b/protocol/app/testdata/default_genesis_state.json index 100c9aedf80..6adede202e6 100644 --- a/protocol/app/testdata/default_genesis_state.json +++ b/protocol/app/testdata/default_genesis_state.json @@ -43,6 +43,11 @@ } ] }, + "affiliate_parameters": { + "maximum_30d_affiliate_revenue_per_referred_user_quote_quantums": "10000000000", + "maximum_30d_attributable_volume_per_referred_user_quote_quantums": "100000000000000", + "referee_minimum_fee_tier_idx": 2 + } }, "auth": { "params": { @@ -121,7 +126,8 @@ "max_short_term_order_cancellations_per_n_blocks": [], "max_short_term_orders_per_n_blocks": [], "max_short_term_orders_and_cancels_per_n_blocks": [], - "max_stateful_orders_per_n_blocks": [] + "max_stateful_orders_per_n_blocks": [], + "max_leverage_updates_per_n_blocks": [] }, "equity_tier_limit_config": { "short_term_order_equity_tiers": [], @@ -279,8 +285,7 @@ "taker_fee_ppm": 250 } ] - }, - "staking_tiers": [] + } }, "genutil": { "gen_txs": [] diff --git a/protocol/scripts/genesis/sample_pregenesis.json b/protocol/scripts/genesis/sample_pregenesis.json index d5877e3f4fd..78393c8b9d8 100644 --- a/protocol/scripts/genesis/sample_pregenesis.json +++ b/protocol/scripts/genesis/sample_pregenesis.json @@ -3,6 +3,11 @@ "app_name": "dydxprotocold", "app_state": { "affiliates": { + "affiliate_parameters": { + "maximum_30d_affiliate_revenue_per_referred_user_quote_quantums": "10000000000", + "maximum_30d_attributable_volume_per_referred_user_quote_quantums": "100000000000000", + "referee_minimum_fee_tier_idx": 2 + }, "affiliate_tiers": { "tiers": [ { @@ -131,6 +136,7 @@ }, "clob": { "block_rate_limit_config": { + "max_leverage_updates_per_n_blocks": [], "max_short_term_order_cancellations_per_n_blocks": [], "max_short_term_orders_and_cancels_per_n_blocks": [ { @@ -808,8 +814,7 @@ "total_volume_share_requirement_ppm": 5000 } ] - }, - "staking_tiers": [] + } }, "genutil": { "gen_txs": [] @@ -4097,7 +4102,7 @@ ] } }, - "app_version": "9.0.0-47-gd399e2625", + "app_version": "9.0.0-64-g531bff2de", "chain_id": "dydx-sample-1", "consensus": { "params": { diff --git a/protocol/testing/testnet/genesis.json b/protocol/testing/testnet/genesis.json index 30da2b92a6b..3a33d056940 100644 --- a/protocol/testing/testnet/genesis.json +++ b/protocol/testing/testnet/genesis.json @@ -36,6 +36,13 @@ } ] }, + "affiliates": { + "affiliate_parameters": { + "maximum_30d_attributable_volume_per_referred_user_quote_quantums": "100000000000000", + "referee_minimum_fee_tier_idx": 2, + "maximum_30d_affiliate_revenue_per_referred_user_quote_quantums": "10000000000" + } + }, "auth": { "params": { "max_memo_characters": "256", @@ -1825,8 +1832,7 @@ "total_volume_share_requirement_ppm": 5000 } ] - }, - "staking_tiers": [] + } }, "genutil": { "gen_txs": [ From 59ed7716654bca749082d1d0ca43b5a5d20fd950 Mon Sep 17 00:00:00 2001 From: Justin Barnett Date: Mon, 27 Oct 2025 09:53:08 -0400 Subject: [PATCH 7/9] Reset genesis --- protocol/app/testdata/default_genesis_state.json | 13 +------------ protocol/scripts/genesis/sample_pregenesis.json | 13 +------------ protocol/testing/testnet/genesis.json | 7 ------- 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/protocol/app/testdata/default_genesis_state.json b/protocol/app/testdata/default_genesis_state.json index 6adede202e6..0ffa88aba81 100644 --- a/protocol/app/testdata/default_genesis_state.json +++ b/protocol/app/testdata/default_genesis_state.json @@ -35,18 +35,8 @@ "req_referred_volume_quote_quantums": "25000000000000", "req_staked_whole_coins": 5000, "taker_fee_share_ppm": 150000 - }, - { - "req_referred_volume_quote_quantums": "50000000000000", - "req_staked_whole_coins": 1e+08, - "taker_fee_share_ppm": 250000 } ] - }, - "affiliate_parameters": { - "maximum_30d_affiliate_revenue_per_referred_user_quote_quantums": "10000000000", - "maximum_30d_attributable_volume_per_referred_user_quote_quantums": "100000000000000", - "referee_minimum_fee_tier_idx": 2 } }, "auth": { @@ -126,8 +116,7 @@ "max_short_term_order_cancellations_per_n_blocks": [], "max_short_term_orders_per_n_blocks": [], "max_short_term_orders_and_cancels_per_n_blocks": [], - "max_stateful_orders_per_n_blocks": [], - "max_leverage_updates_per_n_blocks": [] + "max_stateful_orders_per_n_blocks": [] }, "equity_tier_limit_config": { "short_term_order_equity_tiers": [], diff --git a/protocol/scripts/genesis/sample_pregenesis.json b/protocol/scripts/genesis/sample_pregenesis.json index 78393c8b9d8..6e78202357d 100644 --- a/protocol/scripts/genesis/sample_pregenesis.json +++ b/protocol/scripts/genesis/sample_pregenesis.json @@ -3,11 +3,6 @@ "app_name": "dydxprotocold", "app_state": { "affiliates": { - "affiliate_parameters": { - "maximum_30d_affiliate_revenue_per_referred_user_quote_quantums": "10000000000", - "maximum_30d_attributable_volume_per_referred_user_quote_quantums": "100000000000000", - "referee_minimum_fee_tier_idx": 2 - }, "affiliate_tiers": { "tiers": [ { @@ -29,11 +24,6 @@ "req_referred_volume_quote_quantums": "25000000000000", "req_staked_whole_coins": 5000, "taker_fee_share_ppm": 150000 - }, - { - "req_referred_volume_quote_quantums": "50000000000000", - "req_staked_whole_coins": 100000000, - "taker_fee_share_ppm": 250000 } ] } @@ -136,7 +126,6 @@ }, "clob": { "block_rate_limit_config": { - "max_leverage_updates_per_n_blocks": [], "max_short_term_order_cancellations_per_n_blocks": [], "max_short_term_orders_and_cancels_per_n_blocks": [ { @@ -4102,7 +4091,7 @@ ] } }, - "app_version": "9.0.0-64-g531bff2de", + "app_version": "7.0.0-dev0-149-g12cfb908b", "chain_id": "dydx-sample-1", "consensus": { "params": { diff --git a/protocol/testing/testnet/genesis.json b/protocol/testing/testnet/genesis.json index 3a33d056940..3fe44a2f9b8 100644 --- a/protocol/testing/testnet/genesis.json +++ b/protocol/testing/testnet/genesis.json @@ -36,13 +36,6 @@ } ] }, - "affiliates": { - "affiliate_parameters": { - "maximum_30d_attributable_volume_per_referred_user_quote_quantums": "100000000000000", - "referee_minimum_fee_tier_idx": 2, - "maximum_30d_affiliate_revenue_per_referred_user_quote_quantums": "10000000000" - } - }, "auth": { "params": { "max_memo_characters": "256", From 08d85eb2fe0c5a35cf67e4b00d99aab4a85babd2 Mon Sep 17 00:00:00 2001 From: Justin Barnett Date: Mon, 27 Oct 2025 11:57:20 -0400 Subject: [PATCH 8/9] REmove affiliate params --- protocol/x/affiliates/types/genesis.pb.go | 76 +++-------------------- 1 file changed, 10 insertions(+), 66 deletions(-) diff --git a/protocol/x/affiliates/types/genesis.pb.go b/protocol/x/affiliates/types/genesis.pb.go index 2f54c3e334b..890eab489a8 100644 --- a/protocol/x/affiliates/types/genesis.pb.go +++ b/protocol/x/affiliates/types/genesis.pb.go @@ -27,8 +27,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type GenesisState struct { // The list of affiliate tiers AffiliateTiers AffiliateTiers `protobuf:"bytes,1,opt,name=affiliate_tiers,json=affiliateTiers,proto3" json:"affiliate_tiers"` - // The affiliate parameters - AffiliateParameters AffiliateParameters `protobuf:"bytes,2,opt,name=affiliate_parameters,json=affiliateParameters,proto3" json:"affiliate_parameters"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -71,13 +69,6 @@ func (m *GenesisState) GetAffiliateTiers() AffiliateTiers { return AffiliateTiers{} } -func (m *GenesisState) GetAffiliateParameters() AffiliateParameters { - if m != nil { - return m.AffiliateParameters - } - return AffiliateParameters{} -} - func init() { proto.RegisterType((*GenesisState)(nil), "dydxprotocol.affiliates.GenesisState") } @@ -87,22 +78,20 @@ func init() { } var fileDescriptor_7d3ffc50e877971b = []byte{ - // 240 bytes of a gzipped FileDescriptorProto + // 207 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xa9, 0x4c, 0xa9, 0x28, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0xce, 0xcf, 0xd1, 0x4f, 0x4c, 0x4b, 0xcb, 0xcc, 0xc9, 0x4c, 0x2c, 0x49, 0x2d, 0xd6, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x03, 0xcb, 0x09, 0x89, 0x23, 0x2b, 0xd3, 0x43, 0x28, 0x93, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x4b, 0xe8, 0x83, 0x58, - 0x10, 0xe5, 0x52, 0x1a, 0xb8, 0x4c, 0x45, 0x30, 0x21, 0x2a, 0x95, 0xce, 0x32, 0x72, 0xf1, 0xb8, - 0x43, 0xac, 0x0a, 0x2e, 0x49, 0x2c, 0x49, 0x15, 0x0a, 0xe3, 0xe2, 0x87, 0x2b, 0x8a, 0x2f, 0xc9, - 0x4c, 0x2d, 0x2a, 0x96, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x52, 0xd7, 0xc3, 0xe1, 0x06, 0x3d, - 0x47, 0x18, 0x33, 0x04, 0xa4, 0xdc, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0xbe, 0x44, 0x14, - 0x51, 0xa1, 0x54, 0x2e, 0x11, 0x84, 0xb9, 0x05, 0x89, 0x45, 0x89, 0xb9, 0xa9, 0x25, 0x20, 0xc3, - 0x99, 0xc0, 0x86, 0xeb, 0x10, 0x36, 0x3c, 0x00, 0xae, 0x07, 0x6a, 0x83, 0x70, 0x22, 0x16, 0xa9, - 0xb0, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, - 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xb2, 0x49, 0xcf, 0x2c, 0xc9, - 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, 0x09, 0x9e, 0x32, 0x13, 0xdd, 0xe4, 0x8c, 0xc4, - 0xcc, 0x3c, 0x7d, 0xb8, 0x48, 0x05, 0x72, 0x90, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, - 0x25, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x29, 0xbf, 0x39, 0xbc, 0xb0, 0x01, 0x00, 0x00, + 0x10, 0xe5, 0x52, 0x1a, 0xb8, 0x4c, 0x45, 0x30, 0x21, 0x2a, 0x95, 0xd2, 0xb8, 0x78, 0xdc, 0x21, + 0x36, 0x05, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x85, 0x71, 0xf1, 0xc3, 0xd5, 0xc4, 0x97, 0x64, 0xa6, + 0x16, 0x15, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0xa9, 0xeb, 0xe1, 0x70, 0x82, 0x9e, 0x23, + 0x8c, 0x19, 0x02, 0x52, 0xee, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x5f, 0x22, 0xaa, 0x68, + 0xd8, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, + 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xd9, 0xa4, 0x67, 0x96, 0x64, + 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0x38, 0xbb, 0xcc, 0x44, 0x37, 0x39, 0x23, 0x31, + 0x33, 0x4f, 0x1f, 0x2e, 0x52, 0x81, 0xec, 0x95, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, + 0xa4, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x3f, 0xb3, 0x6a, 0x5a, 0x48, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -125,16 +114,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - { - size, err := m.AffiliateParameters.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 { size, err := m.AffiliateTiers.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -167,8 +146,6 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.AffiliateTiers.Size() n += 1 + l + sovGenesis(uint64(l)) - l = m.AffiliateParameters.Size() - n += 1 + l + sovGenesis(uint64(l)) return n } @@ -240,39 +217,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AffiliateParameters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AffiliateParameters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) From 45ec834858e1f3fa8e7fc12016d5e32ebd6a91cd Mon Sep 17 00:00:00 2001 From: Justin Barnett Date: Mon, 27 Oct 2025 12:04:33 -0400 Subject: [PATCH 9/9] Uncook this upgrade --- .../scripts/genesis/sample_pregenesis.json | 82 +++++++------------ protocol/testing/snapshotting/snapshot.sh | 6 +- 2 files changed, 32 insertions(+), 56 deletions(-) diff --git a/protocol/scripts/genesis/sample_pregenesis.json b/protocol/scripts/genesis/sample_pregenesis.json index 6e78202357d..3cde78f8950 100644 --- a/protocol/scripts/genesis/sample_pregenesis.json +++ b/protocol/scripts/genesis/sample_pregenesis.json @@ -24,6 +24,11 @@ "req_referred_volume_quote_quantums": "25000000000000", "req_staked_whole_coins": 5000, "taker_fee_share_ppm": 150000 + }, + { + "req_referred_volume_quote_quantums": "50000000000000", + "req_staked_whole_coins": 100000000, + "taker_fee_share_ppm": 250000 } ] } @@ -126,14 +131,19 @@ }, "clob": { "block_rate_limit_config": { - "max_short_term_order_cancellations_per_n_blocks": [], - "max_short_term_orders_and_cancels_per_n_blocks": [ + "max_short_term_order_cancellations_per_n_blocks": [ + { + "limit": 200, + "num_blocks": 1 + } + ], + "max_short_term_orders_and_cancels_per_n_blocks": [], + "max_short_term_orders_per_n_blocks": [ { - "limit": 400, + "limit": 200, "num_blocks": 1 } ], - "max_short_term_orders_per_n_blocks": [], "max_stateful_orders_per_n_blocks": [ { "limit": 2, @@ -803,7 +813,8 @@ "total_volume_share_requirement_ppm": 5000 } ] - } + }, + "staking_tiers": [] }, "genutil": { "gen_txs": [] @@ -3091,36 +3102,28 @@ "impact_notional": 10000000000, "initial_margin_ppm": 20000, "maintenance_fraction_ppm": 600000, - "name": "Large-Cap", - "open_interest_lower_cap": 0, - "open_interest_upper_cap": 0 + "name": "Large-Cap" }, { "id": 1, "impact_notional": 5000000000, "initial_margin_ppm": 100000, "maintenance_fraction_ppm": 500000, - "name": "Small-Cap", - "open_interest_lower_cap": 20000000000000, - "open_interest_upper_cap": 50000000000000 + "name": "Small-Cap" }, { "id": 2, "impact_notional": 2500000000, "initial_margin_ppm": 200000, "maintenance_fraction_ppm": 500000, - "name": "Long-Tail", - "open_interest_lower_cap": 5000000000000, - "open_interest_upper_cap": 10000000000000 + "name": "Long-Tail" }, { "id": 3, "impact_notional": 2500000000, "initial_margin_ppm": 1000000, "maintenance_fraction_ppm": 200000, - "name": "Safety", - "open_interest_lower_cap": 2000000000000, - "open_interest_upper_cap": 5000000000000 + "name": "Safety" }, { "id": 4, @@ -3163,7 +3166,6 @@ "id": 0, "liquidity_tier": 0, "market_id": 0, - "market_type": 1, "ticker": "BTC-USD" } }, @@ -3174,7 +3176,6 @@ "id": 1, "liquidity_tier": 0, "market_id": 1, - "market_type": 1, "ticker": "ETH-USD" } }, @@ -3185,7 +3186,6 @@ "id": 2, "liquidity_tier": 1, "market_id": 2, - "market_type": 1, "ticker": "LINK-USD" } }, @@ -3196,7 +3196,6 @@ "id": 3, "liquidity_tier": 1, "market_id": 3, - "market_type": 1, "ticker": "POL-USD" } }, @@ -3207,7 +3206,6 @@ "id": 4, "liquidity_tier": 1, "market_id": 4, - "market_type": 1, "ticker": "CRV-USD" } }, @@ -3218,7 +3216,6 @@ "id": 5, "liquidity_tier": 1, "market_id": 5, - "market_type": 1, "ticker": "SOL-USD" } }, @@ -3229,7 +3226,6 @@ "id": 6, "liquidity_tier": 1, "market_id": 6, - "market_type": 1, "ticker": "ADA-USD" } }, @@ -3240,7 +3236,6 @@ "id": 7, "liquidity_tier": 1, "market_id": 7, - "market_type": 1, "ticker": "AVAX-USD" } }, @@ -3251,7 +3246,6 @@ "id": 8, "liquidity_tier": 1, "market_id": 8, - "market_type": 1, "ticker": "FIL-USD" } }, @@ -3262,7 +3256,6 @@ "id": 9, "liquidity_tier": 1, "market_id": 9, - "market_type": 1, "ticker": "LTC-USD" } }, @@ -3273,7 +3266,6 @@ "id": 10, "liquidity_tier": 1, "market_id": 10, - "market_type": 1, "ticker": "DOGE-USD" } }, @@ -3284,7 +3276,6 @@ "id": 11, "liquidity_tier": 1, "market_id": 11, - "market_type": 1, "ticker": "ATOM-USD" } }, @@ -3295,7 +3286,6 @@ "id": 12, "liquidity_tier": 1, "market_id": 12, - "market_type": 1, "ticker": "DOT-USD" } }, @@ -3306,7 +3296,6 @@ "id": 13, "liquidity_tier": 1, "market_id": 13, - "market_type": 1, "ticker": "UNI-USD" } }, @@ -3317,7 +3306,6 @@ "id": 14, "liquidity_tier": 1, "market_id": 14, - "market_type": 1, "ticker": "BCH-USD" } }, @@ -3328,7 +3316,6 @@ "id": 15, "liquidity_tier": 1, "market_id": 15, - "market_type": 1, "ticker": "TRX-USD" } }, @@ -3339,7 +3326,6 @@ "id": 16, "liquidity_tier": 1, "market_id": 16, - "market_type": 1, "ticker": "NEAR-USD" } }, @@ -3350,7 +3336,6 @@ "id": 17, "liquidity_tier": 2, "market_id": 17, - "market_type": 1, "ticker": "MKR-USD" } }, @@ -3361,7 +3346,6 @@ "id": 18, "liquidity_tier": 1, "market_id": 18, - "market_type": 1, "ticker": "XLM-USD" } }, @@ -3372,7 +3356,6 @@ "id": 19, "liquidity_tier": 1, "market_id": 19, - "market_type": 1, "ticker": "ETC-USD" } }, @@ -3383,7 +3366,6 @@ "id": 20, "liquidity_tier": 2, "market_id": 20, - "market_type": 1, "ticker": "COMP-USD" } }, @@ -3394,7 +3376,6 @@ "id": 21, "liquidity_tier": 1, "market_id": 21, - "market_type": 1, "ticker": "WLD-USD" } }, @@ -3405,7 +3386,6 @@ "id": 22, "liquidity_tier": 2, "market_id": 22, - "market_type": 1, "ticker": "APE-USD" } }, @@ -3416,7 +3396,6 @@ "id": 23, "liquidity_tier": 1, "market_id": 23, - "market_type": 1, "ticker": "APT-USD" } }, @@ -3427,7 +3406,6 @@ "id": 24, "liquidity_tier": 1, "market_id": 24, - "market_type": 1, "ticker": "ARB-USD" } }, @@ -3438,7 +3416,6 @@ "id": 25, "liquidity_tier": 2, "market_id": 25, - "market_type": 1, "ticker": "BLUR-USD" } }, @@ -3449,7 +3426,6 @@ "id": 26, "liquidity_tier": 2, "market_id": 26, - "market_type": 1, "ticker": "LDO-USD" } }, @@ -3460,7 +3436,6 @@ "id": 27, "liquidity_tier": 1, "market_id": 27, - "market_type": 1, "ticker": "OP-USD" } }, @@ -3471,7 +3446,6 @@ "id": 28, "liquidity_tier": 1, "market_id": 28, - "market_type": 1, "ticker": "PEPE-USD" } }, @@ -3482,7 +3456,6 @@ "id": 29, "liquidity_tier": 2, "market_id": 29, - "market_type": 1, "ticker": "SEI-USD" } }, @@ -3493,7 +3466,6 @@ "id": 30, "liquidity_tier": 1, "market_id": 30, - "market_type": 1, "ticker": "SHIB-USD" } }, @@ -3504,7 +3476,6 @@ "id": 31, "liquidity_tier": 1, "market_id": 31, - "market_type": 1, "ticker": "SUI-USD" } }, @@ -3515,7 +3486,6 @@ "id": 32, "liquidity_tier": 1, "market_id": 32, - "market_type": 1, "ticker": "XRP-USD" } }, @@ -4091,15 +4061,15 @@ ] } }, - "app_version": "7.0.0-dev0-149-g12cfb908b", + "app_version": "9.3.0-20-g08d85eb2f", "chain_id": "dydx-sample-1", "consensus": { "params": { "abci": { - "vote_extensions_enable_height": "1" + "vote_extensions_enable_height": "0" }, "block": { - "max_bytes": "4194304", + "max_bytes": "22020096", "max_gas": "-1" }, "evidence": { @@ -4117,6 +4087,12 @@ } } }, + "consensus_params": { + "block": { + "max_bytes": "4194304", + "max_gas": "-1" + } + }, "genesis_time": "2023-12-31T00:00:00Z", "initial_height": 1 } diff --git a/protocol/testing/snapshotting/snapshot.sh b/protocol/testing/snapshotting/snapshot.sh index 8e52abbb270..0b30d47dd1f 100755 --- a/protocol/testing/snapshotting/snapshot.sh +++ b/protocol/testing/snapshotting/snapshot.sh @@ -65,7 +65,7 @@ install_prerequisites() { } setup_preupgrade_binary() { - tar_url='https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv4.1.0/dydxprotocold-v4.1.0-linux-amd64.tar.gz' + tar_url='https://github.com/dydxprotocol/v4-chain/releases/download/protocol%2Fv9.3.0/dydxprotocold-v9.3.0-linux-amd64.tar.gz' tar_path='/tmp/dydxprotocold/dydxprotocold.tar.gz' mkdir -p /tmp/dydxprotocold curl -vL $tar_url -o $tar_path @@ -79,8 +79,8 @@ setup_cosmovisor() { export DAEMON_HOME="$HOME/chain/local_node" cosmovisor init $PREUPGRADE_BINARY_PATH - mkdir -p "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/" - ln -s /bin/dydxprotocold "$VAL_HOME_DIR/cosmovisor/upgrades/v5.0.0/bin/dydxprotocold" + mkdir -p "$VAL_HOME_DIR/cosmovisor/upgrades/v9.4.0/bin/" + ln -s /bin/dydxprotocold "$VAL_HOME_DIR/cosmovisor/upgrades/v9.4.0/bin/dydxprotocold" } install_prerequisites