From b4abd61a1d2af18c057bb1aa64e992cd456307ec Mon Sep 17 00:00:00 2001 From: antstalepresh <36045227+antstalepresh@users.noreply.github.com> Date: Sat, 15 Jul 2023 15:07:13 -0400 Subject: [PATCH] Make Stride a consumer chain (#811) Co-authored-by: stana-ethernal Co-authored-by: jstr1121 <118450565+jstr1121@users.noreply.github.com> Co-authored-by: jstr1121 Co-authored-by: Aidan Salzmann Co-authored-by: Son Trinh Co-authored-by: Jacob Gadikian Co-authored-by: sampocs Co-authored-by: sampocs Co-authored-by: strbrian --- .gitmodules | 2 +- Makefile | 5 +- app/ante_handler.go | 60 ++++ app/app.go | 215 +++++++----- app/apptesting/test_helpers.go | 131 +++++-- app/proposals_whitelisting.go | 122 +++++++ app/test_setup.go | 26 +- app/upgrades.go | 56 ++- app/upgrades/README.md | 4 +- app/upgrades/v10/upgrades.go | 25 +- app/upgrades/v10/upgrades_test.go | 24 +- app/upgrades/v12/README.md | 2 + app/upgrades/v12/upgrades.go | 63 ++++ app/upgrades/v3/upgrades.go | 6 +- app/upgrades/v3/upgrades_test.go | 2 +- app/upgrades/v4/upgrades_test.go | 2 +- app/upgrades/v5/upgrades.go | 20 +- app/upgrades/v5/upgrades_test.go | 28 +- app/upgrades/v6/upgrades.go | 2 +- app/upgrades/v6/upgrades_test.go | 8 +- app/upgrades/v7/upgrades.go | 14 +- app/upgrades/v7/upgrades_test.go | 12 +- app/upgrades/v8/upgrades.go | 12 +- app/upgrades/v8/upgrades_test.go | 10 +- app/upgrades/v9/upgrades.go | 2 +- app/upgrades/v9/upgrades_test.go | 14 +- cmd/consumer.go | 143 ++++++++ cmd/strided/main.go | 7 +- cmd/strided/root.go | 6 +- consumer/start_consumer.sh | 2 +- consumer/start_consumer_rly.sh | 323 ++++++++++++++++++ deps/evmos | 1 - deps/hermes | 2 +- deps/juno | 2 +- deps/relayer | 2 +- deps/stargaze | 2 +- dockernet/config.sh | 8 +- dockernet/config/hermes_config.toml | 10 +- dockernet/config/relayer_config.yaml | 10 + dockernet/config/relayer_config_ics.yaml | 47 +++ dockernet/docker-compose.yml | 7 + dockernet/dockerfiles/Dockerfile.hermes | 4 +- dockernet/src/init_chain.sh | 34 +- dockernet/src/start_relayers.sh | 36 +- dockernet/upgrades/setup_ics.sh | 160 +++++++++ go.mod | 22 +- go.sum | 33 +- proto/stride/autopilot/genesis.proto | 2 +- proto/stride/autopilot/params.proto | 2 +- proto/stride/autopilot/query.proto | 2 +- proto/stride/claim/claim.proto | 2 +- proto/stride/claim/genesis.proto | 2 +- proto/stride/claim/params.proto | 2 +- proto/stride/claim/query.proto | 2 +- proto/stride/claim/tx.proto | 2 +- proto/stride/epochs/genesis.proto | 2 +- proto/stride/epochs/query.proto | 4 +- proto/stride/icacallbacks/callback_data.proto | 2 +- proto/stride/icacallbacks/genesis.proto | 2 +- proto/stride/icacallbacks/packet.proto | 2 +- proto/stride/icacallbacks/params.proto | 2 +- proto/stride/icacallbacks/query.proto | 2 +- proto/stride/icacallbacks/tx.proto | 2 +- proto/stride/interchainquery/v1/genesis.proto | 2 +- .../stride/interchainquery/v1/messages.proto | 2 +- proto/stride/interchainquery/v1/query.proto | 2 +- proto/stride/mint/v1beta1/genesis.proto | 2 +- proto/stride/mint/v1beta1/mint.proto | 2 +- proto/stride/mint/v1beta1/query.proto | 2 +- proto/stride/ratelimit/genesis.proto | 2 +- proto/stride/ratelimit/gov.proto | 2 +- proto/stride/ratelimit/params.proto | 2 +- proto/stride/ratelimit/query.proto | 2 +- proto/stride/ratelimit/ratelimit.proto | 2 +- proto/stride/records/callbacks.proto | 2 +- proto/stride/records/genesis.proto | 2 +- proto/stride/records/query.proto | 2 +- proto/stride/stakeibc/address_unbonding.proto | 2 +- proto/stride/stakeibc/callbacks.proto | 2 +- proto/stride/stakeibc/epoch_tracker.proto | 2 +- proto/stride/stakeibc/genesis.proto | 2 +- proto/stride/stakeibc/gov.proto | 2 +- proto/stride/stakeibc/host_zone.proto | 2 +- proto/stride/stakeibc/ica_account.proto | 2 +- proto/stride/stakeibc/packet.proto | 2 +- proto/stride/stakeibc/params.proto | 2 +- proto/stride/stakeibc/query.proto | 2 +- proto/stride/stakeibc/tx.proto | 2 +- proto/stride/stakeibc/validator.proto | 2 +- proto/stride/vesting/tx.proto | 2 +- proto/stride/vesting/vesting.proto | 2 +- relayer/config/config.lock | 0 relayer/config/config.yaml | 65 ++++ relayer/config/config1.yaml | 65 ++++ scripts/consumer/README.md | 52 +++ scripts/consumer/run.sh | 5 + scripts/consumer/start_consumer.sh | 210 ++++++++++++ scripts/consumer/start_provider.sh | 128 +++++++ scripts/protocgen.sh | 2 +- testutil/consumer.go | 37 ++ testutil/keeper/claim.go | 4 +- testutil/keeper/epochs.go | 4 +- testutil/keeper/icacallbacks.go | 4 +- testutil/keeper/interchainquery.go | 4 +- testutil/keeper/records.go | 4 +- testutil/keeper/stakeibc.go | 4 +- testutil/network/network.go | 99 +++++- utils/utils.go | 6 +- x/autopilot/client/cli/query.go | 2 +- x/autopilot/genesis.go | 4 +- x/autopilot/genesis_test.go | 6 +- x/autopilot/handler.go | 4 +- x/autopilot/keeper/airdrop.go | 8 +- x/autopilot/keeper/airdrop_test.go | 10 +- x/autopilot/keeper/grpc_query_params.go | 2 +- x/autopilot/keeper/grpc_query_params_test.go | 2 +- x/autopilot/keeper/keeper.go | 6 +- x/autopilot/keeper/keeper_test.go | 4 +- x/autopilot/keeper/liquidstake.go | 6 +- x/autopilot/keeper/liquidstake_test.go | 14 +- x/autopilot/keeper/params.go | 2 +- x/autopilot/keeper/params_test.go | 2 +- x/autopilot/module.go | 6 +- x/autopilot/module_ibc.go | 4 +- x/autopilot/types/genesis_test.go | 2 +- x/autopilot/types/parser_test.go | 4 +- x/claim/client/cli/cli_test.go | 14 +- x/claim/client/cli/query.go | 2 +- x/claim/client/cli/tx.go | 2 +- x/claim/client/cli/tx_claim_free_amount.go | 2 +- x/claim/client/cli/tx_create_airdrop.go | 2 +- x/claim/client/cli/tx_delete_airdrop.go | 2 +- .../client/cli/tx_set_airdrop_allocations.go | 2 +- x/claim/genesis_test.go | 6 +- x/claim/handler.go | 4 +- x/claim/keeper/claim.go | 8 +- x/claim/keeper/claim_test.go | 10 +- x/claim/keeper/genesis.go | 2 +- x/claim/keeper/grpc_query.go | 2 +- x/claim/keeper/hooks.go | 6 +- x/claim/keeper/hooks_test.go | 6 +- x/claim/keeper/keeper.go | 2 +- x/claim/keeper/keeper_test.go | 6 +- x/claim/keeper/msg_server.go | 2 +- x/claim/keeper/msg_server_test.go | 4 +- x/claim/keeper/params.go | 2 +- x/claim/migrations/v2/convert.go | 4 +- x/claim/migrations/v2/convert_test.go | 4 +- x/claim/migrations/v2/migrations.go | 4 +- x/claim/module.go | 6 +- x/claim/types/expected_keepers.go | 2 +- x/claim/types/msgs.go | 2 +- x/claim/types/query.pb.go | 2 +- x/claim/vesting/client/cli/tx.go | 2 +- x/claim/vesting/client/testutil/suite.go | 2 +- x/claim/vesting/handler.go | 2 +- x/claim/vesting/module.go | 4 +- x/claim/vesting/msg_server.go | 2 +- x/claim/vesting/types/codec.go | 2 +- x/claim/vesting/types/common_test.go | 2 +- x/claim/vesting/types/vesting_account.go | 4 +- x/claim/vesting/types/vesting_account_test.go | 2 +- x/epochs/client/cli/query.go | 2 +- x/epochs/genesis.go | 4 +- x/epochs/genesis_test.go | 8 +- x/epochs/handler.go | 4 +- x/epochs/keeper/abci.go | 4 +- x/epochs/keeper/abci_test.go | 4 +- x/epochs/keeper/epoch.go | 2 +- x/epochs/keeper/epoch_test.go | 2 +- x/epochs/keeper/grpc_query.go | 2 +- x/epochs/keeper/grpc_query_test.go | 2 +- x/epochs/keeper/hooks.go | 2 +- x/epochs/keeper/keeper.go | 2 +- x/epochs/keeper/keeper_test.go | 4 +- x/epochs/module.go | 8 +- x/epochs/simulation/genesis.go | 2 +- x/icacallbacks/client/cli/query.go | 2 +- .../client/cli/query_callback_data.go | 2 +- .../client/cli/query_callback_data_test.go | 8 +- x/icacallbacks/client/cli/query_params.go | 2 +- x/icacallbacks/client/cli/tx.go | 2 +- x/icacallbacks/genesis.go | 4 +- x/icacallbacks/genesis_test.go | 8 +- x/icacallbacks/handler.go | 4 +- x/icacallbacks/ibc_module.go | 4 +- x/icacallbacks/icacallbacks.go | 2 +- x/icacallbacks/icacallbacks_test.go | 6 +- x/icacallbacks/keeper/callback_data.go | 2 +- x/icacallbacks/keeper/callback_data_test.go | 8 +- x/icacallbacks/keeper/grpc_query.go | 2 +- .../keeper/grpc_query_callback_data.go | 2 +- .../keeper/grpc_query_callback_data_test.go | 6 +- x/icacallbacks/keeper/grpc_query_params.go | 2 +- .../keeper/grpc_query_params_test.go | 4 +- x/icacallbacks/keeper/keeper.go | 2 +- x/icacallbacks/keeper/msg_server.go | 2 +- x/icacallbacks/keeper/params.go | 2 +- x/icacallbacks/keeper/params_test.go | 4 +- x/icacallbacks/migrations/v2/convert.go | 6 +- x/icacallbacks/migrations/v2/convert_test.go | 4 +- x/icacallbacks/migrations/v2/migrations.go | 2 +- x/icacallbacks/module.go | 6 +- x/icacallbacks/module_simulation.go | 6 +- x/icacallbacks/types/genesis_test.go | 2 +- x/interchainquery/client/cli/query.go | 2 +- x/interchainquery/genesis.go | 4 +- x/interchainquery/handler.go | 4 +- x/interchainquery/keeper/abci.go | 2 +- x/interchainquery/keeper/grpc_query.go | 2 +- x/interchainquery/keeper/keeper.go | 4 +- x/interchainquery/keeper/keeper_test.go | 7 +- x/interchainquery/keeper/msg_server.go | 4 +- .../keeper/msg_submit_query_response_test.go | 2 +- x/interchainquery/keeper/new_query_test.go | 2 +- x/interchainquery/keeper/queries.go | 2 +- x/interchainquery/keeper/queries_test.go | 4 +- x/interchainquery/module.go | 6 +- x/mint/client/cli/cli_test.go | 4 +- x/mint/client/cli/query.go | 2 +- x/mint/client/rest/grpc_query_test.go | 4 +- x/mint/genesis.go | 4 +- x/mint/keeper/grpc_query.go | 2 +- x/mint/keeper/hooks.go | 4 +- x/mint/keeper/keeper.go | 2 +- x/mint/module.go | 8 +- x/mint/types/expected_keepers.go | 2 +- x/mint/types/params.go | 2 +- x/ratelimit/client/cli/query.go | 2 +- x/ratelimit/client/cli/tx.go | 2 +- x/ratelimit/client/proposal_handler.go | 2 +- x/ratelimit/genesis.go | 4 +- x/ratelimit/genesis_test.go | 8 +- x/ratelimit/handler.go | 6 +- x/ratelimit/ibc_middleware.go | 2 +- x/ratelimit/keeper/gov/gov.go | 4 +- x/ratelimit/keeper/gov/gov_test.go | 8 +- x/ratelimit/keeper/grpc_query.go | 2 +- x/ratelimit/keeper/grpc_query_test.go | 2 +- x/ratelimit/keeper/hooks.go | 5 +- x/ratelimit/keeper/hooks_test.go | 4 +- x/ratelimit/keeper/keeper.go | 2 +- x/ratelimit/keeper/keeper_test.go | 4 +- x/ratelimit/keeper/packet.go | 6 +- x/ratelimit/keeper/packet_test.go | 4 +- x/ratelimit/keeper/params.go | 2 +- x/ratelimit/keeper/rate_limit.go | 2 +- x/ratelimit/keeper/rate_limit_test.go | 6 +- x/ratelimit/module.go | 6 +- x/ratelimit/types/flow_test.go | 2 +- x/ratelimit/types/gov_add_rate_limit_test.go | 4 +- .../types/gov_remove_rate_limit_test.go | 4 +- .../types/gov_reset_rate_limit_test.go | 4 +- .../types/gov_update_rate_limit_test.go | 4 +- x/ratelimit/types/quota_test.go | 2 +- x/records/client/cli/query.go | 2 +- x/records/client/cli/query_deposit_record.go | 2 +- .../client/cli/query_deposit_record_test.go | 8 +- .../cli/query_epoch_unbonding_record.go | 2 +- x/records/client/cli/query_params.go | 2 +- .../cli/query_user_redemption_record.go | 2 +- .../cli/query_user_redemption_record_test.go | 8 +- x/records/client/cli/tx.go | 2 +- x/records/genesis.go | 4 +- x/records/genesis_test.go | 8 +- x/records/handler.go | 4 +- x/records/keeper/callback_transfer.go | 4 +- x/records/keeper/callback_transfer_test.go | 6 +- x/records/keeper/callbacks.go | 2 +- x/records/keeper/deposit_record.go | 2 +- x/records/keeper/epoch_unbonding_record.go | 4 +- .../keeper/epoch_unbonding_record_test.go | 8 +- x/records/keeper/grpc_query.go | 2 +- x/records/keeper/grpc_query_deposit_record.go | 2 +- .../keeper/grpc_query_deposit_record_test.go | 8 +- .../grpc_query_epoch_unbonding_record.go | 2 +- .../grpc_query_epoch_unbonding_record_test.go | 6 +- x/records/keeper/grpc_query_params.go | 2 +- x/records/keeper/grpc_query_params_test.go | 4 +- .../grpc_query_user_redemption_record.go | 2 +- ...c_query_user_redemption_record_for_user.go | 2 +- .../grpc_query_user_redemption_record_test.go | 6 +- x/records/keeper/keeper.go | 8 +- x/records/keeper/keeper_test.go | 7 +- x/records/keeper/msg_server.go | 2 +- x/records/keeper/params.go | 2 +- x/records/keeper/params_test.go | 4 +- x/records/keeper/transfer_test.go | 4 +- x/records/keeper/user_redemption_record.go | 2 +- .../keeper/user_redemption_record_test.go | 8 +- x/records/migrations/v2/convert.go | 4 +- x/records/migrations/v2/convert_test.go | 4 +- x/records/migrations/v2/migrations.go | 4 +- x/records/module.go | 6 +- x/records/module_ibc.go | 6 +- x/records/module_simulation.go | 6 +- x/records/types/genesis_test.go | 2 +- x/stakeibc/abci.go | 4 +- x/stakeibc/client/cli/query.go | 2 +- x/stakeibc/client/cli/query_epoch_tracker.go | 2 +- .../client/cli/query_epoch_tracker_test.go | 6 +- x/stakeibc/client/cli/query_host_zone.go | 2 +- x/stakeibc/client/cli/query_module_address.go | 2 +- .../client/cli/query_next_packet_sequence.go | 2 +- x/stakeibc/client/cli/query_params.go | 2 +- x/stakeibc/client/cli/query_register_ica.go | 2 +- x/stakeibc/client/cli/query_validator.go | 2 +- x/stakeibc/client/cli/tx.go | 2 +- x/stakeibc/client/cli/tx_add_validators.go | 15 +- .../client/cli/tx_add_validators_proposal.go | 2 +- .../client/cli/tx_change_validator_weight.go | 2 +- .../client/cli/tx_claim_undelegated_tokens.go | 2 +- x/stakeibc/client/cli/tx_clear_balance.go | 2 +- x/stakeibc/client/cli/tx_delete_validator.go | 2 +- x/stakeibc/client/cli/tx_liquid_stake.go | 2 +- .../client/cli/tx_rebalance_validators.go | 2 +- x/stakeibc/client/cli/tx_redeem_stake.go | 2 +- .../client/cli/tx_register_host_zone.go | 2 +- .../cli/tx_restore_interchain_account.go | 2 +- x/stakeibc/client/cli/tx_update_delegation.go | 2 +- x/stakeibc/client/proposal_handler.go | 2 +- x/stakeibc/genesis.go | 4 +- x/stakeibc/genesis_test.go | 8 +- x/stakeibc/handler.go | 4 +- x/stakeibc/ibc_middleware.go | 4 +- x/stakeibc/keeper/deposit_records.go | 6 +- x/stakeibc/keeper/deposit_records_test.go | 8 +- .../keeper/epoch_elapsed_shares_test.go | 6 +- x/stakeibc/keeper/epoch_tracker.go | 2 +- x/stakeibc/keeper/epoch_tracker_test.go | 8 +- x/stakeibc/keeper/get_denom_traces_test.go | 26 +- .../keeper/get_light_client_safely_test.go | 4 +- x/stakeibc/keeper/gov.go | 2 +- x/stakeibc/keeper/grpc_query.go | 2 +- .../keeper/grpc_query_address_unbondings.go | 4 +- x/stakeibc/keeper/grpc_query_epoch_tracker.go | 2 +- .../keeper/grpc_query_epoch_tracker_test.go | 6 +- x/stakeibc/keeper/grpc_query_host_zone.go | 2 +- .../keeper/grpc_query_host_zone_test.go | 6 +- .../keeper/grpc_query_module_address.go | 2 +- .../keeper/grpc_query_next_packet_sequence.go | 2 +- .../grpc_query_next_packet_sequence_test.go | 2 +- x/stakeibc/keeper/grpc_query_params.go | 2 +- x/stakeibc/keeper/grpc_query_params_test.go | 4 +- x/stakeibc/keeper/grpc_query_register_ica.go | 2 +- x/stakeibc/keeper/grpc_query_validator.go | 2 +- .../keeper/grpc_query_validator_test.go | 6 +- x/stakeibc/keeper/hooks.go | 8 +- x/stakeibc/keeper/host_zone.go | 4 +- x/stakeibc/keeper/host_zone_test.go | 8 +- x/stakeibc/keeper/icacallbacks.go | 4 +- x/stakeibc/keeper/icacallbacks_claim.go | 8 +- x/stakeibc/keeper/icacallbacks_claim_test.go | 6 +- x/stakeibc/keeper/icacallbacks_delegate.go | 8 +- .../keeper/icacallbacks_delegate_test.go | 6 +- x/stakeibc/keeper/icacallbacks_rebalance.go | 6 +- .../keeper/icacallbacks_rebalance_test.go | 4 +- x/stakeibc/keeper/icacallbacks_redemption.go | 8 +- .../keeper/icacallbacks_redemption_test.go | 6 +- x/stakeibc/keeper/icacallbacks_reinvest.go | 12 +- .../keeper/icacallbacks_reinvest_test.go | 16 +- x/stakeibc/keeper/icacallbacks_undelegate.go | 8 +- .../keeper/icacallbacks_undelegate_test.go | 6 +- x/stakeibc/keeper/icqcallbacks.go | 2 +- .../keeper/icqcallbacks_delegator_shares.go | 8 +- .../icqcallbacks_delegator_shares_test.go | 8 +- x/stakeibc/keeper/icqcallbacks_fee_balance.go | 10 +- .../keeper/icqcallbacks_fee_balance_test.go | 8 +- .../icqcallbacks_validator_exchange_rate.go | 8 +- ...qcallbacks_validator_exchange_rate_test.go | 8 +- .../keeper/icqcallbacks_withdrawal_balance.go | 8 +- .../icqcallbacks_withdrawal_balance_test.go | 10 +- x/stakeibc/keeper/keeper.go | 10 +- x/stakeibc/keeper/keeper_test.go | 7 +- x/stakeibc/keeper/msg_server.go | 2 +- .../keeper/msg_server_add_validators.go | 2 +- .../keeper/msg_server_add_validators_test.go | 4 +- .../msg_server_change_validator_weight.go | 2 +- .../msg_server_claim_undelegated_tokens.go | 6 +- ...sg_server_claim_undelegated_tokens_test.go | 8 +- x/stakeibc/keeper/msg_server_clear_balance.go | 2 +- .../keeper/msg_server_clear_balance_test.go | 4 +- .../keeper/msg_server_delete_validator.go | 2 +- .../msg_server_delete_validator_test.go | 2 +- x/stakeibc/keeper/msg_server_liquid_stake.go | 14 +- .../keeper/msg_server_liquid_stake_test.go | 6 +- .../keeper/msg_server_rebalance_validators.go | 4 +- .../msg_server_rebalance_validators_test.go | 6 +- x/stakeibc/keeper/msg_server_redeem_stake.go | 6 +- .../keeper/msg_server_redeem_stake_test.go | 6 +- .../keeper/msg_server_register_host_zone.go | 8 +- .../msg_server_register_host_zone_test.go | 12 +- .../msg_server_restore_interchain_account.go | 4 +- ..._server_restore_interchain_account_test.go | 4 +- x/stakeibc/keeper/msg_server_submit_tx.go | 24 +- ...erver_update_validator_shares_exch_rate.go | 2 +- x/stakeibc/keeper/params.go | 2 +- x/stakeibc/keeper/params_test.go | 4 +- x/stakeibc/keeper/reward_allocation.go | 2 +- x/stakeibc/keeper/reward_allocation_test.go | 6 +- x/stakeibc/keeper/unbonding_records.go | 23 +- .../keeper/unbonding_records_cleanup_test.go | 4 +- ...ords_get_host_zone_unbondings_msgs_test.go | 4 +- ...ng_records_initiate_all_unbondings_test.go | 4 +- ...ding_records_sweep_unbonded_tokens_test.go | 6 +- .../keeper/update_redemption_rates_test.go | 4 +- .../update_validator_shares_exch_rate_test.go | 6 +- x/stakeibc/keeper/validator_selection.go | 8 +- x/stakeibc/migrations/v2/convert.go | 4 +- x/stakeibc/migrations/v2/convert_test.go | 4 +- x/stakeibc/migrations/v2/migrations.go | 4 +- x/stakeibc/module.go | 6 +- x/stakeibc/module_simulation.go | 6 +- x/stakeibc/proposal_handler.go | 4 +- x/stakeibc/simulation/add_validator.go | 4 +- .../simulation/change_validator_weight.go | 4 +- .../simulation/claim_undelegated_tokens.go | 4 +- x/stakeibc/simulation/delete_validator.go | 4 +- x/stakeibc/simulation/liquid_stake.go | 4 +- x/stakeibc/simulation/rebalance_validators.go | 4 +- .../simulation/restore_interchain_account.go | 4 +- x/stakeibc/simulation/update_delegation.go | 4 +- x/stakeibc/types/expected_keepers.go | 2 +- x/stakeibc/types/genesis_test.go | 2 +- x/stakeibc/types/message_add_validators.go | 2 +- .../types/message_add_validators_test.go | 4 +- .../types/message_change_validator_weight.go | 2 +- .../message_change_validator_weight_test.go | 2 +- .../types/message_claim_undelegated_tokens.go | 2 +- .../message_claim_undelegated_tokens_test.go | 2 +- x/stakeibc/types/message_clear_balance.go | 2 +- x/stakeibc/types/message_delete_validator.go | 2 +- .../types/message_delete_validator_test.go | 2 +- x/stakeibc/types/message_liquid_stake_test.go | 2 +- .../types/message_rebalance_validators.go | 2 +- .../message_rebalance_validators_test.go | 4 +- x/stakeibc/types/message_redeem_stake_test.go | 2 +- .../types/message_register_host_zone.go | 2 +- ...message_restore_interchain_account_test.go | 2 +- x/stakeibc/types/message_update_delegation.go | 2 +- 440 files changed, 2909 insertions(+), 1038 deletions(-) create mode 100644 app/ante_handler.go create mode 100644 app/proposals_whitelisting.go create mode 100644 app/upgrades/v12/README.md create mode 100644 app/upgrades/v12/upgrades.go create mode 100644 cmd/consumer.go create mode 100644 consumer/start_consumer_rly.sh delete mode 160000 deps/evmos create mode 100644 dockernet/config/relayer_config_ics.yaml create mode 100644 dockernet/upgrades/setup_ics.sh create mode 100644 relayer/config/config.lock create mode 100644 relayer/config/config.yaml create mode 100644 relayer/config/config1.yaml create mode 100644 scripts/consumer/README.md create mode 100644 scripts/consumer/run.sh create mode 100644 scripts/consumer/start_consumer.sh create mode 100644 scripts/consumer/start_provider.sh create mode 100644 testutil/consumer.go diff --git a/.gitmodules b/.gitmodules index 7276029b70..d6ec3a3f1b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ [submodule "deps/hermes"] - # Commit: fd92eb6d17342bc83003f2067d6a9cd8261f2884 + # Commit: v1.5.1 path = deps/hermes url = https://github.com/informalsystems/ibc-rs.git [submodule "deps/relayer"] diff --git a/Makefile b/Makefile index 994ebdbc23..c70f70bea7 100644 --- a/Makefile +++ b/Makefile @@ -132,7 +132,7 @@ upgrade-build-old-binary: @DOCKERNET_HOME=$(DOCKERNET_HOME) BUILDDIR=$(BUILDDIR) bash $(DOCKERNET_HOME)/upgrades/build_old_binary.sh submit-upgrade-immediately: - UPGRADE_HEIGHT=100 bash $(DOCKERNET_HOME)/upgrades/submit_upgrade.sh + UPGRADE_HEIGHT=150 bash $(DOCKERNET_HOME)/upgrades/submit_upgrade.sh submit-upgrade-after-tests: UPGRADE_HEIGHT=400 bash $(DOCKERNET_HOME)/upgrades/submit_upgrade.sh @@ -145,6 +145,9 @@ finish-upgrade-integration-tests: upgrade-integration-tests-part-1: start-docker-all start-upgrade-integration-tests submit-upgrade-after-tests +setup-ics: + UPGRADE_HEIGHT=150 bash $(DOCKERNET_HOME)/upgrades/setup_ics.sh + ############################################################################### ### Local to Mainnet ### ############################################################################### diff --git a/app/ante_handler.go b/app/ante_handler.go new file mode 100644 index 0000000000..a9559dbb66 --- /dev/null +++ b/app/ante_handler.go @@ -0,0 +1,60 @@ +package app + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/auth/ante" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + democracyante "github.com/cosmos/interchain-security/v3/app/consumer-democracy/ante" + consumerante "github.com/cosmos/interchain-security/v3/app/consumer/ante" + ccvconsumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" +) + +// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC +// channel keeper. +type HandlerOptions struct { + ante.HandlerOptions + + IBCKeeper *ibckeeper.Keeper + ConsumerKeeper ccvconsumerkeeper.Keeper +} + +func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { + if options.AccountKeeper == nil { + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler") + } + if options.BankKeeper == nil { + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") + } + if options.SignModeHandler == nil { + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") + } + + var sigGasConsumer = options.SigGasConsumer + if sigGasConsumer == nil { + sigGasConsumer = ante.DefaultSigVerificationGasConsumer + } + + anteDecorators := []sdk.AnteDecorator{ + ante.NewSetUpContextDecorator(), + ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker), + // temporarily disabled so that chain can be tested locally without the provider chain running + consumerante.NewDisabledModulesDecorator("/cosmos.evidence", "/cosmos.slashing"), + democracyante.NewForbiddenProposalsDecorator(IsProposalWhitelisted, IsModuleWhiteList), + // ante.NewMempoolFeeDecorator(), + ante.NewValidateBasicDecorator(), + ante.NewTxTimeoutHeightDecorator(), + ante.NewValidateMemoDecorator(options.AccountKeeper), + ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), + ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker), + // SetPubKeyDecorator must be called before all signature verification decorators + ante.NewSetPubKeyDecorator(options.AccountKeeper), + ante.NewValidateSigCountDecorator(options.AccountKeeper), + ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer), + ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), + ante.NewIncrementSequenceDecorator(options.AccountKeeper), + } + + return sdk.ChainAnteDecorators(anteDecorators...), nil +} diff --git a/app/app.go b/app/app.go index 4cf9c2af5d..f8ac680b88 100644 --- a/app/app.go +++ b/app/app.go @@ -6,12 +6,14 @@ import ( "path/filepath" authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" - "github.com/Stride-Labs/stride/v11/utils" + "github.com/Stride-Labs/stride/v12/utils" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -43,7 +45,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/crisis" crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" - distr "github.com/cosmos/cosmos-sdk/x/distribution" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/evidence" @@ -52,21 +53,21 @@ import ( "github.com/cosmos/cosmos-sdk/x/feegrant" feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/gov" govclient "github.com/cosmos/cosmos-sdk/x/gov/client" govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + ccvdistr "github.com/cosmos/interchain-security/v3/x/ccv/democracy/distribution" + ccvgov "github.com/cosmos/interchain-security/v3/x/ccv/democracy/governance" - claimvesting "github.com/Stride-Labs/stride/v11/x/claim/vesting" - claimvestingtypes "github.com/Stride-Labs/stride/v11/x/claim/vesting/types" + claimvesting "github.com/Stride-Labs/stride/v12/x/claim/vesting" + claimvestingtypes "github.com/Stride-Labs/stride/v12/x/claim/vesting/types" - "github.com/Stride-Labs/stride/v11/x/mint" - mintkeeper "github.com/Stride-Labs/stride/v11/x/mint/keeper" - minttypes "github.com/Stride-Labs/stride/v11/x/mint/types" + "github.com/Stride-Labs/stride/v12/x/mint" + mintkeeper "github.com/Stride-Labs/stride/v12/x/mint/keeper" + minttypes "github.com/Stride-Labs/stride/v12/x/mint/types" dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" @@ -82,7 +83,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/cosmos-sdk/x/upgrade" @@ -98,8 +98,8 @@ import ( ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported" ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" - ibctesting "github.com/cosmos/ibc-go/v7/testing" - + ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" + ccvstaking "github.com/cosmos/interchain-security/v3/x/ccv/democracy/staking" "github.com/spf13/cast" ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" @@ -114,38 +114,42 @@ import ( // monitoringp "github.com/tendermint/spn/x/monitoringp" // monitoringpkeeper "github.com/tendermint/spn/x/monitoringp/keeper" - epochsmodule "github.com/Stride-Labs/stride/v11/x/epochs" - epochsmodulekeeper "github.com/Stride-Labs/stride/v11/x/epochs/keeper" - epochsmoduletypes "github.com/Stride-Labs/stride/v11/x/epochs/types" - - "github.com/Stride-Labs/stride/v11/x/interchainquery" - interchainquerykeeper "github.com/Stride-Labs/stride/v11/x/interchainquery/keeper" - interchainquerytypes "github.com/Stride-Labs/stride/v11/x/interchainquery/types" - - "github.com/Stride-Labs/stride/v11/x/autopilot" - autopilotkeeper "github.com/Stride-Labs/stride/v11/x/autopilot/keeper" - autopilottypes "github.com/Stride-Labs/stride/v11/x/autopilot/types" - - "github.com/Stride-Labs/stride/v11/x/claim" - claimkeeper "github.com/Stride-Labs/stride/v11/x/claim/keeper" - claimtypes "github.com/Stride-Labs/stride/v11/x/claim/types" - icacallbacksmodule "github.com/Stride-Labs/stride/v11/x/icacallbacks" - icacallbacksmodulekeeper "github.com/Stride-Labs/stride/v11/x/icacallbacks/keeper" - icacallbacksmoduletypes "github.com/Stride-Labs/stride/v11/x/icacallbacks/types" - ratelimitmodule "github.com/Stride-Labs/stride/v11/x/ratelimit" - ratelimitclient "github.com/Stride-Labs/stride/v11/x/ratelimit/client" - ratelimitmodulekeeper "github.com/Stride-Labs/stride/v11/x/ratelimit/keeper" - ratelimitmoduletypes "github.com/Stride-Labs/stride/v11/x/ratelimit/types" - recordsmodule "github.com/Stride-Labs/stride/v11/x/records" - recordsmodulekeeper "github.com/Stride-Labs/stride/v11/x/records/keeper" - recordsmoduletypes "github.com/Stride-Labs/stride/v11/x/records/types" - stakeibcmodule "github.com/Stride-Labs/stride/v11/x/stakeibc" - stakeibcclient "github.com/Stride-Labs/stride/v11/x/stakeibc/client" - stakeibcmodulekeeper "github.com/Stride-Labs/stride/v11/x/stakeibc/keeper" - stakeibcmoduletypes "github.com/Stride-Labs/stride/v11/x/stakeibc/types" + epochsmodule "github.com/Stride-Labs/stride/v12/x/epochs" + epochsmodulekeeper "github.com/Stride-Labs/stride/v12/x/epochs/keeper" + epochsmoduletypes "github.com/Stride-Labs/stride/v12/x/epochs/types" + + "github.com/Stride-Labs/stride/v12/x/interchainquery" + interchainquerykeeper "github.com/Stride-Labs/stride/v12/x/interchainquery/keeper" + interchainquerytypes "github.com/Stride-Labs/stride/v12/x/interchainquery/types" + + "github.com/Stride-Labs/stride/v12/x/autopilot" + autopilotkeeper "github.com/Stride-Labs/stride/v12/x/autopilot/keeper" + autopilottypes "github.com/Stride-Labs/stride/v12/x/autopilot/types" + + "github.com/Stride-Labs/stride/v12/x/claim" + claimkeeper "github.com/Stride-Labs/stride/v12/x/claim/keeper" + claimtypes "github.com/Stride-Labs/stride/v12/x/claim/types" + icacallbacksmodule "github.com/Stride-Labs/stride/v12/x/icacallbacks" + icacallbacksmodulekeeper "github.com/Stride-Labs/stride/v12/x/icacallbacks/keeper" + icacallbacksmoduletypes "github.com/Stride-Labs/stride/v12/x/icacallbacks/types" + ratelimitmodule "github.com/Stride-Labs/stride/v12/x/ratelimit" + ratelimitclient "github.com/Stride-Labs/stride/v12/x/ratelimit/client" + ratelimitmodulekeeper "github.com/Stride-Labs/stride/v12/x/ratelimit/keeper" + ratelimitmoduletypes "github.com/Stride-Labs/stride/v12/x/ratelimit/types" + recordsmodule "github.com/Stride-Labs/stride/v12/x/records" + recordsmodulekeeper "github.com/Stride-Labs/stride/v12/x/records/keeper" + recordsmoduletypes "github.com/Stride-Labs/stride/v12/x/records/types" + stakeibcmodule "github.com/Stride-Labs/stride/v12/x/stakeibc" + stakeibcclient "github.com/Stride-Labs/stride/v12/x/stakeibc/client" + stakeibcmodulekeeper "github.com/Stride-Labs/stride/v12/x/stakeibc/keeper" + stakeibcmoduletypes "github.com/Stride-Labs/stride/v12/x/stakeibc/types" + + ccvconsumer "github.com/cosmos/interchain-security/v3/x/ccv/consumer" + ccvconsumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" + ccvconsumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" storetypes "github.com/cosmos/cosmos-sdk/store/types" - ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types" + "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/core" ) const ( @@ -184,9 +188,9 @@ var ( genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator), bank.AppModuleBasic{}, capability.AppModuleBasic{}, - staking.AppModuleBasic{}, + ccvstaking.AppModuleBasic{}, mint.AppModuleBasic{}, - distr.AppModuleBasic{}, + ccvdistr.AppModuleBasic{}, gov.NewAppModuleBasic(getGovProposalHandlers()), params.AppModuleBasic{}, crisis.AppModuleBasic{}, @@ -208,6 +212,7 @@ var ( ratelimitmodule.AppModuleBasic{}, icacallbacksmodule.AppModuleBasic{}, claim.AppModuleBasic{}, + ccvconsumer.AppModuleBasic{}, autopilot.AppModuleBasic{}, tendermint.AppModuleBasic{}, ) @@ -217,16 +222,18 @@ var ( authtypes.FeeCollectorName: nil, distrtypes.ModuleName: nil, // mint module needs burn access to remove excess validator tokens (it overallocates, then burns) - minttypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - stakeibcmoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking}, - claimtypes.ModuleName: nil, - interchainquerytypes.ModuleName: nil, - icatypes.ModuleName: nil, - stakeibcmoduletypes.RewardCollectorName: nil, + ccvconsumertypes.ConsumerRedistributeName: nil, + ccvconsumertypes.ConsumerToSendToProviderName: nil, + minttypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + govtypes.ModuleName: {authtypes.Burner}, + ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + stakeibcmoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking}, + claimtypes.ModuleName: nil, + interchainquerytypes.ModuleName: nil, + icatypes.ModuleName: nil, + stakeibcmoduletypes.RewardCollectorName: nil, } ) @@ -281,6 +288,7 @@ type StrideApp struct { // MonitoringKeeper monitoringpkeeper.Keeper ICAControllerKeeper icacontrollerkeeper.Keeper ICAHostKeeper icahostkeeper.Keeper + ConsumerKeeper ccvconsumerkeeper.Keeper AutopilotKeeper autopilotkeeper.Keeper // make scoped keepers public for test purposes @@ -289,6 +297,7 @@ type StrideApp struct { // ScopedMonitoringKeeper capabilitykeeper.ScopedKeeper ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper ScopedICAHostKeeper capabilitykeeper.ScopedKeeper + ScopedCCVConsumerKeeper capabilitykeeper.ScopedKeeper ScopedStakeibcKeeper capabilitykeeper.ScopedKeeper StakeibcKeeper stakeibcmodulekeeper.Keeper @@ -344,6 +353,7 @@ func NewStrideApp( ratelimitmoduletypes.StoreKey, icacallbacksmoduletypes.StoreKey, claimtypes.StoreKey, + ccvconsumertypes.StoreKey, crisistypes.StoreKey, consensusparamtypes.StoreKey, ) @@ -380,6 +390,7 @@ func NewStrideApp( scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) + scopedCCVConsumerKeeper := app.CapabilityKeeper.ScopeToModule(ccvconsumertypes.ModuleName) // add keepers app.AccountKeeper = authkeeper.NewAccountKeeper( @@ -398,10 +409,10 @@ func NewStrideApp( ) app.DistrKeeper = distrkeeper.NewKeeper( appCodec, keys[distrtypes.StoreKey], app.AccountKeeper, app.BankKeeper, - app.StakingKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + app.StakingKeeper, ccvconsumertypes.ConsumerRedistributeName, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) app.SlashingKeeper = slashingkeeper.NewKeeper( - appCodec, encodingConfig.Amino, keys[slashingtypes.StoreKey], app.StakingKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), + appCodec, encodingConfig.Amino, keys[slashingtypes.StoreKey], &app.ConsumerKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) app.CrisisKeeper = crisiskeeper.NewKeeper(appCodec, keys[crisistypes.StoreKey], invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(), @@ -419,14 +430,24 @@ func NewStrideApp( // register the staking hooks // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks app.StakingKeeper.SetHooks( - stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks(), app.ClaimKeeper.Hooks()), + stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.ClaimKeeper.Hooks()), ) // ... other modules keepers + app.ConsumerKeeper = ccvconsumerkeeper.NewNonZeroKeeper( + appCodec, + keys[ccvconsumertypes.StoreKey], + app.GetSubspace(ccvconsumertypes.ModuleName), + ) // Create IBC Keeper app.IBCKeeper = ibckeeper.NewKeeper( - appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, + appCodec, + keys[ibchost.StoreKey], + app.GetSubspace(ibchost.ModuleName), + &app.ConsumerKeeper, + app.UpgradeKeeper, + scopedIBCKeeper, ) // Create Ratelimit Keeper @@ -459,11 +480,34 @@ func NewStrideApp( // Create evidence Keeper for to register the IBC light client misbehaviour evidence route evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, keys[evidencetypes.StoreKey], &app.StakingKeeper, app.SlashingKeeper, + appCodec, keys[evidencetypes.StoreKey], &app.ConsumerKeeper, app.SlashingKeeper, ) // If evidence needs to be handled for the app, set routes in router here and seal app.EvidenceKeeper = *evidenceKeeper + // Create CCV consumer and modules + app.ConsumerKeeper = ccvconsumerkeeper.NewKeeper( + appCodec, + keys[ccvconsumertypes.StoreKey], + app.GetSubspace(ccvconsumertypes.ModuleName), + scopedCCVConsumerKeeper, + app.IBCKeeper.ChannelKeeper, + &app.IBCKeeper.PortKeeper, + app.IBCKeeper.ConnectionKeeper, + app.IBCKeeper.ClientKeeper, + app.SlashingKeeper, + app.BankKeeper, + app.AccountKeeper, + &app.TransferKeeper, + app.IBCKeeper, + authtypes.FeeCollectorName, + ) + app.ConsumerKeeper.SetStandaloneStakingKeeper(app.StakingKeeper) + + // register slashing module StakingHooks to the consumer keeper + app.ConsumerKeeper = *app.ConsumerKeeper.SetHooks(app.SlashingKeeper.Hooks()) + consumerModule := ccvconsumer.NewAppModule(app.ConsumerKeeper, app.GetSubspace(ccvconsumertypes.ModuleName)) + // TODO(TEST-20): look for all lines that include 'monitoring' in this file! there are a few places this // is commented out // scopedMonitoringKeeper := app.CapabilityKeeper.ScopeToModule(monitoringptypes.ModuleName) @@ -554,7 +598,6 @@ func NewStrideApp( appCodec, keys[govtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.MsgServiceRouter(), govtypes.DefaultConfig(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) - govKeeper.SetLegacyRouter(govRouter) app.GovKeeper = *govKeeper @@ -636,7 +679,9 @@ func NewStrideApp( // ICACallbacks Stack AddRoute(icacontrollertypes.SubModuleName, icacallbacksStack). // Transfer stack - AddRoute(ibctransfertypes.ModuleName, transferStack) + AddRoute(ibctransfertypes.ModuleName, transferStack). + // Consumer stack + AddRoute(ccvconsumertypes.ModuleName, consumerModule) app.IBCKeeper.SetRouter(ibcRouter) @@ -661,11 +706,11 @@ func NewStrideApp( capability.NewAppModule(appCodec, *app.CapabilityKeeper, false), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), - gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)), + ccvgov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper, IsProposalWhitelisted, app.GetSubspace(govtypes.ModuleName), func(_ string) bool { return true }), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, app.BankKeeper), - slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)), - staking.NewAppModule(appCodec, &app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), + slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.ConsumerKeeper, app.GetSubspace(slashingtypes.ModuleName)), + ccvdistr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, authtypes.FeeCollectorName, app.GetSubspace(distrtypes.ModuleName)), + ccvstaking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)), upgrade.NewAppModule(app.UpgradeKeeper), evidence.NewAppModule(app.EvidenceKeeper), consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), @@ -681,6 +726,7 @@ func NewStrideApp( recordsModule, ratelimitModule, icacallbacksModule, + consumerModule, autopilotModule, ) @@ -716,12 +762,14 @@ func NewStrideApp( ratelimitmoduletypes.ModuleName, icacallbacksmoduletypes.ModuleName, claimtypes.ModuleName, + ccvconsumertypes.ModuleName, autopilottypes.ModuleName, consensusparamtypes.ModuleName, ) app.mm.SetOrderEndBlockers( crisistypes.ModuleName, + genutiltypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, capabilitytypes.ModuleName, @@ -732,7 +780,6 @@ func NewStrideApp( vestingtypes.ModuleName, claimvestingtypes.ModuleName, minttypes.ModuleName, - genutiltypes.ModuleName, evidencetypes.ModuleName, feegrant.ModuleName, paramstypes.ModuleName, @@ -748,6 +795,7 @@ func NewStrideApp( ratelimitmoduletypes.ModuleName, icacallbacksmoduletypes.ModuleName, claimtypes.ModuleName, + ccvconsumertypes.ModuleName, autopilottypes.ModuleName, consensusparamtypes.ModuleName, ) @@ -769,8 +817,8 @@ func NewStrideApp( govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName, - ibchost.ModuleName, genutiltypes.ModuleName, + ibchost.ModuleName, evidencetypes.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, @@ -785,6 +833,7 @@ func NewStrideApp( ratelimitmoduletypes.ModuleName, icacallbacksmoduletypes.ModuleName, claimtypes.ModuleName, + ccvconsumertypes.ModuleName, autopilottypes.ModuleName, consensusparamtypes.ModuleName, ) @@ -792,7 +841,7 @@ func NewStrideApp( app.mm.RegisterInvariants(app.CrisisKeeper) app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) app.mm.RegisterServices(app.configurator) - app.setupUpgradeHandlers() + app.setupUpgradeHandlers(appOpts) // create the simulation manager and define the order of the modules for deterministic simulations // app.sm = module.NewSimulationManager( @@ -827,13 +876,17 @@ func NewStrideApp( app.SetInitChainer(app.InitChainer) app.SetBeginBlocker(app.BeginBlocker) - anteHandler, err := ante.NewAnteHandler( - ante.HandlerOptions{ - AccountKeeper: app.AccountKeeper, - BankKeeper: app.BankKeeper, - SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), - FeegrantKeeper: app.FeeGrantKeeper, - SigGasConsumer: ante.DefaultSigVerificationGasConsumer, + anteHandler, err := NewAnteHandler( + HandlerOptions{ + HandlerOptions: ante.HandlerOptions{ + AccountKeeper: app.AccountKeeper, + BankKeeper: app.BankKeeper, + FeegrantKeeper: app.FeeGrantKeeper, + SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), + SigGasConsumer: ante.DefaultSigVerificationGasConsumer, + }, + IBCKeeper: app.IBCKeeper, + ConsumerKeeper: app.ConsumerKeeper, }, ) if err != nil { @@ -854,6 +907,7 @@ func NewStrideApp( // app.ScopedMonitoringKeeper = scopedMonitoringKeeper app.ScopedICAControllerKeeper = scopedICAControllerKeeper app.ScopedICAHostKeeper = scopedICAHostKeeper + app.ScopedCCVConsumerKeeper = scopedCCVConsumerKeeper return app } @@ -865,7 +919,7 @@ func (app *StrideApp) Name() string { return app.BaseApp.Name() } func (app *StrideApp) GetBaseApp() *baseapp.BaseApp { return app.BaseApp } // GetStakingKeeper implements the TestingApp interface. -func (app *StrideApp) GetStakingKeeper() ibctestingtypes.StakingKeeper { +func (app *StrideApp) GetStakingKeeper() core.StakingKeeper { return app.StakingKeeper } @@ -932,7 +986,7 @@ func (app *StrideApp) BlacklistedModuleAccountAddrs() map[string]bool { // DO NOT REMOVE: StringMapKeys fixes non-deterministic map iteration for _, acc := range utils.StringMapKeys(maccPerms) { // don't blacklist stakeibc module account, so that it can ibc transfer tokens - if acc == stakeibcmoduletypes.ModuleName || acc == stakeibcmoduletypes.RewardCollectorName { + if acc == stakeibcmoduletypes.ModuleName || acc == stakeibcmoduletypes.RewardCollectorName || acc == ccvconsumertypes.ConsumerToSendToProviderName { continue } modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true @@ -1052,6 +1106,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(recordsmoduletypes.ModuleName) paramsKeeper.Subspace(ratelimitmoduletypes.ModuleName) paramsKeeper.Subspace(icacallbacksmoduletypes.ModuleName) + paramsKeeper.Subspace(ccvconsumertypes.ModuleName) paramsKeeper.Subspace(autopilottypes.ModuleName) paramsKeeper.Subspace(claimtypes.ModuleName) @@ -1062,3 +1117,9 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino func (app *StrideApp) SimulationManager() *module.SimulationManager { return app.sm } + +// ConsumerApp interface implementations for e2e tests +// GetConsumerKeeper implements the ConsumerApp interface. +func (app *StrideApp) GetConsumerKeeper() ccvconsumerkeeper.Keeper { + return app.ConsumerKeeper +} diff --git a/app/apptesting/test_helpers.go b/app/apptesting/test_helpers.go index 02086fad52..3cd0bd8388 100644 --- a/app/apptesting/test_helpers.go +++ b/app/apptesting/test_helpers.go @@ -3,12 +3,16 @@ package apptesting import ( "strings" "testing" + "time" abci "github.com/cometbft/cometbft/abci/types" ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ccvprovidertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" + ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" "github.com/cometbft/cometbft/crypto/ed25519" - tmtypes "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypesproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/baseapp" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -17,18 +21,24 @@ import ( "github.com/cosmos/gogoproto/proto" icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + "github.com/cosmos/ibc-go/v7/testing/simapp" + appProvider "github.com/cosmos/interchain-security/v3/app/provider" + ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" + icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" + e2e "github.com/cosmos/interchain-security/v3/testutil/integration" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - "github.com/Stride-Labs/stride/v11/app" - "github.com/Stride-Labs/stride/v11/utils" + "github.com/Stride-Labs/stride/v12/app" + "github.com/Stride-Labs/stride/v12/utils" ) var ( - StrideChainID = "STRIDE" + StrideChainID = "STRIDE" + ProviderChainID = "PROVIDER" TestIcaVersion = string(icatypes.ModuleCdc.MustMarshalJSON(&icatypes.Metadata{ Version: icatypes.Version, @@ -47,14 +57,16 @@ type SuitelessAppTestHelper struct { type AppTestHelper struct { suite.Suite - App *app.StrideApp - HostApp *simapp.SimApp + App *app.StrideApp + HostApp *simapp.SimApp + ProviderApp e2e.ProviderApp - IbcEnabled bool - Coordinator *ibctesting.Coordinator - StrideChain *ibctesting.TestChain - HostChain *ibctesting.TestChain - TransferPath *ibctesting.Path + IbcEnabled bool + Coordinator *ibctesting.Coordinator + StrideChain *ibctesting.TestChain + HostChain *ibctesting.TestChain + ProviderChain *ibctesting.TestChain + TransferPath *ibctesting.Path QueryHelper *baseapp.QueryServiceTestHelper TestAccs []sdk.AccAddress @@ -65,7 +77,7 @@ type AppTestHelper struct { // AppTestHelper Constructor func (s *AppTestHelper) Setup() { s.App = app.InitStrideTestApp(true) - s.Ctx = s.App.BaseApp.NewContext(false, tmtypes.Header{Height: 1, ChainID: StrideChainID}) + s.Ctx = s.App.BaseApp.NewContext(false, tmtypesproto.Header{Height: 1, ChainID: StrideChainID}) s.QueryHelper = &baseapp.QueryServiceTestHelper{ GRPCQueryRouter: s.App.GRPCQueryRouter(), Ctx: s.Ctx, @@ -81,7 +93,7 @@ func (s *AppTestHelper) Setup() { func SetupSuitelessTestHelper() SuitelessAppTestHelper { s := SuitelessAppTestHelper{} s.App = app.InitStrideTestApp(true) - s.Ctx = s.App.BaseApp.NewContext(false, tmtypes.Header{Height: 1, ChainID: StrideChainID}) + s.Ctx = s.App.BaseApp.NewContext(false, tmtypesproto.Header{Height: 1, ChainID: StrideChainID}) return s } @@ -123,20 +135,68 @@ func CreateRandomAccounts(numAccts int) []sdk.AccAddress { func (s *AppTestHelper) SetupIBCChains(hostChainID string) { s.Coordinator = ibctesting.NewCoordinator(s.T(), 0) + // Initialize a provider testing app + s.ProviderChain = ibctesting.NewTestChain(s.T(), s.Coordinator, icstestingutils.ProviderAppIniter, ProviderChainID) + s.ProviderApp = s.ProviderChain.App.(*appProvider.App) + // Initialize a stride testing app by casting a StrideApp -> TestingApp - ibctesting.DefaultTestingAppInit = app.InitStrideIBCTestingApp - s.StrideChain = ibctesting.NewTestChain(s.T(), s.Coordinator, StrideChainID) + s.StrideChain = ibctesting.NewTestChainWithValSet(s.T(), s.Coordinator, app.InitStrideIBCTestingApp, StrideChainID, + s.ProviderChain.Vals, s.ProviderChain.Signers) // Initialize a host testing app using SimApp -> TestingApp - ibctesting.DefaultTestingAppInit = ibctesting.SetupTestingApp - s.HostChain = ibctesting.NewTestChain(s.T(), s.Coordinator, hostChainID) + s.HostChain = ibctesting.NewTestChain(s.T(), s.Coordinator, ibctesting.SetupTestingApp, hostChainID) // Update coordinator s.Coordinator.Chains = map[string]*ibctesting.TestChain{ - StrideChainID: s.StrideChain, - hostChainID: s.HostChain, + StrideChainID: s.StrideChain, + hostChainID: s.HostChain, + ProviderChainID: s.ProviderChain, } s.IbcEnabled = true + + // valsets must match + providerValUpdates := tmtypes.TM2PB.ValidatorUpdates(s.ProviderChain.Vals) + strideValUpdates := tmtypes.TM2PB.ValidatorUpdates(s.StrideChain.Vals) + s.Require().True(len(providerValUpdates) == len(strideValUpdates), "initial valset not matching") + + // for i := 0; i < len(providerValUpdates); i++ { + // addr1 := ccvutils.GetChangePubKeyAddress(providerValUpdates[i]) + // addr2 := ccvutils.GetChangePubKeyAddress(strideValUpdates[i]) + // s.Require().True(bytes.Equal(addr1, addr2), "validator mismatch") + // } + + // move chains to the next block + s.ProviderChain.NextBlock() + s.StrideChain.NextBlock() + s.HostChain.NextBlock() + + providerKeeper := s.ProviderApp.GetProviderKeeper() + // create consumer client on provider chain and set as consumer client for consumer chainID in provider keeper. + err := providerKeeper.CreateConsumerClient( + s.ProviderChain.GetContext(), + &ccvprovidertypes.ConsumerAdditionProposal{ + ChainId: s.StrideChain.ChainID, + InitialHeight: s.StrideChain.LastHeader.GetHeight().(clienttypes.Height), + BlocksPerDistributionTransmission: 50, + CcvTimeoutPeriod: time.Hour, + TransferTimeoutPeriod: time.Hour, + UnbondingPeriod: time.Hour * 504, + ConsumerRedistributionFraction: "0.75", + HistoricalEntries: 10000, + }, + ) + s.Require().NoError(err) + + // move provider to next block to commit the state + s.ProviderChain.NextBlock() + + // initialize the consumer chain with the genesis state stored on the provider + strideConsumerGenesis, found := providerKeeper.GetConsumerGenesis( + s.ProviderChain.GetContext(), + s.StrideChain.ChainID, + ) + s.Require().True(found, "consumer genesis not found") + s.StrideChain.App.(*app.StrideApp).GetConsumerKeeper().InitGenesis(s.StrideChain.GetContext(), &strideConsumerGenesis) } // Creates clients, connections, and a transfer channel between stride and a host chain @@ -149,22 +209,18 @@ func (s *AppTestHelper) CreateTransferChannel(hostChainID string) { "The testing app has already been initialized with a different chainID (%s)", s.HostChain.ChainID) // Create clients, connections, and a transfer channel - s.TransferPath = NewTransferPath(s.StrideChain, s.HostChain) + s.TransferPath = NewTransferPath(s.StrideChain, s.HostChain, s.ProviderChain) s.Coordinator.Setup(s.TransferPath) // Replace stride and host apps with those from TestingApp s.App = s.StrideChain.App.(*app.StrideApp) - s.HostApp = s.HostChain.GetSimApp() + // s.HostApp = s.HostChain.GetSimApp() s.Ctx = s.StrideChain.GetContext() // Finally confirm the channel was setup properly - s.Require().Equal(ibctesting.FirstClientID, s.TransferPath.EndpointA.ClientID, "stride clientID") + s.Require().Equal("07-tendermint-1", s.TransferPath.EndpointA.ClientID, "stride clientID") s.Require().Equal(ibctesting.FirstConnectionID, s.TransferPath.EndpointA.ConnectionID, "stride connectionID") s.Require().Equal(ibctesting.FirstChannelID, s.TransferPath.EndpointA.ChannelID, "stride transfer channelID") - - s.Require().Equal(ibctesting.FirstClientID, s.TransferPath.EndpointB.ClientID, "host clientID") - s.Require().Equal(ibctesting.FirstConnectionID, s.TransferPath.EndpointB.ConnectionID, "host connectionID") - s.Require().Equal(ibctesting.FirstChannelID, s.TransferPath.EndpointB.ChannelID, "host transfer channelID") } // Creates an ICA channel through ibctesting @@ -181,7 +237,7 @@ func (s *AppTestHelper) CreateICAChannel(owner string) string { } // Create ICA Path and then copy over the client and connection from the transfer path - icaPath := NewIcaPath(s.StrideChain, s.HostChain) + icaPath := NewIcaPath(s.StrideChain, s.HostChain, s.ProviderChain) icaPath = CopyConnectionAndClientToPath(icaPath, s.TransferPath) // Register the ICA and complete the handshake @@ -193,6 +249,9 @@ func (s *AppTestHelper) CreateICAChannel(owner string) string { err = icaPath.EndpointA.ChanOpenAck() s.Require().NoError(err, "ChanOpenAck error") + // err = s.App.ICAControllerKeeper.RegisterInterchainAccount(s.Ctx, icaPath.EndpointA.ConnectionID, owner, TestIcaVersion) + // s.Require().NoError(err, "register interchain account error") + err = icaPath.EndpointB.ChanOpenConfirm() s.Require().NoError(err, "ChanOpenConfirm error") @@ -237,7 +296,7 @@ func (s *AppTestHelper) RegisterInterchainAccount(endpoint *ibctesting.Endpoint, } // Creates a transfer channel between two chains -func NewTransferPath(chainA *ibctesting.TestChain, chainB *ibctesting.TestChain) *ibctesting.Path { +func NewTransferPath(chainA *ibctesting.TestChain, chainB *ibctesting.TestChain, providerChain *ibctesting.TestChain) *ibctesting.Path { path := ibctesting.NewPath(chainA, chainB) path.EndpointA.ChannelConfig.PortID = ibctesting.TransferPort path.EndpointB.ChannelConfig.PortID = ibctesting.TransferPort @@ -245,11 +304,17 @@ func NewTransferPath(chainA *ibctesting.TestChain, chainB *ibctesting.TestChain) path.EndpointB.ChannelConfig.Order = channeltypes.UNORDERED path.EndpointA.ChannelConfig.Version = transfertypes.Version path.EndpointB.ChannelConfig.Version = transfertypes.Version + + trustingPeriodFraction := providerChain.App.(*appProvider.App).GetProviderKeeper().GetTrustingPeriodFraction(providerChain.GetContext()) + consumerUnbondingPeriod := path.EndpointA.Chain.App.(*app.StrideApp).GetConsumerKeeper().GetUnbondingPeriod(path.EndpointA.Chain.GetContext()) + path.EndpointB.ClientConfig.(*ibctesting.TendermintConfig).UnbondingPeriod = consumerUnbondingPeriod + path.EndpointB.ClientConfig.(*ibctesting.TendermintConfig).TrustingPeriod, _ = ccvtypes.CalculateTrustPeriod(consumerUnbondingPeriod, trustingPeriodFraction) + return path } // Creates an ICA channel between two chains -func NewIcaPath(chainA *ibctesting.TestChain, chainB *ibctesting.TestChain) *ibctesting.Path { +func NewIcaPath(chainA *ibctesting.TestChain, chainB *ibctesting.TestChain, providerChain *ibctesting.TestChain) *ibctesting.Path { path := ibctesting.NewPath(chainA, chainB) path.EndpointA.ChannelConfig.PortID = icatypes.HostPortID path.EndpointB.ChannelConfig.PortID = icatypes.HostPortID @@ -257,6 +322,12 @@ func NewIcaPath(chainA *ibctesting.TestChain, chainB *ibctesting.TestChain) *ibc path.EndpointB.ChannelConfig.Order = channeltypes.ORDERED path.EndpointA.ChannelConfig.Version = TestIcaVersion path.EndpointB.ChannelConfig.Version = TestIcaVersion + + trustingPeriodFraction := providerChain.App.(*appProvider.App).GetProviderKeeper().GetTrustingPeriodFraction(providerChain.GetContext()) + consumerUnbondingPeriod := path.EndpointA.Chain.App.(*app.StrideApp).GetConsumerKeeper().GetUnbondingPeriod(path.EndpointA.Chain.GetContext()) + path.EndpointB.ClientConfig.(*ibctesting.TendermintConfig).UnbondingPeriod = consumerUnbondingPeriod + path.EndpointB.ClientConfig.(*ibctesting.TendermintConfig).TrustingPeriod, _ = ccvtypes.CalculateTrustPeriod(consumerUnbondingPeriod, trustingPeriodFraction) + return path } diff --git a/app/proposals_whitelisting.go b/app/proposals_whitelisting.go new file mode 100644 index 0000000000..aed3b0ed09 --- /dev/null +++ b/app/proposals_whitelisting.go @@ -0,0 +1,122 @@ +package app + +import ( + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + "github.com/cosmos/cosmos-sdk/x/params/types/proposal" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + + icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" + + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + ccvgov "github.com/cosmos/interchain-security/v3/x/ccv/democracy/governance" + + minttypes "github.com/Stride-Labs/stride/v12/x/mint/types" + stakeibctypes "github.com/Stride-Labs/stride/v12/x/stakeibc/types" +) + +var WhiteListModule = map[string]struct{}{ + "/cosmos.gov.v1.MsgUpdateParams": {}, + "/cosmos.bank.v1beta1.MsgUpdateParams": {}, + "/cosmos.staking.v1beta1.MsgUpdateParams": {}, + "/cosmos.distribution.v1beta1.MsgUpdateParams": {}, + "/cosmos.mint.v1beta1.MsgUpdateParams": {}, + "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade": {}, + "/cosmos.upgrade.v1beta1.MsgCancelUpgrade": {}, +} + +func IsModuleWhiteList(typeUrl string) bool { + _, found := WhiteListModule[typeUrl] + return found +} + +func IsProposalWhitelisted(content govv1beta1.Content) bool { + switch c := content.(type) { + case *proposal.ParameterChangeProposal: + return isParamChangeWhitelisted(getParamChangesMapFromArray(c.Changes)) + case *stakeibctypes.AddValidatorsProposal, + *upgradetypes.SoftwareUpgradeProposal, //nolint:staticcheck + *upgradetypes.CancelSoftwareUpgradeProposal: //nolint:staticcheck + return true + + default: + return false + } +} + +func getParamChangesMapFromArray(paramChanges []proposal.ParamChange) map[ccvgov.ParamChangeKey]struct{} { + res := map[ccvgov.ParamChangeKey]struct{}{} + for _, paramChange := range paramChanges { + key := ccvgov.ParamChangeKey{ + MsgType: paramChange.Subspace, + Key: paramChange.Key, + } + + res[key] = struct{}{} + } + + return res +} + +func isParamChangeWhitelisted(paramChanges map[ccvgov.ParamChangeKey]struct{}) bool { + for paramChangeKey := range paramChanges { + _, found := WhitelistedParams[paramChangeKey] + if !found { + return false + } + } + return true +} + +var WhitelistedParams = map[ccvgov.ParamChangeKey]struct{}{ + //bank + {MsgType: banktypes.ModuleName, Key: string(banktypes.KeySendEnabled)}: {}, + //governance + {MsgType: govtypes.ModuleName, Key: string(govv1.ParamStoreKeyDepositParams)}: {}, //min_deposit, max_deposit_period + {MsgType: govtypes.ModuleName, Key: string(govv1.ParamStoreKeyVotingParams)}: {}, //voting_period + {MsgType: govtypes.ModuleName, Key: string(govv1.ParamStoreKeyTallyParams)}: {}, //quorum,threshold,veto_threshold + //staking + {MsgType: stakingtypes.ModuleName, Key: string(stakingtypes.KeyUnbondingTime)}: {}, + {MsgType: stakingtypes.ModuleName, Key: string(stakingtypes.KeyMaxValidators)}: {}, + {MsgType: stakingtypes.ModuleName, Key: string(stakingtypes.KeyMaxEntries)}: {}, + {MsgType: stakingtypes.ModuleName, Key: string(stakingtypes.KeyHistoricalEntries)}: {}, + {MsgType: stakingtypes.ModuleName, Key: string(stakingtypes.KeyBondDenom)}: {}, + //distribution + {MsgType: distrtypes.ModuleName, Key: string(distrtypes.ParamStoreKeyCommunityTax)}: {}, + {MsgType: distrtypes.ModuleName, Key: string(distrtypes.ParamStoreKeyWithdrawAddrEnabled)}: {}, + //mint + {MsgType: minttypes.ModuleName, Key: string(minttypes.KeyMintDenom)}: {}, + {MsgType: minttypes.ModuleName, Key: string(minttypes.KeyGenesisEpochProvisions)}: {}, + {MsgType: minttypes.ModuleName, Key: string(minttypes.KeyEpochIdentifier)}: {}, + {MsgType: minttypes.ModuleName, Key: string(minttypes.KeyReductionPeriodInEpochs)}: {}, + {MsgType: minttypes.ModuleName, Key: string(minttypes.KeyReductionFactor)}: {}, + {MsgType: minttypes.ModuleName, Key: string(minttypes.KeyPoolAllocationRatio)}: {}, + {MsgType: minttypes.ModuleName, Key: string(minttypes.KeyMintingRewardsDistributionStartEpoch)}: {}, + //ibc transfer + {MsgType: ibctransfertypes.ModuleName, Key: string(ibctransfertypes.KeySendEnabled)}: {}, + {MsgType: ibctransfertypes.ModuleName, Key: string(ibctransfertypes.KeyReceiveEnabled)}: {}, + //ibc staking + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyDepositInterval)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyDelegateInterval)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyRewardsInterval)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyRedemptionRateInterval)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyStrideCommission)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyReinvestInterval)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyICATimeoutNanos)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyBufferSize)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyIbcTimeoutBlocks)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyFeeTransferTimeoutNanos)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyMaxStakeICACallsPerEpoch)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyDefaultMinRedemptionRateThreshold)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyDefaultMaxRedemptionRateThreshold)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeyIBCTransferTimeoutNanos)}: {}, + {MsgType: stakeibctypes.ModuleName, Key: string(stakeibctypes.KeySafetyNumValidators)}: {}, + //ica + {MsgType: icahosttypes.SubModuleName, Key: string(icahosttypes.KeyHostEnabled)}: {}, + {MsgType: icahosttypes.SubModuleName, Key: string(icahosttypes.KeyAllowMessages)}: {}, +} diff --git a/app/test_setup.go b/app/test_setup.go index e0f32b6c17..578f245938 100644 --- a/app/test_setup.go +++ b/app/test_setup.go @@ -18,9 +18,12 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - ibctesting "github.com/cosmos/ibc-go/v7/testing" + ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing" + consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" - cmdcfg "github.com/Stride-Labs/stride/v11/cmd/strided/config" + testutil "github.com/Stride-Labs/stride/v12/testutil" + + cmdcfg "github.com/Stride-Labs/stride/v12/cmd/strided/config" ) const Bech32Prefix = "stride" @@ -97,6 +100,7 @@ func GenesisStateWithValSet(app *StrideApp) GenesisState { delegations := make([]stakingtypes.Delegation, 0, len(valSet.Validators)) bondAmt := sdk.DefaultPowerReduction + initValPowers := []abci.ValidatorUpdate{} for _, val := range valSet.Validators { pk, _ := cryptocodec.FromTmPubKeyInterface(val.PubKey) @@ -117,6 +121,12 @@ func GenesisStateWithValSet(app *StrideApp) GenesisState { validators = append(validators, validator) delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec())) + // add initial validator powers so consumer InitGenesis runs correctly + pub, _ := val.ToProto() + initValPowers = append(initValPowers, abci.ValidatorUpdate{ + Power: val.VotingPower, + PubKey: pub.PubKey, + }) } // set validators and delegations stakingGenesis := stakingtypes.NewGenesisState(stakingtypes.DefaultParams(), validators, delegations) @@ -148,6 +158,18 @@ func GenesisStateWithValSet(app *StrideApp) GenesisState { []banktypes.SendEnabled{}, ) genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis) + + vals, err := tmtypes.PB2TM.ValidatorUpdates(initValPowers) + if err != nil { + panic("failed to get vals") + } + + consumerGenesisState := testutil.CreateMinimalConsumerTestGenesis() + consumerGenesisState.InitialValSet = initValPowers + consumerGenesisState.ProviderConsensusState.NextValidatorsHash = tmtypes.NewValidatorSet(vals).Hash() + consumerGenesisState.Params.Enabled = true + genesisState[consumertypes.ModuleName] = app.AppCodec().MustMarshalJSON(consumerGenesisState) + return genesisState } diff --git a/app/upgrades.go b/app/upgrades.go index 1df0752f2e..d1a29f5da0 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -3,6 +3,7 @@ package app import ( "fmt" + servertypes "github.com/cosmos/cosmos-sdk/server/types" storetypes "github.com/cosmos/cosmos-sdk/store/types" consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" @@ -10,27 +11,30 @@ import ( authz "github.com/cosmos/cosmos-sdk/x/authz" + consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - v10 "github.com/Stride-Labs/stride/v11/app/upgrades/v10" - v11 "github.com/Stride-Labs/stride/v11/app/upgrades/v11" - v2 "github.com/Stride-Labs/stride/v11/app/upgrades/v2" - v3 "github.com/Stride-Labs/stride/v11/app/upgrades/v3" - v4 "github.com/Stride-Labs/stride/v11/app/upgrades/v4" - v5 "github.com/Stride-Labs/stride/v11/app/upgrades/v5" - v6 "github.com/Stride-Labs/stride/v11/app/upgrades/v6" - v7 "github.com/Stride-Labs/stride/v11/app/upgrades/v7" - v8 "github.com/Stride-Labs/stride/v11/app/upgrades/v8" - v9 "github.com/Stride-Labs/stride/v11/app/upgrades/v9" - autopilottypes "github.com/Stride-Labs/stride/v11/x/autopilot/types" - claimtypes "github.com/Stride-Labs/stride/v11/x/claim/types" - icacallbacktypes "github.com/Stride-Labs/stride/v11/x/icacallbacks/types" - ratelimittypes "github.com/Stride-Labs/stride/v11/x/ratelimit/types" - recordtypes "github.com/Stride-Labs/stride/v11/x/records/types" - stakeibctypes "github.com/Stride-Labs/stride/v11/x/stakeibc/types" + v10 "github.com/Stride-Labs/stride/v12/app/upgrades/v10" + v11 "github.com/Stride-Labs/stride/v12/app/upgrades/v11" + v12 "github.com/Stride-Labs/stride/v12/app/upgrades/v12" + v2 "github.com/Stride-Labs/stride/v12/app/upgrades/v2" + v3 "github.com/Stride-Labs/stride/v12/app/upgrades/v3" + v4 "github.com/Stride-Labs/stride/v12/app/upgrades/v4" + v5 "github.com/Stride-Labs/stride/v12/app/upgrades/v5" + v6 "github.com/Stride-Labs/stride/v12/app/upgrades/v6" + v7 "github.com/Stride-Labs/stride/v12/app/upgrades/v7" + v8 "github.com/Stride-Labs/stride/v12/app/upgrades/v8" + v9 "github.com/Stride-Labs/stride/v12/app/upgrades/v9" + autopilottypes "github.com/Stride-Labs/stride/v12/x/autopilot/types" + claimtypes "github.com/Stride-Labs/stride/v12/x/claim/types" + icacallbacktypes "github.com/Stride-Labs/stride/v12/x/icacallbacks/types" + ratelimittypes "github.com/Stride-Labs/stride/v12/x/ratelimit/types" + recordtypes "github.com/Stride-Labs/stride/v12/x/records/types" + stakeibctypes "github.com/Stride-Labs/stride/v12/x/stakeibc/types" ) -func (app *StrideApp) setupUpgradeHandlers() { +func (app *StrideApp) setupUpgradeHandlers(appOpts servertypes.AppOptions) { // v2 upgrade handler app.UpgradeKeeper.SetUpgradeHandler( v2.UpgradeName, @@ -143,6 +147,20 @@ func (app *StrideApp) setupUpgradeHandlers() { ), ) + // v12 upgrade handler + app.UpgradeKeeper.SetUpgradeHandler( + v12.UpgradeName, + v12.CreateUpgradeHandler( + app.mm, + app.configurator, + app.appCodec, + appOpts, + *app.IBCKeeper, + &app.ConsumerKeeper, + app.StakingKeeper, + ), + ) + upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() if err != nil { panic(fmt.Errorf("Failed to read upgrade info from disk: %w", err)) @@ -171,6 +189,10 @@ func (app *StrideApp) setupUpgradeHandlers() { storeUpgrades = &storetypes.StoreUpgrades{ Added: []string{crisistypes.StoreKey, consensustypes.StoreKey}, } + case "v12": + storeUpgrades = &storetypes.StoreUpgrades{ + Added: []string{consumertypes.ModuleName}, + } } if storeUpgrades != nil { diff --git a/app/upgrades/README.md b/app/upgrades/README.md index 80ef9ab18a..9045834492 100644 --- a/app/upgrades/README.md +++ b/app/upgrades/README.md @@ -83,7 +83,7 @@ package {upgradeVersion} import ( sdk "github.com/cosmos/cosmos-sdk/types" - {new-consensus-version} "github.com/Stride-Labs/stride/v11/x/records/migrations/{new-consensus-version}" + {new-consensus-version} "github.com/Stride-Labs/stride/v12/x/records/migrations/{new-consensus-version}" ) // TODO: Add migration logic to deserialize with old protos and re-serialize with new ones @@ -98,7 +98,7 @@ func MigrateStore(ctx sdk.Context) error { // app/upgrades/{upgradeVersion}/upgrades.go import ( - {module}migration "github.com/Stride-Labs/stride/v11/x/{module}/migrations/{new-consensus-version}" + {module}migration "github.com/Stride-Labs/stride/v12/x/{module}/migrations/{new-consensus-version}" ) // CreateUpgradeHandler creates an SDK upgrade handler for {upgradeVersion} diff --git a/app/upgrades/v10/upgrades.go b/app/upgrades/v10/upgrades.go index 5e916e7289..e763e8871a 100644 --- a/app/upgrades/v10/upgrades.go +++ b/app/upgrades/v10/upgrades.go @@ -25,18 +25,18 @@ import ( "github.com/cosmos/ibc-go/v7/modules/core/exported" ibctmmigrations "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/migrations" - claimkeeper "github.com/Stride-Labs/stride/v11/x/claim/keeper" - claimtypes "github.com/Stride-Labs/stride/v11/x/claim/types" - icacallbackskeeper "github.com/Stride-Labs/stride/v11/x/icacallbacks/keeper" - mintkeeper "github.com/Stride-Labs/stride/v11/x/mint/keeper" - minttypes "github.com/Stride-Labs/stride/v11/x/mint/types" - ratelimitkeeper "github.com/Stride-Labs/stride/v11/x/ratelimit/keeper" - ratelimitgov "github.com/Stride-Labs/stride/v11/x/ratelimit/keeper/gov" - ratelimittypes "github.com/Stride-Labs/stride/v11/x/ratelimit/types" - recordskeeper "github.com/Stride-Labs/stride/v11/x/records/keeper" - recordstypes "github.com/Stride-Labs/stride/v11/x/records/types" - stakeibckeeper "github.com/Stride-Labs/stride/v11/x/stakeibc/keeper" - stakeibctypes "github.com/Stride-Labs/stride/v11/x/stakeibc/types" + claimkeeper "github.com/Stride-Labs/stride/v12/x/claim/keeper" + claimtypes "github.com/Stride-Labs/stride/v12/x/claim/types" + icacallbackskeeper "github.com/Stride-Labs/stride/v12/x/icacallbacks/keeper" + mintkeeper "github.com/Stride-Labs/stride/v12/x/mint/keeper" + minttypes "github.com/Stride-Labs/stride/v12/x/mint/types" + ratelimitkeeper "github.com/Stride-Labs/stride/v12/x/ratelimit/keeper" + ratelimitgov "github.com/Stride-Labs/stride/v12/x/ratelimit/keeper/gov" + ratelimittypes "github.com/Stride-Labs/stride/v12/x/ratelimit/types" + recordskeeper "github.com/Stride-Labs/stride/v12/x/records/keeper" + recordstypes "github.com/Stride-Labs/stride/v12/x/records/types" + stakeibckeeper "github.com/Stride-Labs/stride/v12/x/stakeibc/keeper" + stakeibctypes "github.com/Stride-Labs/stride/v12/x/stakeibc/types" cosmosproto "github.com/cosmos/gogoproto/proto" deprecatedproto "github.com/golang/protobuf/proto" //nolint:staticcheck @@ -117,6 +117,7 @@ func CreateUpgradeHandler( stakeibcKeeper stakeibckeeper.Keeper, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx.Logger().Info("Starting upgrade v10...") ctx.Logger().Info("Migrating tendermint consensus params from x/params to x/consensus...") diff --git a/app/upgrades/v10/upgrades_test.go b/app/upgrades/v10/upgrades_test.go index 3d49785346..6d5ed27e57 100644 --- a/app/upgrades/v10/upgrades_test.go +++ b/app/upgrades/v10/upgrades_test.go @@ -16,22 +16,22 @@ import ( transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" - "github.com/Stride-Labs/stride/v11/app/apptesting" - v10 "github.com/Stride-Labs/stride/v11/app/upgrades/v10" - "github.com/Stride-Labs/stride/v11/utils" - - icacallbackstypes "github.com/Stride-Labs/stride/v11/x/icacallbacks/types" - ratelimittypes "github.com/Stride-Labs/stride/v11/x/ratelimit/types" - recordskeeper "github.com/Stride-Labs/stride/v11/x/records/keeper" - recordstypes "github.com/Stride-Labs/stride/v11/x/records/types" - stakeibckeeper "github.com/Stride-Labs/stride/v11/x/stakeibc/keeper" - "github.com/Stride-Labs/stride/v11/x/stakeibc/types" - stakeibctypes "github.com/Stride-Labs/stride/v11/x/stakeibc/types" + "github.com/Stride-Labs/stride/v12/app/apptesting" + v10 "github.com/Stride-Labs/stride/v12/app/upgrades/v10" + "github.com/Stride-Labs/stride/v12/utils" + + icacallbackstypes "github.com/Stride-Labs/stride/v12/x/icacallbacks/types" + ratelimittypes "github.com/Stride-Labs/stride/v12/x/ratelimit/types" + recordskeeper "github.com/Stride-Labs/stride/v12/x/records/keeper" + recordstypes "github.com/Stride-Labs/stride/v12/x/records/types" + stakeibckeeper "github.com/Stride-Labs/stride/v12/x/stakeibc/keeper" + "github.com/Stride-Labs/stride/v12/x/stakeibc/types" + stakeibctypes "github.com/Stride-Labs/stride/v12/x/stakeibc/types" cosmosproto "github.com/cosmos/gogoproto/proto" deprecatedproto "github.com/golang/protobuf/proto" //nolint:staticcheck - claimtypes "github.com/Stride-Labs/stride/v11/x/claim/types" + claimtypes "github.com/Stride-Labs/stride/v12/x/claim/types" ) var initialRateLimitChannelValue = sdk.NewInt(1_000_000) diff --git a/app/upgrades/v12/README.md b/app/upgrades/v12/README.md new file mode 100644 index 0000000000..49390ce41b --- /dev/null +++ b/app/upgrades/v12/README.md @@ -0,0 +1,2 @@ +# Upgrade v12 Changelog +1. Changeover to consumer chain ([#811](https://github.com/Stride-Labs/stride/pull/811)) \ No newline at end of file diff --git a/app/upgrades/v12/upgrades.go b/app/upgrades/v12/upgrades.go new file mode 100644 index 0000000000..b2ad891102 --- /dev/null +++ b/app/upgrades/v12/upgrades.go @@ -0,0 +1,63 @@ +package v12 + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/codec" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + ibcconnectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" + ccvconsumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" + consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" + "github.com/spf13/cast" +) + +var ( + UpgradeName = "v12" +) + +// CreateUpgradeHandler creates an SDK upgrade handler for v12 +func CreateUpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + cdc codec.Codec, + appOpts servertypes.AppOptions, + ibcKeeper ibckeeper.Keeper, + consumerKeeper *ccvconsumerkeeper.Keeper, + stakingKeeper stakingkeeper.Keeper, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + ctx.Logger().Info("Starting upgrade v12...") + ibcKeeper.ConnectionKeeper.SetParams(ctx, ibcconnectiontypes.DefaultParams()) + + fromVM := make(map[string]uint64) + + // for moduleName, eachModule := range app.MM.Modules { + // fromVM[moduleName] = eachModule.ConsensusVersion() + // } + + nodeHome := cast.ToString(appOpts.Get(flags.FlagHome)) + consumerUpgradeGenFile := nodeHome + "/config/ccv.json" + appState, _, err := genutiltypes.GenesisStateFromGenFile(consumerUpgradeGenFile) + if err != nil { + return fromVM, fmt.Errorf("failed to unmarshal genesis state: %w", err) + } + + var consumerGenesis = consumertypes.GenesisState{} + cdc.MustUnmarshalJSON(appState[consumertypes.ModuleName], &consumerGenesis) + + consumerGenesis.PreCCV = true + consumerGenesis.Params.SoftOptOutThreshold = "0.05" + consumerGenesis.Params.RewardDenoms = []string{"ustrd"} + consumerKeeper.InitGenesis(ctx, &consumerGenesis) + consumerKeeper.SetDistributionTransmissionChannel(ctx, "channel-0") + + return fromVM, nil + } +} diff --git a/app/upgrades/v3/upgrades.go b/app/upgrades/v3/upgrades.go index 763b494620..ef4b882111 100644 --- a/app/upgrades/v3/upgrades.go +++ b/app/upgrades/v3/upgrades.go @@ -7,9 +7,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - claimkeeper "github.com/Stride-Labs/stride/v11/x/claim/keeper" - "github.com/Stride-Labs/stride/v11/x/claim/types" - claimtypes "github.com/Stride-Labs/stride/v11/x/claim/types" + claimkeeper "github.com/Stride-Labs/stride/v12/x/claim/keeper" + "github.com/Stride-Labs/stride/v12/x/claim/types" + claimtypes "github.com/Stride-Labs/stride/v12/x/claim/types" ) // Note: ensure these values are properly set before running upgrade diff --git a/app/upgrades/v3/upgrades_test.go b/app/upgrades/v3/upgrades_test.go index ea2066eb95..e1a75bf500 100644 --- a/app/upgrades/v3/upgrades_test.go +++ b/app/upgrades/v3/upgrades_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/suite" - "github.com/Stride-Labs/stride/v11/app/apptesting" + "github.com/Stride-Labs/stride/v12/app/apptesting" ) var ( diff --git a/app/upgrades/v4/upgrades_test.go b/app/upgrades/v4/upgrades_test.go index 5335cfc9f8..0f3b958d3a 100644 --- a/app/upgrades/v4/upgrades_test.go +++ b/app/upgrades/v4/upgrades_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/suite" - "github.com/Stride-Labs/stride/v11/app/apptesting" + "github.com/Stride-Labs/stride/v12/app/apptesting" ) const dummyUpgradeHeight = 5 diff --git a/app/upgrades/v5/upgrades.go b/app/upgrades/v5/upgrades.go index 6b007de711..08e788cd8b 100644 --- a/app/upgrades/v5/upgrades.go +++ b/app/upgrades/v5/upgrades.go @@ -12,16 +12,16 @@ import ( authz "github.com/cosmos/cosmos-sdk/x/authz" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - claimmigration "github.com/Stride-Labs/stride/v11/x/claim/migrations/v2" - claimtypes "github.com/Stride-Labs/stride/v11/x/claim/types" - icacallbacksmigration "github.com/Stride-Labs/stride/v11/x/icacallbacks/migrations/v2" - icacallbacktypes "github.com/Stride-Labs/stride/v11/x/icacallbacks/types" - interchainquerykeeper "github.com/Stride-Labs/stride/v11/x/interchainquery/keeper" - recordsmigration "github.com/Stride-Labs/stride/v11/x/records/migrations/v2" - recordtypes "github.com/Stride-Labs/stride/v11/x/records/types" - stakeibckeeper "github.com/Stride-Labs/stride/v11/x/stakeibc/keeper" - stakeibcmigration "github.com/Stride-Labs/stride/v11/x/stakeibc/migrations/v2" - stakeibctypes "github.com/Stride-Labs/stride/v11/x/stakeibc/types" + claimmigration "github.com/Stride-Labs/stride/v12/x/claim/migrations/v2" + claimtypes "github.com/Stride-Labs/stride/v12/x/claim/types" + icacallbacksmigration "github.com/Stride-Labs/stride/v12/x/icacallbacks/migrations/v2" + icacallbacktypes "github.com/Stride-Labs/stride/v12/x/icacallbacks/types" + interchainquerykeeper "github.com/Stride-Labs/stride/v12/x/interchainquery/keeper" + recordsmigration "github.com/Stride-Labs/stride/v12/x/records/migrations/v2" + recordtypes "github.com/Stride-Labs/stride/v12/x/records/types" + stakeibckeeper "github.com/Stride-Labs/stride/v12/x/stakeibc/keeper" + stakeibcmigration "github.com/Stride-Labs/stride/v12/x/stakeibc/migrations/v2" + stakeibctypes "github.com/Stride-Labs/stride/v12/x/stakeibc/types" ) // Note: ensure these values are properly set before running upgrade diff --git a/app/upgrades/v5/upgrades_test.go b/app/upgrades/v5/upgrades_test.go index 884ced5ab2..bb92cce1b8 100644 --- a/app/upgrades/v5/upgrades_test.go +++ b/app/upgrades/v5/upgrades_test.go @@ -11,20 +11,20 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "github.com/Stride-Labs/stride/v11/app" - - "github.com/Stride-Labs/stride/v11/app/apptesting" - upgradev5 "github.com/Stride-Labs/stride/v11/app/upgrades/v5" - oldclaimtypes "github.com/Stride-Labs/stride/v11/x/claim/migrations/v2/types" - claimtypes "github.com/Stride-Labs/stride/v11/x/claim/types" - icacallbacktypes "github.com/Stride-Labs/stride/v11/x/icacallbacks/types" - icqtypes "github.com/Stride-Labs/stride/v11/x/interchainquery/types" - recordkeeper "github.com/Stride-Labs/stride/v11/x/records/keeper" - oldrecordtypes "github.com/Stride-Labs/stride/v11/x/records/migrations/v2/types" - recordtypes "github.com/Stride-Labs/stride/v11/x/records/types" - stakeibckeeper "github.com/Stride-Labs/stride/v11/x/stakeibc/keeper" - oldstakeibctypes "github.com/Stride-Labs/stride/v11/x/stakeibc/migrations/v2/types" - stakeibctypes "github.com/Stride-Labs/stride/v11/x/stakeibc/types" + "github.com/Stride-Labs/stride/v12/app" + + "github.com/Stride-Labs/stride/v12/app/apptesting" + upgradev5 "github.com/Stride-Labs/stride/v12/app/upgrades/v5" + oldclaimtypes "github.com/Stride-Labs/stride/v12/x/claim/migrations/v2/types" + claimtypes "github.com/Stride-Labs/stride/v12/x/claim/types" + icacallbacktypes "github.com/Stride-Labs/stride/v12/x/icacallbacks/types" + icqtypes "github.com/Stride-Labs/stride/v12/x/interchainquery/types" + recordkeeper "github.com/Stride-Labs/stride/v12/x/records/keeper" + oldrecordtypes "github.com/Stride-Labs/stride/v12/x/records/migrations/v2/types" + recordtypes "github.com/Stride-Labs/stride/v12/x/records/types" + stakeibckeeper "github.com/Stride-Labs/stride/v12/x/stakeibc/keeper" + oldstakeibctypes "github.com/Stride-Labs/stride/v12/x/stakeibc/migrations/v2/types" + stakeibctypes "github.com/Stride-Labs/stride/v12/x/stakeibc/types" ) const dummyUpgradeHeight = 5 diff --git a/app/upgrades/v6/upgrades.go b/app/upgrades/v6/upgrades.go index 356f68b1c7..c79f05374d 100644 --- a/app/upgrades/v6/upgrades.go +++ b/app/upgrades/v6/upgrades.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - claimkeeper "github.com/Stride-Labs/stride/v11/x/claim/keeper" + claimkeeper "github.com/Stride-Labs/stride/v12/x/claim/keeper" ) // Note: ensure these values are properly set before running upgrade diff --git a/app/upgrades/v6/upgrades_test.go b/app/upgrades/v6/upgrades_test.go index 64a2cb7296..6a1f6f0ca3 100644 --- a/app/upgrades/v6/upgrades_test.go +++ b/app/upgrades/v6/upgrades_test.go @@ -10,11 +10,11 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "github.com/Stride-Labs/stride/v11/app" + "github.com/Stride-Labs/stride/v12/app" - "github.com/Stride-Labs/stride/v11/app/apptesting" - "github.com/Stride-Labs/stride/v11/x/claim/types" - claimtypes "github.com/Stride-Labs/stride/v11/x/claim/types" + "github.com/Stride-Labs/stride/v12/app/apptesting" + "github.com/Stride-Labs/stride/v12/x/claim/types" + claimtypes "github.com/Stride-Labs/stride/v12/x/claim/types" ) const dummyUpgradeHeight = 5 diff --git a/app/upgrades/v7/upgrades.go b/app/upgrades/v7/upgrades.go index 8723c23fba..1f3fa76858 100644 --- a/app/upgrades/v7/upgrades.go +++ b/app/upgrades/v7/upgrades.go @@ -21,13 +21,13 @@ import ( icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - "github.com/Stride-Labs/stride/v11/utils" - epochskeeper "github.com/Stride-Labs/stride/v11/x/epochs/keeper" - epochstypes "github.com/Stride-Labs/stride/v11/x/epochs/types" - mintkeeper "github.com/Stride-Labs/stride/v11/x/mint/keeper" - minttypes "github.com/Stride-Labs/stride/v11/x/mint/types" - stakeibckeeper "github.com/Stride-Labs/stride/v11/x/stakeibc/keeper" - stakeibctypes "github.com/Stride-Labs/stride/v11/x/stakeibc/types" + "github.com/Stride-Labs/stride/v12/utils" + epochskeeper "github.com/Stride-Labs/stride/v12/x/epochs/keeper" + epochstypes "github.com/Stride-Labs/stride/v12/x/epochs/types" + mintkeeper "github.com/Stride-Labs/stride/v12/x/mint/keeper" + minttypes "github.com/Stride-Labs/stride/v12/x/mint/types" + stakeibckeeper "github.com/Stride-Labs/stride/v12/x/stakeibc/keeper" + stakeibctypes "github.com/Stride-Labs/stride/v12/x/stakeibc/types" ) // CreateUpgradeHandler creates an SDK upgrade handler for v7 diff --git a/app/upgrades/v7/upgrades_test.go b/app/upgrades/v7/upgrades_test.go index b84bf78337..0041d962da 100644 --- a/app/upgrades/v7/upgrades_test.go +++ b/app/upgrades/v7/upgrades_test.go @@ -9,16 +9,16 @@ import ( "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/Stride-Labs/stride/v11/app" - "github.com/Stride-Labs/stride/v11/app/apptesting" - v7 "github.com/Stride-Labs/stride/v11/app/upgrades/v7" - epochstypes "github.com/Stride-Labs/stride/v11/x/epochs/types" - stakeibctypes "github.com/Stride-Labs/stride/v11/x/stakeibc/types" + "github.com/Stride-Labs/stride/v12/app" + "github.com/Stride-Labs/stride/v12/app/apptesting" + v7 "github.com/Stride-Labs/stride/v12/app/upgrades/v7" + epochstypes "github.com/Stride-Labs/stride/v12/x/epochs/types" + stakeibctypes "github.com/Stride-Labs/stride/v12/x/stakeibc/types" // This isn't the exact type host zone schema as the one that's will be in the store // before the upgrade, but the only thing that matters, for the sake of the test, // is that it doesn't have min/max redemption rate as attributes - oldstakeibctypes "github.com/Stride-Labs/stride/v11/x/stakeibc/migrations/v2/types" + oldstakeibctypes "github.com/Stride-Labs/stride/v12/x/stakeibc/migrations/v2/types" ) var ( diff --git a/app/upgrades/v8/upgrades.go b/app/upgrades/v8/upgrades.go index e98081f28f..60687f55ee 100644 --- a/app/upgrades/v8/upgrades.go +++ b/app/upgrades/v8/upgrades.go @@ -12,12 +12,12 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/Stride-Labs/stride/v11/utils" - autopilotkeeper "github.com/Stride-Labs/stride/v11/x/autopilot/keeper" - autopilottypes "github.com/Stride-Labs/stride/v11/x/autopilot/types" - claimkeeper "github.com/Stride-Labs/stride/v11/x/claim/keeper" - "github.com/Stride-Labs/stride/v11/x/claim/types" - claimtypes "github.com/Stride-Labs/stride/v11/x/claim/types" + "github.com/Stride-Labs/stride/v12/utils" + autopilotkeeper "github.com/Stride-Labs/stride/v12/x/autopilot/keeper" + autopilottypes "github.com/Stride-Labs/stride/v12/x/autopilot/types" + claimkeeper "github.com/Stride-Labs/stride/v12/x/claim/keeper" + "github.com/Stride-Labs/stride/v12/x/claim/types" + claimtypes "github.com/Stride-Labs/stride/v12/x/claim/types" ) var ( diff --git a/app/upgrades/v8/upgrades_test.go b/app/upgrades/v8/upgrades_test.go index 00f333e93c..a6a9df00f9 100644 --- a/app/upgrades/v8/upgrades_test.go +++ b/app/upgrades/v8/upgrades_test.go @@ -9,11 +9,11 @@ import ( sdkmath "cosmossdk.io/math" "github.com/stretchr/testify/suite" - "github.com/Stride-Labs/stride/v11/app/apptesting" - v8 "github.com/Stride-Labs/stride/v11/app/upgrades/v8" - autopilottypes "github.com/Stride-Labs/stride/v11/x/autopilot/types" - "github.com/Stride-Labs/stride/v11/x/claim/types" - claimtypes "github.com/Stride-Labs/stride/v11/x/claim/types" + "github.com/Stride-Labs/stride/v12/app/apptesting" + v8 "github.com/Stride-Labs/stride/v12/app/upgrades/v8" + autopilottypes "github.com/Stride-Labs/stride/v12/x/autopilot/types" + "github.com/Stride-Labs/stride/v12/x/claim/types" + claimtypes "github.com/Stride-Labs/stride/v12/x/claim/types" ) var ( diff --git a/app/upgrades/v9/upgrades.go b/app/upgrades/v9/upgrades.go index 2afb22c375..e42ccf7a4a 100644 --- a/app/upgrades/v9/upgrades.go +++ b/app/upgrades/v9/upgrades.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - claimkeeper "github.com/Stride-Labs/stride/v11/x/claim/keeper" + claimkeeper "github.com/Stride-Labs/stride/v12/x/claim/keeper" ) // CreateUpgradeHandler creates an SDK upgrade handler for v29 diff --git a/app/upgrades/v9/upgrades_test.go b/app/upgrades/v9/upgrades_test.go index 1b2e6a455b..f7926e9f02 100644 --- a/app/upgrades/v9/upgrades_test.go +++ b/app/upgrades/v9/upgrades_test.go @@ -6,18 +6,18 @@ import ( "github.com/stretchr/testify/suite" - "github.com/Stride-Labs/stride/v11/app" - "github.com/Stride-Labs/stride/v11/app/apptesting" - v9 "github.com/Stride-Labs/stride/v11/app/upgrades/v9" - "github.com/Stride-Labs/stride/v11/utils" + "github.com/Stride-Labs/stride/v12/app" + "github.com/Stride-Labs/stride/v12/app/apptesting" + v9 "github.com/Stride-Labs/stride/v12/app/upgrades/v9" + "github.com/Stride-Labs/stride/v12/utils" - claimtypes "github.com/Stride-Labs/stride/v11/x/claim/types" + claimtypes "github.com/Stride-Labs/stride/v12/x/claim/types" // This isn't the exact type host zone schema as the one that's will be in the store // before the upgrade, but the only thing that matters, for the sake of the test, // is that it doesn't have min/max redemption rate as attributes - "github.com/Stride-Labs/stride/v11/x/claim/migrations/v2/types" - oldclaimtypes "github.com/Stride-Labs/stride/v11/x/claim/migrations/v2/types" + "github.com/Stride-Labs/stride/v12/x/claim/migrations/v2/types" + oldclaimtypes "github.com/Stride-Labs/stride/v12/x/claim/migrations/v2/types" ) type UpgradeTestSuite struct { diff --git a/cmd/consumer.go b/cmd/consumer.go new file mode 100644 index 0000000000..4dbf7327a6 --- /dev/null +++ b/cmd/consumer.go @@ -0,0 +1,143 @@ +package cmd + +import ( + "encoding/json" + "fmt" + + errorsmod "cosmossdk.io/errors" + types1 "github.com/cometbft/cometbft/abci/types" + pvm "github.com/cometbft/cometbft/privval" + tmtypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/server" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + ccvconsumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" + "github.com/spf13/cobra" + + "github.com/Stride-Labs/stride/v12/testutil" +) + +func AddConsumerSectionCmd(defaultNodeHome string) *cobra.Command { + genesisMutator := NewDefaultGenesisIO() + + txCmd := &cobra.Command{ + Use: "add-consumer-section", + Short: "ONLY FOR TESTING PURPOSES! Modifies genesis so that chain can be started locally with one node.", + SuggestionsMinimumDistance: 2, + RunE: func(cmd *cobra.Command, args []string) error { + return genesisMutator.AlterConsumerModuleState(cmd, func(state *GenesisData, _ map[string]json.RawMessage) error { + genesisState := testutil.CreateMinimalConsumerTestGenesis() + clientCtx := client.GetClientContextFromCmd(cmd) + serverCtx := server.GetServerContextFromCmd(cmd) + config := serverCtx.Config + config.SetRoot(clientCtx.HomeDir) + privValidator := pvm.LoadFilePV(config.PrivValidatorKeyFile(), config.PrivValidatorStateFile()) + pk, err := privValidator.GetPubKey() + if err != nil { + return err + } + sdkPublicKey, err := cryptocodec.FromTmPubKeyInterface(pk) + if err != nil { + return err + } + tmProtoPublicKey, err := cryptocodec.ToTmProtoPublicKey(sdkPublicKey) + if err != nil { + return err + } + + initialValset := []types1.ValidatorUpdate{{PubKey: tmProtoPublicKey, Power: 100}} + vals, err := tmtypes.PB2TM.ValidatorUpdates(initialValset) + if err != nil { + return errorsmod.Wrap(err, "could not convert val updates to validator set") + } + + genesisState.InitialValSet = initialValset + genesisState.ProviderConsensusState.NextValidatorsHash = tmtypes.NewValidatorSet(vals).Hash() + + state.ConsumerModuleState = genesisState + + return nil + }) + }, + } + + txCmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") + flags.AddQueryFlagsToCmd(txCmd) + + return txCmd +} + +type GenesisMutator interface { + AlterConsumerModuleState(cmd *cobra.Command, callback func(state *GenesisData, appState map[string]json.RawMessage) error) error +} + +type DefaultGenesisIO struct { + DefaultGenesisReader +} + +func NewDefaultGenesisIO() *DefaultGenesisIO { + return &DefaultGenesisIO{DefaultGenesisReader: DefaultGenesisReader{}} +} + +func (x DefaultGenesisIO) AlterConsumerModuleState(cmd *cobra.Command, callback func(state *GenesisData, appState map[string]json.RawMessage) error) error { + g, err := x.ReadGenesis(cmd) + if err != nil { + return err + } + if err := callback(g, g.AppState); err != nil { + return err + } + if err := g.ConsumerModuleState.Validate(); err != nil { + return err + } + clientCtx := client.GetClientContextFromCmd(cmd) + consumerGenStateBz, err := clientCtx.Codec.MarshalJSON(g.ConsumerModuleState) + if err != nil { + return errorsmod.Wrap(err, "marshal consumer genesis state") + } + + g.AppState[ccvconsumertypes.ModuleName] = consumerGenStateBz + appStateJSON, err := json.Marshal(g.AppState) + if err != nil { + return errorsmod.Wrap(err, "marshal application genesis state") + } + + g.GenDoc.AppState = appStateJSON + return genutil.ExportGenesisFile(g.GenDoc, g.GenesisFile) +} + +type DefaultGenesisReader struct{} + +func (d DefaultGenesisReader) ReadGenesis(cmd *cobra.Command) (*GenesisData, error) { + clientCtx := client.GetClientContextFromCmd(cmd) + serverCtx := server.GetServerContextFromCmd(cmd) + config := serverCtx.Config + config.SetRoot(clientCtx.HomeDir) + + genFile := config.GenesisFile() + appState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFile) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal genesis state: %w", err) + } + + return NewGenesisData( + genFile, + genDoc, + appState, + nil, + ), nil +} + +type GenesisData struct { + GenesisFile string + GenDoc *tmtypes.GenesisDoc + AppState map[string]json.RawMessage + ConsumerModuleState *ccvconsumertypes.GenesisState +} + +func NewGenesisData(genesisFile string, genDoc *tmtypes.GenesisDoc, appState map[string]json.RawMessage, consumerModuleState *ccvconsumertypes.GenesisState) *GenesisData { + return &GenesisData{GenesisFile: genesisFile, GenDoc: genDoc, AppState: appState, ConsumerModuleState: consumerModuleState} +} diff --git a/cmd/strided/main.go b/cmd/strided/main.go index 75dea77b49..467ee38288 100644 --- a/cmd/strided/main.go +++ b/cmd/strided/main.go @@ -5,9 +5,10 @@ import ( svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/Stride-Labs/stride/v11/app" + "github.com/Stride-Labs/stride/v12/app" + "github.com/Stride-Labs/stride/v12/cmd" - cmdcfg "github.com/Stride-Labs/stride/v11/cmd/strided/config" + cmdcfg "github.com/Stride-Labs/stride/v12/cmd/strided/config" ) func main() { @@ -15,6 +16,8 @@ func main() { cmdcfg.RegisterDenoms() rootCmd, _ := NewRootCmd() + rootCmd.AddCommand(cmd.AddConsumerSectionCmd(app.DefaultNodeHome)) + if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { os.Exit(1) } diff --git a/cmd/strided/root.go b/cmd/strided/root.go index 217f56ef04..5baa171483 100644 --- a/cmd/strided/root.go +++ b/cmd/strided/root.go @@ -12,7 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/snapshots" "gopkg.in/yaml.v2" - "github.com/Stride-Labs/stride/v11/utils" + "github.com/Stride-Labs/stride/v12/utils" cometbftdb "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/cli" @@ -47,7 +47,7 @@ import ( genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/Stride-Labs/stride/v11/app" + "github.com/Stride-Labs/stride/v12/app" ) var ChainID string @@ -159,7 +159,7 @@ func initAppConfig() (string, interface{}) { srvCfg.GRPCWeb.EnableUnsafeCORS = true // This ensures that upgraded nodes will use iavl fast node. - srvCfg.IAVLDisableFastNode = false + //srvCfg.IAVLDisableFastNode = false customAppConfig := CustomAppConfig{ Config: *srvCfg, diff --git a/consumer/start_consumer.sh b/consumer/start_consumer.sh index 7f5a11b42f..d585a689e9 100644 --- a/consumer/start_consumer.sh +++ b/consumer/start_consumer.sh @@ -285,7 +285,7 @@ sleep 5 # ###########################UPGRADE TO SOVEREIGN CHAIN########################## -$SOVEREIGN_BINARY tx gov submit-legacy-proposal software-upgrade "v07-Theta" \ +$SOVEREIGN_BINARY tx gov submit-legacy-proposal software-upgrade "v12" \ --upgrade-height=36 \ --upgrade-info="file:///Users/admin/Documents/j121/stride/interchain-security/upgrade-info.json?checksum=sha256:8f204d72e0bbd1a193aee002cf78d17b90e73fdd404403df226e5f3d6a6cba17" \ --title="upgrade to consumer chain" --description="upgrade to consumer chain description" \ diff --git a/consumer/start_consumer_rly.sh b/consumer/start_consumer_rly.sh new file mode 100644 index 0000000000..15bb8b7236 --- /dev/null +++ b/consumer/start_consumer_rly.sh @@ -0,0 +1,323 @@ +#!/bin/bash +set -eux + +SOVEREIGN_HOME="$HOME/.sovereign" +CONSUMER_HOME="$HOME/.consumer" +CONSUMER_HOME1="$HOME/.consumer1" +PROVIDER_CHAIN_ID="provider" +CONSUMER_CHAIN_ID="consumer" +MONIKER="consumer" +VALIDATOR="validator" +VALIDATOR1="validator1" +KEYRING="--keyring-backend test" +TX_FLAGS="--gas-adjustment 100 --gas auto" +PROVIDER_BINARY="gaiad" +SOVEREIGN_BINARY="strided-sd" +CONSUMER_BINARY="strided-icdd" +NODE_IP="localhost" +PROVIDER_RPC_LADDR="$NODE_IP:26658" +PROVIDER_GRPC_ADDR="$NODE_IP:9091" +PROVIDER_RPC_LADDR1="$NODE_IP:26668" +PROVIDER_GRPC_ADDR1="$NODE_IP:9101" +SOVEREIGN_RPC_LADDR="$NODE_IP:26648" +SOVEREIGN_GRPC_ADDR="$NODE_IP:9081" +CONSUMER_RPC_LADDR="$NODE_IP:26638" +CONSUMER_GRPC_ADDR="$NODE_IP:9071" +CONSUMER_RPC_LADDR1="$NODE_IP:26628" +CONSUMER_GRPC_ADDR1="$NODE_IP:9061" +CONSUMER_USER="consumer" +SOVEREIGN_VALIDATOR="sovereign_validator" +PROVIDER_VALIDATOR="provider_validator" +PROVIDER_HOME="$HOME/.provider" +PROVIDER_HOME1="$HOME/.provider1" +PROVIDER_NODE_ADDRESS="tcp://localhost:26658" +PROVIDER_DELEGATOR=delegator + + +# Clean start +killall $SOVEREIGN_BINARY &> /dev/null || true +killall $CONSUMER_BINARY &> /dev/null || true +rm -rf $CONSUMER_HOME +rm -rf $CONSUMER_HOME1 +rm -rf $SOVEREIGN_HOME + +################SOVEREIGN############################ +$SOVEREIGN_BINARY init --chain-id $CONSUMER_CHAIN_ID $MONIKER --home $SOVEREIGN_HOME +sleep 1 + +# Build genesis file and node directory structure +$SOVEREIGN_BINARY init --chain-id $CONSUMER_CHAIN_ID $MONIKER --home $CONSUMER_HOME +sleep 1 + + +# Create user account keypair +$SOVEREIGN_BINARY keys add $CONSUMER_USER $KEYRING --home $SOVEREIGN_HOME --output json > $SOVEREIGN_HOME/consumer_keypair.json 2>&1 +$SOVEREIGN_BINARY keys add $SOVEREIGN_VALIDATOR $KEYRING --home $SOVEREIGN_HOME --output json > $SOVEREIGN_HOME/sovereign_validator_keypair.json 2>&1 +$SOVEREIGN_BINARY keys add $PROVIDER_VALIDATOR $KEYRING --home $CONSUMER_HOME --output json > $CONSUMER_HOME/consumer_validator_keypair.json 2>&1 + +# Add account in genesis (required by Hermes) +$SOVEREIGN_BINARY add-genesis-account $(jq -r .address $SOVEREIGN_HOME/consumer_keypair.json) 1000000000stake --home $SOVEREIGN_HOME +$SOVEREIGN_BINARY add-genesis-account $(jq -r .address $SOVEREIGN_HOME/sovereign_validator_keypair.json) 1000000000000stake --home $SOVEREIGN_HOME +$SOVEREIGN_BINARY add-genesis-account $(jq -r .address $CONSUMER_HOME/consumer_validator_keypair.json) 1000000000000stake --home $SOVEREIGN_HOME + +# generate genesis for sovereign chain +$SOVEREIGN_BINARY gentx $SOVEREIGN_VALIDATOR 11000000000stake $KEYRING --chain-id=$CONSUMER_CHAIN_ID --home $SOVEREIGN_HOME + +################CONSUMER############################ + +# Copy validator key files +cp $PROVIDER_HOME/config/priv_validator_key.json $CONSUMER_HOME/config/priv_validator_key.json +cp $PROVIDER_HOME/config/node_key.json $CONSUMER_HOME/config/node_key.json + +$SOVEREIGN_BINARY add-genesis-account $(jq -r .address $CONSUMER_HOME/consumer_validator_keypair.json) 1000000000000stake --home $CONSUMER_HOME +$SOVEREIGN_BINARY gentx $PROVIDER_VALIDATOR 12000000000stake $KEYRING --chain-id=$CONSUMER_CHAIN_ID --home $CONSUMER_HOME + +cp $CONSUMER_HOME/config/gentx/* $SOVEREIGN_HOME/config/gentx + +#copy genesis +$SOVEREIGN_BINARY collect-gentxs --home $SOVEREIGN_HOME +sed -i '' 's/"voting_period": "172800s"/"voting_period": "20s"/g' $SOVEREIGN_HOME/config/genesis.json + +cp $SOVEREIGN_HOME/config/genesis.json $CONSUMER_HOME/config/genesis.json + +#######CHAIN2####### +$SOVEREIGN_BINARY init --chain-id $CONSUMER_CHAIN_ID $MONIKER --home $CONSUMER_HOME1 +sleep 1 +#copy genesis +cp $SOVEREIGN_HOME/config/genesis.json $CONSUMER_HOME1/config/genesis.json + +# Copy validator key files +cp $PROVIDER_HOME1/config/priv_validator_key.json $CONSUMER_HOME1/config/priv_validator_key.json +cp $PROVIDER_HOME1/config/node_key.json $CONSUMER_HOME1/config/node_key.json + +##########SET CONFIG.TOML##################### +# Set default client port +sed -i -r "/node =/ s/= .*/= \"tcp:\/\/${SOVEREIGN_RPC_LADDR}\"/" $SOVEREIGN_HOME/config/client.toml +sed -i -r "/node =/ s/= .*/= \"tcp:\/\/${CONSUMER_RPC_LADDR}\"/" $CONSUMER_HOME/config/client.toml +sed -i -r "/node =/ s/= .*/= \"tcp:\/\/${CONSUMER_RPC_LADDR1}\"/" $CONSUMER_HOME1/config/client.toml +sovereign=$($SOVEREIGN_BINARY tendermint show-node-id --home $SOVEREIGN_HOME) +node=$($SOVEREIGN_BINARY tendermint show-node-id --home $CONSUMER_HOME) +node1=$($SOVEREIGN_BINARY tendermint show-node-id --home $CONSUMER_HOME1) + +# sed -i -r "/persistent_peers =/ s/= .*/= \"$node@localhost:26636,$node1@localhost:26626\"/" "$SOVEREIGN_HOME"/config/config.toml +# sed -i -r "/persistent_peers =/ s/= .*/= \"$sovereign@localhost:26646,$node1@localhost:26626\"/" "$CONSUMER_HOME"/config/config.toml +# sed -i -r "/persistent_peers =/ s/= .*/= \"$sovereign@localhost:26646,$node@localhost:26636\"/" "$CONSUMER_HOME1"/config/config.toml + +sed -i -r "/persistent_peers =/ s/= .*/= \"$node@localhost:26636\"/" "$SOVEREIGN_HOME"/config/config.toml +sed -i -r "/pprof_laddr =/ s/= .*/= \"localhost:6061\"/" "$SOVEREIGN_HOME"/config/config.toml +sed -i -r "/persistent_peers =/ s/= .*/= \"$sovereign@localhost:26646\"/" "$CONSUMER_HOME"/config/config.toml +sed -i -r "/pprof_laddr =/ s/= .*/= \"localhost:6062\"/" "$CONSUMER_HOME"/config/config.toml + +sed -i -r "126s/.*/address = \"tcp:\/\/0.0.0.0:1318\"/" "$CONSUMER_HOME"/config/app.toml +sed -i -r "126s/.*/address = \"tcp:\/\/0.0.0.0:1319\"/" "$CONSUMER_HOME1"/config/app.toml + +# Start the chain +$SOVEREIGN_BINARY start \ + --home $SOVEREIGN_HOME \ + --rpc.laddr tcp://${SOVEREIGN_RPC_LADDR} \ + --grpc.address ${SOVEREIGN_GRPC_ADDR} \ + --address tcp://${NODE_IP}:26645 \ + --p2p.laddr tcp://${NODE_IP}:26646 \ + --grpc-web.enable=false \ + --pruning=nothing \ + --log_level debug \ + --trace \ + &> $SOVEREIGN_HOME/logs & + +$SOVEREIGN_BINARY start \ + --home $CONSUMER_HOME \ + --rpc.laddr tcp://${CONSUMER_RPC_LADDR} \ + --grpc.address ${CONSUMER_GRPC_ADDR} \ + --address tcp://${NODE_IP}:26635 \ + --p2p.laddr tcp://${NODE_IP}:26636 \ + --grpc-web.enable=false \ + --pruning=nothing \ + --log_level debug \ + --trace \ + &> $CONSUMER_HOME/logs & + +# $SOVEREIGN_BINARY start \ +# --home $CONSUMER_HOME1 \ +# --rpc.laddr tcp://${CONSUMER_RPC_LADDR1} \ +# --grpc.address ${CONSUMER_GRPC_ADDR1} \ +# --address tcp://${NODE_IP}:26625 \ +# --p2p.laddr tcp://${NODE_IP}:26626 \ +# --grpc-web.enable=false \ +# --log_level debug \ +# --trace \ +# &> $CONSUMER_HOME1/logs & +sleep 10 + + +########## GO RELAYER ######## +RELAYER_DIR="./relayer" +MNEMONIC_1="trip ten ability cabbage artefact side brass field domain doll ritual easily" +MNEMONIC_2="guard lion kiss upper comic vital small bundle salon oxygen museum material enter idea high domain lend alert dish message federal egg upper coffee" + +# # send tokens to relayers +$PROVIDER_BINARY tx bank send $PROVIDER_DELEGATOR cosmos1d35ujw5e509acpmfxf9tw859e4nkhq8qfs725a 1000000stake --chain-id=$PROVIDER_CHAIN_ID --keyring-backend=test -y --broadcast-mode=sync --node=http://$PROVIDER_RPC_LADDR --home=$PROVIDER_HOME +sleep 5 +$SOVEREIGN_BINARY tx bank send $SOVEREIGN_VALIDATOR stride1qwhddffw7ljzmgn9cxcd76t40aq0e65p5fwafv 1000000stake --keyring-backend=test --chain-id=$CONSUMER_CHAIN_ID -y --broadcast-mode=sync --node=http://$SOVEREIGN_RPC_LADDR --home=$SOVEREIGN_HOME +sleep 5 + +# PROVIDER_CHAIN_ID="provider" +# CONSUMER_CHAIN_ID="consumer" + +killall rly 2> /dev/null || true + +# echo "Restoring accounts..." +rly keys restore provider rly1 "$MNEMONIC_1" --home $RELAYER_DIR & +rly keys restore consumer rly2 "$MNEMONIC_2" --home $RELAYER_DIR & + +sleep 3 + +rly transact link consumer-provider --home $RELAYER_DIR +sleep 2 +rly start --home $RELAYER_DIR &> $RELAYER_DIR/logs & + +# Build consumer chain proposal file - unbonding period 21 days +tee $PROVIDER_HOME/consumer-proposal.json< /dev/null || true + +# Add ccv section to SOVEREIGN_HOME genesis to be used on upgrade handler +if ! $PROVIDER_BINARY q provider consumer-genesis "$CONSUMER_CHAIN_ID" --node "$PROVIDER_NODE_ADDRESS" --output json > "$SOVEREIGN_HOME"/consumer_section.json; +then + echo "Failed to get consumer genesis for the chain-id '$CONSUMER_CHAIN_ID'! Finalize genesis failed. For more details please check the log file in output directory." + exit 1 +fi + +jq -s '.[0].app_state.ccvconsumer = .[1] | .[0]' "$SOVEREIGN_HOME"/config/genesis.json "$SOVEREIGN_HOME"/consumer_section.json > "$SOVEREIGN_HOME"/genesis_consumer.json && \ + mv "$SOVEREIGN_HOME"/genesis_consumer.json "$SOVEREIGN_HOME"/config/consumer-genesis.json + +# Modify genesis params +jq ".app_state.ccvconsumer.params.blocks_per_distribution_transmission = \"70\" | .app_state.tokenfactory.paused = { \"paused\": false }" \ + $SOVEREIGN_HOME/config/consumer-genesis.json > \ + $SOVEREIGN_HOME/edited_genesis.json && mv $SOVEREIGN_HOME/edited_genesis.json $SOVEREIGN_HOME/config/consumer-genesis.json +sleep 1 + +cp $SOVEREIGN_HOME/config/consumer-genesis.json $CONSUMER_HOME/config/consumer-genesis.json + +$CONSUMER_BINARY start \ + --home $SOVEREIGN_HOME \ + --rpc.laddr tcp://${SOVEREIGN_RPC_LADDR} \ + --grpc.address ${SOVEREIGN_GRPC_ADDR} \ + --address tcp://${NODE_IP}:26645 \ + --p2p.laddr tcp://${NODE_IP}:26646 \ + --grpc-web.enable=false \ + --log_level debug \ + --trace \ + &> $SOVEREIGN_HOME/logs & + +$CONSUMER_BINARY start \ + --home $CONSUMER_HOME \ + --rpc.laddr tcp://${CONSUMER_RPC_LADDR} \ + --grpc.address ${CONSUMER_GRPC_ADDR} \ + --address tcp://${NODE_IP}:26635 \ + --p2p.laddr tcp://${NODE_IP}:26636 \ + --grpc-web.enable=false \ + --log_level debug \ + --trace \ + &> $CONSUMER_HOME/logs & + +# $CONSUMER_BINARY start \ +# --home $CONSUMER_HOME1 \ +# --rpc.laddr tcp://${CONSUMER_RPC_LADDR1} \ +# --grpc.address ${CONSUMER_GRPC_ADDR1} \ +# --address tcp://${NODE_IP}:26625 \ +# --p2p.laddr tcp://${NODE_IP}:26626 \ +# --grpc-web.enable=false \ +# --log_level debug \ +# --trace \ +# &> $CONSUMER_HOME1/logs & +sleep 30 + +rly transact connection consumer-provider-ics --home $RELAYER_DIR +rly transact channel consumer-provider-ics --src-port consumer --dst-port provider --order ordered --version 1 --home $RELAYER_DIR + +# ############################################################ + +PROVIDER_VALIDATOR_ADDRESS=$(jq -r .address $PROVIDER_HOME/keypair.json) +DELEGATIONS=$($PROVIDER_BINARY q staking delegations $PROVIDER_VALIDATOR_ADDRESS --home $PROVIDER_HOME --node tcp://${PROVIDER_RPC_LADDR} -o json) +OPERATOR_ADDR=$(echo $DELEGATIONS | jq -r .delegation_responses[0].delegation.validator_address) + +$PROVIDER_BINARY tx staking delegate $OPERATOR_ADDR 32000000stake \ + --from $VALIDATOR \ + $KEYRING \ + --home $PROVIDER_HOME \ + --node tcp://${PROVIDER_RPC_LADDR} \ + --chain-id $PROVIDER_CHAIN_ID -y -b block +sleep 1 + +$PROVIDER_BINARY status --node=tcp://${PROVIDER_RPC_LADDR} +# $PROVIDER_BINARY status --node=tcp://${PROVIDER_RPC_LADDR1} + +$CONSUMER_BINARY status --node tcp://$SOVEREIGN_RPC_LADDR +$CONSUMER_BINARY status --node tcp://$CONSUMER_RPC_LADDR + +# $CONSUMER_BINARY query staking params --node=tcp://$CONSUMER_RPC_LADDR +# $PROVIDER_BINARY query staking params --node=tcp://${PROVIDER_RPC_LADDR} \ No newline at end of file diff --git a/deps/evmos b/deps/evmos deleted file mode 160000 index ec337e0357..0000000000 --- a/deps/evmos +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ec337e0357ae6b6727ad9092ac0ce3667df91319 diff --git a/deps/hermes b/deps/hermes index fd92eb6d17..6583d69703 160000 --- a/deps/hermes +++ b/deps/hermes @@ -1 +1 @@ -Subproject commit fd92eb6d17342bc83003f2067d6a9cd8261f2884 +Subproject commit 6583d697034764dc463c3949fc1f732d63e9f193 diff --git a/deps/juno b/deps/juno index e57bc002ac..9558920413 160000 --- a/deps/juno +++ b/deps/juno @@ -1 +1 @@ -Subproject commit e57bc002ac3d27457e304985a4cd8445a2580172 +Subproject commit 955892041359443fbb5addd34c0ab8b66bd8d75c diff --git a/deps/relayer b/deps/relayer index e95dd80608..01039ea63d 160000 --- a/deps/relayer +++ b/deps/relayer @@ -1 +1 @@ -Subproject commit e95dd80608536c31d37354bdd7f7ec46a2172009 +Subproject commit 01039ea63d8e6fdd188ea47fc168a0b57e5fa660 diff --git a/deps/stargaze b/deps/stargaze index 0746ec779e..b0bea28fc6 160000 --- a/deps/stargaze +++ b/deps/stargaze @@ -1 +1 @@ -Subproject commit 0746ec779e327f7a17300cfe6063cebc77a43ca4 +Subproject commit b0bea28fc695a2a5c567e56a37b289a5b75830cc diff --git a/dockernet/config.sh b/dockernet/config.sh index 3d102a40c6..6e74fd96a8 100755 --- a/dockernet/config.sh +++ b/dockernet/config.sh @@ -103,7 +103,7 @@ HOST_DAY_EPOCH_DURATION="60s" HOST_HOUR_EPOCH_DURATION="60s" HOST_WEEK_EPOCH_DURATION="60s" HOST_MINT_EPOCH_DURATION="60s" -UNBONDING_TIME="120s" +UNBONDING_TIME="240s" MAX_DEPOSIT_PERIOD="30s" VOTING_PERIOD="30s" INITIAL_ANNUAL_PROVISIONS="10000000000000.000000000000000000" @@ -235,6 +235,7 @@ EVMOS_MICRO_DENOM_UNITS="000000000000000000000000" # RELAYER RELAYER_GAIA_EXEC="$DOCKER_COMPOSE run --rm relayer-gaia" +RELAYER_GAIA_ICS_EXEC="$DOCKER_COMPOSE run --rm relayer-gaia-ics" RELAYER_JUNO_EXEC="$DOCKER_COMPOSE run --rm relayer-juno" RELAYER_OSMO_EXEC="$DOCKER_COMPOSE run --rm relayer-osmo" RELAYER_STARS_EXEC="$DOCKER_COMPOSE run --rm relayer-stars" @@ -248,6 +249,8 @@ RELAYER_OSMO_ACCT=rly4 RELAYER_STARS_ACCT=rly5 RELAYER_HOST_ACCT=rly6 RELAYER_EVMOS_ACCT=rly7 +RELAYER_STRIDE_ICS_ACCT=rly11 +RELAYER_GAIA_ICS_ACCT=rly12 RELAYER_ACCTS=( $RELAYER_GAIA_ACCT $RELAYER_JUNO_ACCT @@ -255,6 +258,7 @@ RELAYER_ACCTS=( $RELAYER_STARS_ACCT $RELAYER_HOST_ACCT $RELAYER_EVMOS_ACCT + $RELAYER_GAIA_ICS_ACCT ) RELAYER_GAIA_MNEMONIC="fiction perfect rapid steel bundle giant blade grain eagle wing cannon fever must humble dance kitchen lazy episode museum faith off notable rate flavor" @@ -262,6 +266,7 @@ RELAYER_JUNO_MNEMONIC="kiwi betray topple van vapor flag decorate cement crystal RELAYER_OSMO_MNEMONIC="unaware wine ramp february bring trust leaf beyond fever inside option dilemma save know captain endless salute radio humble chicken property culture foil taxi" RELAYER_STARS_MNEMONIC="deposit dawn erosion talent old broom flip recipe pill hammer animal hill nice ten target metal gas shoe visual nephew soda harbor child simple" RELAYER_HOST_MNEMONIC="renew umbrella teach spoon have razor knee sock divert inner nut between immense library inhale dog truly return run remain dune virus diamond clinic" +RELAYER_GAIA_ICS_MNEMONIC="size chimney clog job robot thunder gaze vapor economy smooth kit denial alter merit produce front force eager outside mansion believe fan tonight detect" RELAYER_EVMOS_MNEMONIC="science depart where tell bus ski laptop follow child bronze rebel recall brief plug razor ship degree labor human series today embody fury harvest" RELAYER_MNEMONICS=( "$RELAYER_GAIA_MNEMONIC" @@ -270,6 +275,7 @@ RELAYER_MNEMONICS=( "$RELAYER_STARS_MNEMONIC" "$RELAYER_HOST_MNEMONIC" "$RELAYER_EVMOS_MNEMONIC" + "$RELAYER_GAIA_ICS_MNEMONIC" ) STRIDE_ADDRESS() { diff --git a/dockernet/config/hermes_config.toml b/dockernet/config/hermes_config.toml index 53bc2dc694..426cf02947 100644 --- a/dockernet/config/hermes_config.toml +++ b/dockernet/config/hermes_config.toml @@ -32,7 +32,7 @@ grpc_addr = 'http://stride1:9090' websocket_addr = 'ws://stride1:26657/websocket' rpc_timeout = '10s' account_prefix = 'stride' -key_name = 'hrly1' +key_name = 'rly1' store_prefix = 'ibc' default_gas = 100000 max_gas = 5000000 @@ -53,7 +53,7 @@ grpc_addr = 'http://gaia1:9090' websocket_addr = 'ws://gaia1:26657/websocket' rpc_timeout = '10s' account_prefix = 'cosmos' -key_name = 'hrly2' +key_name = 'rly2' store_prefix = 'ibc' default_gas = 100000 max_gas = 3000000 @@ -74,7 +74,7 @@ grpc_addr = 'http://juno1:9090' websocket_addr = 'ws://juno1:26657/websocket' rpc_timeout = '10s' account_prefix = 'juno' -key_name = 'hrly3' +key_name = 'rly3' store_prefix = 'ibc' default_gas = 100000 max_gas = 3000000 @@ -95,7 +95,7 @@ grpc_addr = 'http://osmo1:9090' websocket_addr = 'ws://osmo1:26657/websocket' rpc_timeout = '10s' account_prefix = 'osmo' -key_name = 'hrly4' +key_name = 'rly4' store_prefix = 'ibc' default_gas = 100000 max_gas = 3000000 @@ -116,7 +116,7 @@ grpc_addr = 'http://stars1:9090' websocket_addr = 'ws://stars1:26657/websocket' rpc_timeout = '10s' account_prefix = 'stars' -key_name = 'hrly5' +key_name = 'rly5' store_prefix = 'ibc' default_gas = 100000 max_gas = 3000000 diff --git a/dockernet/config/relayer_config.yaml b/dockernet/config/relayer_config.yaml index f88bc2176e..92580f6151 100644 --- a/dockernet/config/relayer_config.yaml +++ b/dockernet/config/relayer_config.yaml @@ -136,6 +136,16 @@ paths: src-channel-filter: rule: "" channel-list: [] + stride-gaia-ics: + src: + chain-id: STRIDE + client-id: 07-tendermint-1 + dst: + chain-id: GAIA + client-id: 07-tendermint-1 + src-channel-filter: + rule: "" + channel-list: [] stride-osmo: src: chain-id: STRIDE diff --git a/dockernet/config/relayer_config_ics.yaml b/dockernet/config/relayer_config_ics.yaml new file mode 100644 index 0000000000..039a57bbaf --- /dev/null +++ b/dockernet/config/relayer_config_ics.yaml @@ -0,0 +1,47 @@ +global: + api-listen-addr: :5183 + timeout: 10s + memo: "" + light-cache-size: 20 +chains: + stride: + type: cosmos + value: + key: rly11 + chain-id: STRIDE + rpc-addr: http://stride1:26657 + account-prefix: stride + keyring-backend: test + gas-adjustment: 1.3 + gas-prices: 0.02ustrd + debug: false + timeout: 20s + output-format: json + sign-mode: direct + gaia: + type: cosmos + value: + key: rly12 + chain-id: GAIA + rpc-addr: http://gaia1:26657 + account-prefix: cosmos + keyring-backend: test + gas-adjustment: 1.3 + gas-prices: 0.02uatom + debug: false + timeout: 20s + output-format: json + sign-mode: direct + + +paths: + stride-gaia-ics: + src: + chain-id: STRIDE + client-id: 07-tendermint-1 + dst: + chain-id: GAIA + client-id: 07-tendermint-1 + src-channel-filter: + rule: "" + channel-list: [] diff --git a/dockernet/docker-compose.yml b/dockernet/docker-compose.yml index c933bad5f5..e15620032a 100644 --- a/dockernet/docker-compose.yml +++ b/dockernet/docker-compose.yml @@ -216,6 +216,13 @@ services: restart: always command: [ "bash", "start.sh", "stride-gaia" ] + relayer-gaia-ics: + image: stridezone:relayer + volumes: + - ./state/relayer-gaia-ics:/home/relayer/.relayer + restart: always + command: [ "bash", "start.sh", "stride-gaia-ics" ] + relayer-juno: image: stridezone:relayer volumes: diff --git a/dockernet/dockerfiles/Dockerfile.hermes b/dockernet/dockerfiles/Dockerfile.hermes index 40696d4137..6e5d60c012 100644 --- a/dockernet/dockerfiles/Dockerfile.hermes +++ b/dockernet/dockerfiles/Dockerfile.hermes @@ -1,10 +1,10 @@ -FROM rust:1.63-buster as builder +FROM rust:1.65-buster as builder WORKDIR /opt RUN apt update && apt install git -y -ENV COMMIT_HASH=fd92eb6d17342bc83003f2067d6a9cd8261f2884 +ENV COMMIT_HASH=v1.5.1 RUN git clone https://github.com/informalsystems/ibc-rs \ && cd ibc-rs \ && git checkout $COMMIT_HASH \ diff --git a/dockernet/src/init_chain.sh b/dockernet/src/init_chain.sh index d4ea1ff972..a79f942540 100644 --- a/dockernet/src/init_chain.sh +++ b/dockernet/src/init_chain.sh @@ -36,8 +36,11 @@ set_stride_genesis() { jq '(.app_state.epochs.epochs[] | select(.identifier=="stride_epoch") ).duration = $epochLen' --arg epochLen $STRIDE_EPOCH_EPOCH_DURATION $genesis_config > json.tmp && mv json.tmp $genesis_config jq '(.app_state.epochs.epochs[] | select(.identifier=="mint") ).duration = $epochLen' --arg epochLen $STRIDE_MINT_EPOCH_DURATION $genesis_config > json.tmp && mv json.tmp $genesis_config jq '.app_state.staking.params.unbonding_time = $newVal' --arg newVal "$UNBONDING_TIME" $genesis_config > json.tmp && mv json.tmp $genesis_config + jq '.app_state.gov.deposit_params.max_deposit_period = $newVal' --arg newVal "$MAX_DEPOSIT_PERIOD" $genesis_config > json.tmp && mv json.tmp $genesis_config + jq '.app_state.gov.voting_params.voting_period = $newVal' --arg newVal "$VOTING_PERIOD" $genesis_config > json.tmp && mv json.tmp $genesis_config jq '.app_state.gov.params.max_deposit_period = $newVal' --arg newVal "$MAX_DEPOSIT_PERIOD" $genesis_config > json.tmp && mv json.tmp $genesis_config jq '.app_state.gov.params.voting_period = $newVal' --arg newVal "$VOTING_PERIOD" $genesis_config > json.tmp && mv json.tmp $genesis_config + jq '.app_state.ccvconsumer.params.unbonding_period = $newVal' --arg newVal "$UNBONDING_TIME" $genesis_config > json.tmp && mv json.tmp $genesis_config # enable stride as an interchain accounts controller jq "del(.app_state.interchain_accounts)" $genesis_config > json.tmp && mv json.tmp $genesis_config @@ -54,6 +57,7 @@ set_host_genesis() { jq '(.app_state.epochs.epochs[]? | select(.identifier=="week") ).duration = $epochLen' --arg epochLen $HOST_WEEK_EPOCH_DURATION $genesis_config > json.tmp && mv json.tmp $genesis_config jq '(.app_state.epochs.epochs[]? | select(.identifier=="mint") ).duration = $epochLen' --arg epochLen $HOST_MINT_EPOCH_DURATION $genesis_config > json.tmp && mv json.tmp $genesis_config jq '.app_state.staking.params.unbonding_time = $newVal' --arg newVal "$UNBONDING_TIME" $genesis_config > json.tmp && mv json.tmp $genesis_config + jq '.app_state.gov.voting_params.voting_period = $newVal' --arg newVal "$VOTING_PERIOD" $genesis_config > json.tmp && mv json.tmp $genesis_config # Set the mint start time to the genesis time if the chain configures inflation at the block level (e.g. stars) # also reduce the number of initial annual provisions so the inflation rate is not too high @@ -124,10 +128,6 @@ for (( i=1; i <= $NUM_NODES; i++ )); do sed -i -E "s|\"stake\"|\"${DENOM}\"|g" $genesis_json sed -i -E "s|\"aphoton\"|\"${DENOM}\"|g" $genesis_json # ethermint default - # Get the endpoint and node ID - node_id=$($cmd tendermint show-node-id)@$node_name:$PEER_PORT - echo "Node #$i ID: $node_id" - # add a validator account val_acct="${VAL_PREFIX}${i}" val_mnemonic="${VAL_MNEMONICS[((i-1))]}" @@ -135,8 +135,20 @@ for (( i=1; i <= $NUM_NODES; i++ )); do val_addr=$($cmd keys show $val_acct --keyring-backend test -a | tr -cd '[:alnum:]._-') # Add this account to the current node $cmd add-genesis-account ${val_addr} ${VAL_TOKENS}${DENOM} - # actually set this account as a validator on the current node - $cmd gentx $val_acct ${STAKE_TOKENS}${DENOM} --chain-id $CHAIN_ID --keyring-backend test &> /dev/null + + if [[ $CHAIN != "STRIDE" ]]; then + cp $DOCKERNET_HOME/state/${STRIDE_NODE_PREFIX}${i}/config/priv_validator_key.json $DOCKERNET_HOME/state/${NODE_PREFIX}${i}/config/priv_validator_key.json + cp $DOCKERNET_HOME/state/${STRIDE_NODE_PREFIX}${i}/config/node_key.json $DOCKERNET_HOME/state/${NODE_PREFIX}${i}/config/node_key.json + fi + + if [[ ($CHAIN == "STRIDE" && ($i == 1 || $i == 2)) || $CHAIN != "STRIDE" ]]; then + # actually set this account as a validator on the current node + $cmd gentx $val_acct ${STAKE_TOKENS}${DENOM} --chain-id $CHAIN_ID --keyring-backend test &> /dev/null + fi + + # Get the endpoint and node ID + node_id=$($cmd tendermint show-node-id)@$node_name:$PEER_PORT + echo "Node #$i ID: $node_id" # Cleanup from seds rm -rf ${client_toml}-E @@ -151,7 +163,9 @@ for (( i=1; i <= $NUM_NODES; i++ )); do else # also add this account and it's genesis tx to the main node $MAIN_CMD add-genesis-account ${val_addr} ${VAL_TOKENS}${DENOM} - cp ${STATE}/${node_name}/config/gentx/*.json ${STATE}/${MAIN_NODE_NAME}/config/gentx/ + if [ -d "${STATE}/${node_name}/config/gentx" ]; then + cp ${STATE}/${node_name}/config/gentx/*.json ${STATE}/${MAIN_NODE_NAME}/config/gentx/ + fi # and add each validator's keys to the first state directory echo "$val_mnemonic" | $MAIN_CMD keys add $val_acct --recover --keyring-backend=test &> /dev/null @@ -185,6 +199,12 @@ else echo "$RELAYER_MNEMONIC" | $MAIN_CMD keys add $RELAYER_ACCT --recover --keyring-backend=test >> $KEYS_LOGS 2>&1 RELAYER_ADDRESS=$($MAIN_CMD keys show $RELAYER_ACCT --keyring-backend test -a | tr -cd '[:alnum:]._-') $MAIN_CMD add-genesis-account ${RELAYER_ADDRESS} ${VAL_TOKENS}${DENOM} + + if [ "$CHAIN" == "GAIA" ]; then + echo "$RELAYER_GAIA_ICS_MNEMONIC" | $MAIN_CMD keys add $RELAYER_GAIA_ICS_ACCT --recover --keyring-backend=test >> $KEYS_LOGS 2>&1 + RELAYER_ADDRESS=$($MAIN_CMD keys show $RELAYER_GAIA_ICS_ACCT --keyring-backend test -a | tr -cd '[:alnum:]._-') + $MAIN_CMD add-genesis-account ${RELAYER_ADDRESS} ${VAL_TOKENS}${DENOM} + fi fi # now we process gentx txs on the main node diff --git a/dockernet/src/start_relayers.sh b/dockernet/src/start_relayers.sh index e5e72d5d35..2acab0ab2d 100644 --- a/dockernet/src/start_relayers.sh +++ b/dockernet/src/start_relayers.sh @@ -5,7 +5,20 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) source ${SCRIPT_DIR}/../config.sh +HERMES_LOGS=${LOGS}/hermes.log +HERMES_CONFIG=$STATE/hermes/config.toml +TMP_MNEMONICS=mnemonic.txt + +mkdir -p $STATE/hermes +chmod -R 777 $STATE/hermes +cp ${DOCKERNET_HOME}/config/hermes_config.toml $HERMES_CONFIG + +HERMES_CMD="$DOCKERNET_HOME/../build/hermes/release/hermes --config $HERMES_CONFIG" + +added_stride_account="false" + for chain in ${HOST_CHAINS[@]}; do + chain_id=$(GET_VAR_VALUE ${chain}_CHAIN_ID) relayer_exec=$(GET_VAR_VALUE RELAYER_${chain}_EXEC) chain_name=$(printf "$chain" | awk '{ print tolower($0) }') account_name=$(GET_VAR_VALUE RELAYER_${chain}_ACCT) @@ -27,6 +40,25 @@ for chain in ${HOST_CHAINS[@]}; do $relayer_exec rly transact link stride-${chain_name} >> $relayer_logs 2>&1 echo "Done" - $DOCKER_COMPOSE up -d relayer-${chain_name} - $DOCKER_COMPOSE logs -f relayer-${chain_name} | sed -r -u "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" >> $relayer_logs 2>&1 & + printf "STRIDE <> $chain - Adding hermes host key..." + echo "$mnemonic" > $TMP_MNEMONICS + $HERMES_CMD keys add --key-name $account_name --chain $chain_id --mnemonic-file $TMP_MNEMONICS --overwrite + echo "Done" + + if [[ "$added_stride_account" == "false" ]]; then + printf "STRIDE <> $chain - Adding hermes Stride key..." + echo "$mnemonic" > $TMP_MNEMONICS + $HERMES_CMD keys add --key-name $RELAYER_STRIDE_ACCT --chain $STRIDE_CHAIN_ID --mnemonic-file $TMP_MNEMONICS --overwrite + echo "Done" + + added_stride_account="true" + fi + + # $DOCKER_COMPOSE up -d relayer-${chain_name} + # $DOCKER_COMPOSE logs -f relayer-${chain_name} | sed -r -u "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" >> $relayer_logs 2>&1 & done + +$DOCKER_COMPOSE up -d hermes +$DOCKER_COMPOSE logs -f hermes | sed -r -u "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" >> $HERMES_LOGS 2>&1 & + +rm $TMP_MNEMONICS \ No newline at end of file diff --git a/dockernet/upgrades/setup_ics.sh b/dockernet/upgrades/setup_ics.sh new file mode 100644 index 0000000000..cb16eae450 --- /dev/null +++ b/dockernet/upgrades/setup_ics.sh @@ -0,0 +1,160 @@ +#!/bin/bash + +set -eu +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +source ${SCRIPT_DIR}/../config.sh + +#======== 1. ADD CONSUMER ======== + +PROVIDER_HOME="$DOCKERNET_HOME/state/${GAIA_NODE_PREFIX}1" +CONSUMER_HOME_PREFIX="$DOCKERNET_HOME/state/${STRIDE_NODE_PREFIX}" +CONSUMER_HOME="${CONSUMER_HOME_PREFIX}1" +SOVEREIGN_HOME="$DOCKERNET_HOME/state/sovereign" +PROVIDER_BINARY=$GAIA_BINARY +PROVIDER_CHAIN_ID=$GAIA_CHAIN_ID +PROVIDER_RPC_ADDR="localhost:$GAIA_RPC_PORT" +VALIDATOR1="${GAIA_VAL_PREFIX}1" +VALIDATOR2="${GAIA_VAL_PREFIX}2" +VALIDATOR3="${GAIA_VAL_PREFIX}3" +DENOM=$ATOM_DENOM +PROVIDER_MAIN_CMD="$PROVIDER_BINARY --home $PROVIDER_HOME" +SOVEREIGN_CHAIN_ID=$STRIDE_CHAIN_ID +UPGRADE_HEIGHT="${UPGRADE_HEIGHT:-150}" +REVISION_HEIGHT=$((UPGRADE_HEIGHT + 3)) +NUM_NODES=$(GET_VAR_VALUE STRIDE_NUM_NODES) + +# Build consumer chain proposal file - unbonding period 21 days +tee $PROVIDER_HOME/consumer-proposal.json< "$SOVEREIGN_HOME"/consumer_section.json; +then + echo "Failed to get consumer genesis for the chain-id '$SOVEREIGN_CHAIN_ID'! Finalize genesis failed. For more details please check the log file in output directory." + exit 1 +fi + +# This portion needs to be enabled for only above gaia v9.1.0(321d15a574def0f338ceacc5c060159ebba95edc) +# Path to the JSON file +json_file="$SOVEREIGN_HOME"/consumer_section.json + +# Use jq to remove the "field2" key from the JSON file +jq 'del(.params.reward_denoms, .params.provider_reward_denoms)' "$json_file" > "$json_file.tmp" + +# Replace the original file with the modified version +mv "$json_file.tmp" "$json_file" + +cp $CONSUMER_HOME/config/genesis.json "$SOVEREIGN_HOME"/config/genesis.json +jq -s '.[0].app_state.ccvconsumer = .[1] | .[0]' "$SOVEREIGN_HOME"/config/genesis.json "$SOVEREIGN_HOME"/consumer_section.json > "$SOVEREIGN_HOME"/genesis_consumer.json && \ + mv "$SOVEREIGN_HOME"/genesis_consumer.json "$CONSUMER_HOME"/config/ccv.json + +# Modify genesis params +jq ".app_state.ccvconsumer.params.blocks_per_distribution_transmission = \"70\" | .app_state.tokenfactory.paused = { \"paused\": false }" \ + $CONSUMER_HOME/config/ccv.json > \ + $SOVEREIGN_HOME/edited_genesis.json && mv $SOVEREIGN_HOME/edited_genesis.json $CONSUMER_HOME/config/ccv.json + +for (( i=2; i <= $NUM_NODES; i++ )); do + cp $CONSUMER_HOME/config/ccv.json "${CONSUMER_HOME_PREFIX}${i}"/config/ccv.json +done + + + +#======== 2. CREATE ICS CONNECTION AFTER CHANGEOVER ======== +echo "Waiting for the upgrade..." +BLOCK_NUM=$((REVISION_HEIGHT + 2)) +WAIT_FOR_STRING $STRIDE_LOGS "height=$BLOCK_NUM module=txindex" + +# Create new connections and channels for sharing voting power between two chains +relayer_logs=${LOGS}/relayer-gaia-ics.log +relayer_exec=$(GET_VAR_VALUE RELAYER_GAIA_ICS_EXEC) +relayer_config=$STATE/relayer-gaia-ics/config +mnemonic=$(GET_VAR_VALUE RELAYER_GAIA_ICS_MNEMONIC) +chain_name=gaia +account_name=$(GET_VAR_VALUE RELAYER_GAIA_ICS_ACCT) +coin_type=$(GET_VAR_VALUE COSMOS_COIN_TYPE) + +mkdir -p $relayer_config +chmod -R 777 $STATE/relayer-gaia-ics +cp ${DOCKERNET_HOME}/config/relayer_config_ics.yaml $relayer_config/config.yaml + +printf "STRIDE <> GAIA(ICS) - Adding relayer keys..." +$relayer_exec rly keys restore stride $RELAYER_STRIDE_ICS_ACCT "$mnemonic" >> $relayer_logs 2>&1 +$relayer_exec rly keys restore $chain_name $account_name "$mnemonic" --coin-type $coin_type >> $relayer_logs 2>&1 +echo "Done restoring relayer keys" + +printf "STRIDE <> GAIA - Creating new connections..." | tee -a $relayer_logs +$relayer_exec rly transact connection stride-gaia-ics >> $relayer_logs 2>&1 +echo "Done." +sleep 10 + +printf "STRIDE <> GAIA - Creating new channels..." | tee -a $relayer_logs +$relayer_exec rly transact channel stride-gaia-ics --src-port consumer --dst-port provider --order ordered --version 1 >> $relayer_logs 2>&1 +echo "Done." + +$DOCKER_COMPOSE up -d relayer-gaia-ics +$DOCKER_COMPOSE logs -f relayer-gaia-ics | sed -r -u "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" >> $relayer_logs 2>&1 & + +printf "STRIDE <> GAIA - Registering reward denom to provider..." +val_addr=$($STRIDE_MAIN_CMD keys show ${STRIDE_VAL_PREFIX}1 --keyring-backend test -a | tr -cd '[:alnum:]._-') +$STRIDE_MAIN_CMD tx ibc-transfer transfer transfer channel-0 $val_addr 10000ustrd --from ${STRIDE_VAL_PREFIX}1 -y +WAIT_FOR_BLOCK $STRIDE_LOGS 5 +$GAIA_MAIN_CMD tx provider register-consumer-reward-denom ibc/FF6C2E86490C1C4FBBD24F55032831D2415B9D7882F85C3CC9C2401D79362BEA --from ${GAIA_VAL_PREFIX}1 -y diff --git a/go.mod b/go.mod index 6e2635235d..26518f0b61 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/Stride-Labs/stride/v11 +module github.com/Stride-Labs/stride/v12 go 1.19 @@ -11,6 +11,7 @@ require ( github.com/cosmos/gogoproto v1.4.10 github.com/cosmos/ibc-go/v7 v7.2.0 github.com/cosmos/ics23/go v0.10.0 + github.com/cosmos/interchain-security/v3 v3.1.0 github.com/golang/protobuf v1.5.3 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -19,23 +20,30 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 - google.golang.org/grpc v1.55.0 + google.golang.org/grpc v1.56.0 gopkg.in/yaml.v2 v2.4.0 ) +require github.com/linxGnu/grocksdb v1.7.16 // indirect + +require github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect + require ( cosmossdk.io/log v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/go-playground/locales v0.14.0 // indirect + github.com/gin-gonic/gin v1.8.1 // indirect + github.com/go-playground/validator/v10 v10.11.1 // indirect + github.com/goccy/go-json v0.9.11 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/s2a-go v0.1.3 // indirect github.com/mattn/go-colorable v0.1.13 // indirect + github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 // indirect github.com/rs/zerolog v1.29.1 // indirect ) require ( cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.19.0 // indirect + cloud.google.com/go/compute v1.19.1 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v0.13.0 // indirect cloud.google.com/go/storage v1.29.0 // indirect @@ -58,13 +66,12 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v0.20.0 // indirect - github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -115,7 +122,6 @@ require ( github.com/klauspost/compress v1.16.3 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.7.16 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-isatty v0.0.18 // indirect @@ -171,6 +177,8 @@ require ( replace ( // Use the keyring specified by the cosmos-sdk github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 + github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.2 //indirect + github.com/cosmos/interchain-security/v3 => github.com/Stride-Labs/interchain-security/v3 v3.1.1-0.20230713175550-227e13e60bac // fork cast to add additional error checking github.com/spf13/cast => github.com/Stride-Labs/cast v0.0.3 diff --git a/go.sum b/go.sum index 7cb00522a2..ddb61d37d3 100644 --- a/go.sum +++ b/go.sum @@ -70,8 +70,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.19.0 h1:+9zda3WGgW1ZSTlVppLCYFIr48Pa35q1uG2N1itbCEQ= -cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU= +cloud.google.com/go/compute v1.19.1 h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY= +cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= @@ -222,6 +222,8 @@ github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWX github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/Stride-Labs/cast v0.0.3 h1:eM3n/t3hSxb+iw9LDo3r/uGBp3w4U7wPv40GKMtJ1dI= github.com/Stride-Labs/cast v0.0.3/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/Stride-Labs/interchain-security/v3 v3.1.1-0.20230713175550-227e13e60bac h1:k1ef68RNRHMtekRusOh9bu5DmHEdvxPyKwotzFu9giU= +github.com/Stride-Labs/interchain-security/v3 v3.1.1-0.20230713175550-227e13e60bac/go.mod h1:2fILBgypEZcwR3BSzKDw+EsYtMKv9Z6cYXfouh4xTYU= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= @@ -339,8 +341,8 @@ github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZD github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= -github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w= -github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g= +github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= +github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= @@ -410,8 +412,9 @@ github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbS github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -433,8 +436,10 @@ github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= @@ -443,6 +448,8 @@ github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -619,8 +626,8 @@ github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoD github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -687,6 +694,7 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -695,6 +703,7 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= @@ -791,6 +800,8 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 h1:Yyk5ov0ZPKBXtVEeIWtc4J2XVrHuNoIK+0F2BUJgtsc= +github.com/oxyno-zeta/gomock-extra-matcher v1.1.0/go.mod h1:UMGTHYEmJ1dRq8LDZ7VTAYO4nqM3GD1UGC3RJEUxEz0= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -805,6 +816,7 @@ github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6 github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -856,6 +868,7 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= @@ -990,6 +1003,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= @@ -1544,8 +1558,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.56.0 h1:+y7Bs8rtMd07LeXmL3NxcTLn7mUkbKZqEpPhMNkwJEE= +google.golang.org/grpc v1.56.0/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1570,6 +1584,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= diff --git a/proto/stride/autopilot/genesis.proto b/proto/stride/autopilot/genesis.proto index cde6604a43..b865f6c279 100644 --- a/proto/stride/autopilot/genesis.proto +++ b/proto/stride/autopilot/genesis.proto @@ -4,7 +4,7 @@ package stride.autopilot; import "gogoproto/gogo.proto"; import "stride/autopilot/params.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/autopilot/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/autopilot/types"; // GenesisState defines the claim module's genesis state. message GenesisState { diff --git a/proto/stride/autopilot/params.proto b/proto/stride/autopilot/params.proto index ff937dabc3..f0df9a360d 100644 --- a/proto/stride/autopilot/params.proto +++ b/proto/stride/autopilot/params.proto @@ -3,7 +3,7 @@ package stride.autopilot; import "gogoproto/gogo.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/autopilot/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/autopilot/types"; // Params defines the parameters for the module. // next id: 1 diff --git a/proto/stride/autopilot/query.proto b/proto/stride/autopilot/query.proto index 2b7c978f16..04354051f4 100644 --- a/proto/stride/autopilot/query.proto +++ b/proto/stride/autopilot/query.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "stride/autopilot/params.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/autopilot/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/autopilot/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/stride/claim/claim.proto b/proto/stride/claim/claim.proto index 2fe589ec86..58c8f8a650 100644 --- a/proto/stride/claim/claim.proto +++ b/proto/stride/claim/claim.proto @@ -3,7 +3,7 @@ package stride.claim; import "gogoproto/gogo.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/claim/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/claim/types"; enum Action { option (gogoproto.goproto_enum_prefix) = false; diff --git a/proto/stride/claim/genesis.proto b/proto/stride/claim/genesis.proto index 9307708525..8f41d650fd 100644 --- a/proto/stride/claim/genesis.proto +++ b/proto/stride/claim/genesis.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "stride/claim/claim.proto"; import "stride/claim/params.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/claim/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/claim/types"; // GenesisState defines the claim module's genesis state. message GenesisState { diff --git a/proto/stride/claim/params.proto b/proto/stride/claim/params.proto index 648f235937..4643d44a8d 100644 --- a/proto/stride/claim/params.proto +++ b/proto/stride/claim/params.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/claim/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/claim/types"; // Params defines the claim module's parameters. message Params { repeated Airdrop airdrops = 1; } diff --git a/proto/stride/claim/query.proto b/proto/stride/claim/query.proto index f06d8cdf5f..f923d86028 100644 --- a/proto/stride/claim/query.proto +++ b/proto/stride/claim/query.proto @@ -9,7 +9,7 @@ import "stride/claim/params.proto"; import "stride/vesting/vesting.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/claim/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/claim/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/stride/claim/tx.proto b/proto/stride/claim/tx.proto index cf237fb707..8008257568 100644 --- a/proto/stride/claim/tx.proto +++ b/proto/stride/claim/tx.proto @@ -4,7 +4,7 @@ package stride.claim; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/claim/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/claim/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/stride/epochs/genesis.proto b/proto/stride/epochs/genesis.proto index b8925197a8..72917847d3 100755 --- a/proto/stride/epochs/genesis.proto +++ b/proto/stride/epochs/genesis.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/epochs/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/epochs/types"; message EpochInfo { string identifier = 1; diff --git a/proto/stride/epochs/query.proto b/proto/stride/epochs/query.proto index 2b6516531b..98893945f3 100644 --- a/proto/stride/epochs/query.proto +++ b/proto/stride/epochs/query.proto @@ -6,7 +6,7 @@ import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "stride/epochs/genesis.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/epochs/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/epochs/types"; // Query defines the gRPC querier service. service Query { @@ -51,7 +51,7 @@ message QueryEpochInfoResponse { // import "epochs/params.proto"; // // this line is used by starport scaffolding # 1 -// option go_package = "github.com/Stride-Labs/stride/v11/x/epochs/types"; +// option go_package = "github.com/Stride-Labs/stride/v12/x/epochs/types"; // // Query defines the gRPC querier service. // service Query { diff --git a/proto/stride/icacallbacks/callback_data.proto b/proto/stride/icacallbacks/callback_data.proto index 2f52000ffc..0e5db32bcc 100755 --- a/proto/stride/icacallbacks/callback_data.proto +++ b/proto/stride/icacallbacks/callback_data.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package stride.icacallbacks; -option go_package = "github.com/Stride-Labs/stride/v11/x/icacallbacks/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/icacallbacks/types"; message CallbackData { string callback_key = 1; diff --git a/proto/stride/icacallbacks/genesis.proto b/proto/stride/icacallbacks/genesis.proto index 6b550fa136..5ab220f8b4 100755 --- a/proto/stride/icacallbacks/genesis.proto +++ b/proto/stride/icacallbacks/genesis.proto @@ -6,7 +6,7 @@ import "stride/icacallbacks/params.proto"; import "stride/icacallbacks/callback_data.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/Stride-Labs/stride/v11/x/icacallbacks/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/icacallbacks/types"; // GenesisState defines the icacallbacks module's genesis state. message GenesisState { diff --git a/proto/stride/icacallbacks/packet.proto b/proto/stride/icacallbacks/packet.proto index e80202d43e..9a3f9e8f8c 100755 --- a/proto/stride/icacallbacks/packet.proto +++ b/proto/stride/icacallbacks/packet.proto @@ -3,7 +3,7 @@ package stride.icacallbacks; // this line is used by starport scaffolding # proto/packet/import -option go_package = "github.com/Stride-Labs/stride/v11/x/icacallbacks/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/icacallbacks/types"; message IcacallbacksPacketData { oneof packet { diff --git a/proto/stride/icacallbacks/params.proto b/proto/stride/icacallbacks/params.proto index e8a0f70f13..5d796435b6 100755 --- a/proto/stride/icacallbacks/params.proto +++ b/proto/stride/icacallbacks/params.proto @@ -3,7 +3,7 @@ package stride.icacallbacks; import "gogoproto/gogo.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/icacallbacks/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/icacallbacks/types"; // Params defines the parameters for the module. message Params { option (gogoproto.goproto_stringer) = false; } diff --git a/proto/stride/icacallbacks/query.proto b/proto/stride/icacallbacks/query.proto index 9c0b2893af..af9b38ead9 100644 --- a/proto/stride/icacallbacks/query.proto +++ b/proto/stride/icacallbacks/query.proto @@ -8,7 +8,7 @@ import "stride/icacallbacks/params.proto"; import "stride/icacallbacks/callback_data.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/Stride-Labs/stride/v11/x/icacallbacks/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/icacallbacks/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/stride/icacallbacks/tx.proto b/proto/stride/icacallbacks/tx.proto index aa3d667ae7..b12c5874a0 100755 --- a/proto/stride/icacallbacks/tx.proto +++ b/proto/stride/icacallbacks/tx.proto @@ -3,7 +3,7 @@ package stride.icacallbacks; // this line is used by starport scaffolding # proto/tx/import -option go_package = "github.com/Stride-Labs/stride/v11/x/icacallbacks/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/icacallbacks/types"; // Msg defines the Msg service. service Msg { diff --git a/proto/stride/interchainquery/v1/genesis.proto b/proto/stride/interchainquery/v1/genesis.proto index a9355c9770..275a2083d0 100644 --- a/proto/stride/interchainquery/v1/genesis.proto +++ b/proto/stride/interchainquery/v1/genesis.proto @@ -4,7 +4,7 @@ package stride.interchainquery.v1; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/interchainquery/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/interchainquery/types"; message Query { string id = 1; diff --git a/proto/stride/interchainquery/v1/messages.proto b/proto/stride/interchainquery/v1/messages.proto index d1542b9144..67ff9915ed 100755 --- a/proto/stride/interchainquery/v1/messages.proto +++ b/proto/stride/interchainquery/v1/messages.proto @@ -6,7 +6,7 @@ import "cosmos_proto/cosmos.proto"; import "google/api/annotations.proto"; import "tendermint/crypto/proof.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/interchainquery/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/interchainquery/types"; // Msg defines the interchainquery Msg service. service Msg { diff --git a/proto/stride/interchainquery/v1/query.proto b/proto/stride/interchainquery/v1/query.proto index 9cd53de0ff..f4f6799e91 100644 --- a/proto/stride/interchainquery/v1/query.proto +++ b/proto/stride/interchainquery/v1/query.proto @@ -5,7 +5,7 @@ import "stride/interchainquery/v1/genesis.proto"; import "google/api/annotations.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/interchainquery/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/interchainquery/types"; service QueryService { rpc PendingQueries(QueryPendingQueriesRequest) diff --git a/proto/stride/mint/v1beta1/genesis.proto b/proto/stride/mint/v1beta1/genesis.proto index 38425143b6..898113f70d 100755 --- a/proto/stride/mint/v1beta1/genesis.proto +++ b/proto/stride/mint/v1beta1/genesis.proto @@ -4,7 +4,7 @@ package stride.mint.v1beta1; import "gogoproto/gogo.proto"; import "stride/mint/v1beta1/mint.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/mint/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/mint/types"; // GenesisState defines the mint module's genesis state. message GenesisState { diff --git a/proto/stride/mint/v1beta1/mint.proto b/proto/stride/mint/v1beta1/mint.proto index 599a0b92da..d4240a85d1 100755 --- a/proto/stride/mint/v1beta1/mint.proto +++ b/proto/stride/mint/v1beta1/mint.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package stride.mint.v1beta1; -option go_package = "github.com/Stride-Labs/stride/v11/x/mint/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/mint/types"; import "gogoproto/gogo.proto"; diff --git a/proto/stride/mint/v1beta1/query.proto b/proto/stride/mint/v1beta1/query.proto index 5b56bedc12..58b033030e 100755 --- a/proto/stride/mint/v1beta1/query.proto +++ b/proto/stride/mint/v1beta1/query.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "stride/mint/v1beta1/mint.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/mint/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/mint/types"; // Query provides defines the gRPC querier service. service Query { diff --git a/proto/stride/ratelimit/genesis.proto b/proto/stride/ratelimit/genesis.proto index 563bb80753..c482b90976 100644 --- a/proto/stride/ratelimit/genesis.proto +++ b/proto/stride/ratelimit/genesis.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "stride/ratelimit/params.proto"; import "stride/ratelimit/ratelimit.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/ratelimit/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/ratelimit/types"; // GenesisState defines the ratelimit module's genesis state. message GenesisState { diff --git a/proto/stride/ratelimit/gov.proto b/proto/stride/ratelimit/gov.proto index e5d21951c6..9b20cb51d9 100644 --- a/proto/stride/ratelimit/gov.proto +++ b/proto/stride/ratelimit/gov.proto @@ -3,7 +3,7 @@ package stride.ratelimit; import "gogoproto/gogo.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/ratelimit/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/ratelimit/types"; message AddRateLimitProposal { option (gogoproto.equal) = true; diff --git a/proto/stride/ratelimit/params.proto b/proto/stride/ratelimit/params.proto index e8d30aa3a7..71b0f679fa 100644 --- a/proto/stride/ratelimit/params.proto +++ b/proto/stride/ratelimit/params.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package stride.ratelimit; -option go_package = "github.com/Stride-Labs/stride/v11/x/ratelimit/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/ratelimit/types"; // Params defines the ratelimit module's parameters. message Params {} diff --git a/proto/stride/ratelimit/query.proto b/proto/stride/ratelimit/query.proto index 80fc755afa..64af3e4a07 100644 --- a/proto/stride/ratelimit/query.proto +++ b/proto/stride/ratelimit/query.proto @@ -5,7 +5,7 @@ import "stride/ratelimit/ratelimit.proto"; import "google/api/annotations.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/ratelimit/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/ratelimit/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/stride/ratelimit/ratelimit.proto b/proto/stride/ratelimit/ratelimit.proto index 8479cb6902..c3373b002f 100644 --- a/proto/stride/ratelimit/ratelimit.proto +++ b/proto/stride/ratelimit/ratelimit.proto @@ -3,7 +3,7 @@ package stride.ratelimit; import "gogoproto/gogo.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/ratelimit/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/ratelimit/types"; enum PacketDirection { option (gogoproto.goproto_enum_prefix) = false; diff --git a/proto/stride/records/callbacks.proto b/proto/stride/records/callbacks.proto index 1f80d53c5a..5bdf0873da 100755 --- a/proto/stride/records/callbacks.proto +++ b/proto/stride/records/callbacks.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package stride.records; -option go_package = "github.com/Stride-Labs/stride/v11/x/records/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/records/types"; // ---------------------- Transfer Callback ---------------------- // message TransferCallback { uint64 deposit_record_id = 1; } diff --git a/proto/stride/records/genesis.proto b/proto/stride/records/genesis.proto index 84ab51aec8..d8b60b8913 100644 --- a/proto/stride/records/genesis.proto +++ b/proto/stride/records/genesis.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/Stride-Labs/stride/v11/x/records/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/records/types"; message UserRedemptionRecord { string id = 1; // {chain_id}.{epoch}.{sender} diff --git a/proto/stride/records/query.proto b/proto/stride/records/query.proto index ae9512a475..6c16ce15a3 100644 --- a/proto/stride/records/query.proto +++ b/proto/stride/records/query.proto @@ -7,7 +7,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "stride/records/genesis.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/Stride-Labs/stride/v11/x/records/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/records/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/stride/stakeibc/address_unbonding.proto b/proto/stride/stakeibc/address_unbonding.proto index ece7416e54..73d1e494e9 100644 --- a/proto/stride/stakeibc/address_unbonding.proto +++ b/proto/stride/stakeibc/address_unbonding.proto @@ -3,7 +3,7 @@ package stride.stakeibc; import "gogoproto/gogo.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/stakeibc/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/stakeibc/types"; message AddressUnbonding { string address = 1; diff --git a/proto/stride/stakeibc/callbacks.proto b/proto/stride/stakeibc/callbacks.proto index e1dd54afae..446f4d1d70 100644 --- a/proto/stride/stakeibc/callbacks.proto +++ b/proto/stride/stakeibc/callbacks.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package stride.stakeibc; -option go_package = "github.com/Stride-Labs/stride/v11/x/stakeibc/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/stakeibc/types"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; diff --git a/proto/stride/stakeibc/epoch_tracker.proto b/proto/stride/stakeibc/epoch_tracker.proto index f210b72212..a6845c4c32 100755 --- a/proto/stride/stakeibc/epoch_tracker.proto +++ b/proto/stride/stakeibc/epoch_tracker.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package stride.stakeibc; -option go_package = "github.com/Stride-Labs/stride/v11/x/stakeibc/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/stakeibc/types"; message EpochTracker { string epoch_identifier = 1; diff --git a/proto/stride/stakeibc/genesis.proto b/proto/stride/stakeibc/genesis.proto index ea3e4205af..fc07571735 100644 --- a/proto/stride/stakeibc/genesis.proto +++ b/proto/stride/stakeibc/genesis.proto @@ -7,7 +7,7 @@ import "stride/stakeibc/host_zone.proto"; import "stride/stakeibc/epoch_tracker.proto"; // this line is used by starport scaffolding # genesis/proto/import -option go_package = "github.com/Stride-Labs/stride/v11/x/stakeibc/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/stakeibc/types"; // GenesisState defines the stakeibc module's genesis state. message GenesisState { diff --git a/proto/stride/stakeibc/gov.proto b/proto/stride/stakeibc/gov.proto index c83263c3bf..6bb16bcab9 100644 --- a/proto/stride/stakeibc/gov.proto +++ b/proto/stride/stakeibc/gov.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package stride.stakeibc; import "gogoproto/gogo.proto"; import "stride/stakeibc/validator.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/stakeibc/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/stakeibc/types"; message AddValidatorsProposal { option (gogoproto.equal) = true; diff --git a/proto/stride/stakeibc/host_zone.proto b/proto/stride/stakeibc/host_zone.proto index 79bcc6ae88..3f5fa0acc9 100755 --- a/proto/stride/stakeibc/host_zone.proto +++ b/proto/stride/stakeibc/host_zone.proto @@ -6,7 +6,7 @@ import "stride/stakeibc/ica_account.proto"; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/stakeibc/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/stakeibc/types"; // next id: 22 message HostZone { diff --git a/proto/stride/stakeibc/ica_account.proto b/proto/stride/stakeibc/ica_account.proto index 33d1fb6251..0f066adadb 100755 --- a/proto/stride/stakeibc/ica_account.proto +++ b/proto/stride/stakeibc/ica_account.proto @@ -3,7 +3,7 @@ package stride.stakeibc; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/stakeibc/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/stakeibc/types"; enum ICAAccountType { DELEGATION = 0; diff --git a/proto/stride/stakeibc/packet.proto b/proto/stride/stakeibc/packet.proto index 4ea1fd8331..abf4336ab1 100755 --- a/proto/stride/stakeibc/packet.proto +++ b/proto/stride/stakeibc/packet.proto @@ -3,7 +3,7 @@ package stride.stakeibc; // this line is used by starport scaffolding # proto/packet/import -option go_package = "github.com/Stride-Labs/stride/v11/x/stakeibc/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/stakeibc/types"; message StakeibcPacketData { oneof packet { diff --git a/proto/stride/stakeibc/params.proto b/proto/stride/stakeibc/params.proto index 51473ee36f..aa29eeceff 100755 --- a/proto/stride/stakeibc/params.proto +++ b/proto/stride/stakeibc/params.proto @@ -3,7 +3,7 @@ package stride.stakeibc; import "gogoproto/gogo.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/stakeibc/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/stakeibc/types"; // Params defines the parameters for the module. // next id: 18 diff --git a/proto/stride/stakeibc/query.proto b/proto/stride/stakeibc/query.proto index 4c8811b97a..edfec98389 100644 --- a/proto/stride/stakeibc/query.proto +++ b/proto/stride/stakeibc/query.proto @@ -11,7 +11,7 @@ import "stride/stakeibc/epoch_tracker.proto"; import "stride/stakeibc/address_unbonding.proto"; // this line is used by starport scaffolding # 1 -option go_package = "github.com/Stride-Labs/stride/v11/x/stakeibc/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/stakeibc/types"; // Query defines the gRPC querier service. service Query { diff --git a/proto/stride/stakeibc/tx.proto b/proto/stride/stakeibc/tx.proto index 5ddd9687fc..1ebe2324f2 100644 --- a/proto/stride/stakeibc/tx.proto +++ b/proto/stride/stakeibc/tx.proto @@ -4,7 +4,7 @@ package stride.stakeibc; import "stride/stakeibc/ica_account.proto"; import "stride/stakeibc/validator.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/stakeibc/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/stakeibc/types"; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; diff --git a/proto/stride/stakeibc/validator.proto b/proto/stride/stakeibc/validator.proto index e650076572..61b847f83f 100755 --- a/proto/stride/stakeibc/validator.proto +++ b/proto/stride/stakeibc/validator.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package stride.stakeibc; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/stakeibc/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/stakeibc/types"; message ValidatorExchangeRate { string internal_tokens_to_shares_rate = 1 [ diff --git a/proto/stride/vesting/tx.proto b/proto/stride/vesting/tx.proto index 7012439c48..59605ec415 100644 --- a/proto/stride/vesting/tx.proto +++ b/proto/stride/vesting/tx.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package stride.vesting; -option go_package = "github.com/Stride-Labs/stride/v11/x/claim/vesting/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/claim/vesting/types"; // Msg defines the bank Msg service. service Msg {} diff --git a/proto/stride/vesting/vesting.proto b/proto/stride/vesting/vesting.proto index a9e2ab30ab..2037d1d94a 100644 --- a/proto/stride/vesting/vesting.proto +++ b/proto/stride/vesting/vesting.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/auth/v1beta1/auth.proto"; -option go_package = "github.com/Stride-Labs/stride/v11/x/claim/vesting/types"; +option go_package = "github.com/Stride-Labs/stride/v12/x/claim/vesting/types"; // BaseVestingAccount implements the VestingAccount interface. It contains all // the necessary fields needed for any vesting account implementation. diff --git a/relayer/config/config.lock b/relayer/config/config.lock new file mode 100644 index 0000000000..e69de29bb2 diff --git a/relayer/config/config.yaml b/relayer/config/config.yaml new file mode 100644 index 0000000000..9fdfbabc3b --- /dev/null +++ b/relayer/config/config.yaml @@ -0,0 +1,65 @@ +global: + api-listen-addr: :5183 + timeout: 10s + memo: "" + light-cache-size: 20 +chains: + consumer: + type: cosmos + value: + key-directory: relayer/keys/consumer + key: rly2 + chain-id: consumer + rpc-addr: http://127.0.0.1:26638 + account-prefix: stride + keyring-backend: test + gas-adjustment: 1.2 + gas-prices: 0.00stake + min-gas-amount: 0 + debug: false + timeout: 20s + block-timeout: "" + output-format: json + sign-mode: direct + extra-codecs: [] + coin-type: null + broadcast-mode: batch + provider: + type: cosmos + value: + key-directory: relayer/keys/provider + key: rly1 + chain-id: provider + rpc-addr: http://127.0.0.1:26658 + account-prefix: cosmos + keyring-backend: test + gas-adjustment: 1.2 + gas-prices: 0.00stake + min-gas-amount: 0 + debug: false + timeout: 20s + block-timeout: "" + output-format: json + sign-mode: direct + extra-codecs: [] + coin-type: null + broadcast-mode: batch +paths: + consumer-provider: + src: + chain-id: consumer + dst: + chain-id: provider + src-channel-filter: + rule: "" + channel-list: [] + consumer-provider-ics: + src: + chain-id: consumer + client-id: 07-tendermint-1 + dst: + chain-id: provider + client-id: 07-tendermint-1 + src-channel-filter: + rule: "" + channel-list: [] diff --git a/relayer/config/config1.yaml b/relayer/config/config1.yaml new file mode 100644 index 0000000000..9fdfbabc3b --- /dev/null +++ b/relayer/config/config1.yaml @@ -0,0 +1,65 @@ +global: + api-listen-addr: :5183 + timeout: 10s + memo: "" + light-cache-size: 20 +chains: + consumer: + type: cosmos + value: + key-directory: relayer/keys/consumer + key: rly2 + chain-id: consumer + rpc-addr: http://127.0.0.1:26638 + account-prefix: stride + keyring-backend: test + gas-adjustment: 1.2 + gas-prices: 0.00stake + min-gas-amount: 0 + debug: false + timeout: 20s + block-timeout: "" + output-format: json + sign-mode: direct + extra-codecs: [] + coin-type: null + broadcast-mode: batch + provider: + type: cosmos + value: + key-directory: relayer/keys/provider + key: rly1 + chain-id: provider + rpc-addr: http://127.0.0.1:26658 + account-prefix: cosmos + keyring-backend: test + gas-adjustment: 1.2 + gas-prices: 0.00stake + min-gas-amount: 0 + debug: false + timeout: 20s + block-timeout: "" + output-format: json + sign-mode: direct + extra-codecs: [] + coin-type: null + broadcast-mode: batch +paths: + consumer-provider: + src: + chain-id: consumer + dst: + chain-id: provider + src-channel-filter: + rule: "" + channel-list: [] + consumer-provider-ics: + src: + chain-id: consumer + client-id: 07-tendermint-1 + dst: + chain-id: provider + client-id: 07-tendermint-1 + src-channel-filter: + rule: "" + channel-list: [] diff --git a/scripts/consumer/README.md b/scripts/consumer/README.md new file mode 100644 index 0000000000..e443fffa68 --- /dev/null +++ b/scripts/consumer/README.md @@ -0,0 +1,52 @@ +## How to run consumer chain + +### Pre-install + +Binaries: + +- interchain-security-pd - [Interchain security](https://github.com/cosmos/interchain-security/v3) version: v0.2.1 +- strided +- hermes(version: v0.15.0) + +### Commands + +```sh +rm -rf /Users/admin/.provider1 +rm -rf /Users/admin/.provider +rm -rf /Users/admin/.stride1 +rm -rf /Users/admin/.stride +sh run.sh +``` + +### Genesis modification script for consumer chain + +```sh +# Add ccv section +if ! ./$PROVIDER_BINARY q provider consumer-genesis "$CONSUMER_CHAIN_ID" --node "$PROVIDER_NODE_ADDRESS" --output json > "$CONSUMER_HOME"/consumer_section.json; +then + echo "Failed to get consumer genesis for the chain-id '$CONSUMER_CHAIN_ID'! Finalize genesis failed. For more details please check the log file in output directory." + exit 1 +fi + +jq -s '.[0].app_state.ccvconsumer = .[1] | .[0]' "$CONSUMER_HOME"/config/genesis.json "$CONSUMER_HOME"/consumer_section.json > "$CONSUMER_HOME"/genesis_consumer.json && \ + mv "$CONSUMER_HOME"/genesis_consumer.json "$CONSUMER_HOME"/config/genesis.json +``` + +### Initial validator set on consumer chain + +```json + "initial_val_set": [ + { + "pub_key": { + "ed25519": "6s4FU4uSsWNjnqhNc9vhyZBqrLjib+z/mfh1LhvkalE=" + }, + "power": "1" + }, + { + "pub_key": { + "ed25519": "JCFnTza2T2jlkTWxC0kY9lczh7F+jQ/bGyhHFFNr7/w=" + }, + "power": "100" + } + ], +``` diff --git a/scripts/consumer/run.sh b/scripts/consumer/run.sh new file mode 100644 index 0000000000..17f474722b --- /dev/null +++ b/scripts/consumer/run.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -eux + +bash start_provider.sh +bash start_consumer.sh diff --git a/scripts/consumer/start_consumer.sh b/scripts/consumer/start_consumer.sh new file mode 100644 index 0000000000..7b232b374a --- /dev/null +++ b/scripts/consumer/start_consumer.sh @@ -0,0 +1,210 @@ +#!/bin/bash +set -eux + +CONSUMER_HOME="$HOME/.stride" +CONSUMER_HOME1="$HOME/.stride1" +PROVIDER_CHAIN_ID="provider" +CONSUMER_CHAIN_ID="stride" +MONIKER="stride" +VALIDATOR="validator" +VALIDATOR1="validator1" +KEYRING="--keyring-backend test" +TX_FLAGS="--gas-adjustment 100 --gas auto" +PROVIDER_BINARY="interchain-security-pd" +CONSUMER_BINARY="strided" +NODE_IP="localhost" +PROVIDER_RPC_LADDR="$NODE_IP:26658" +PROVIDER_GRPC_ADDR="$NODE_IP:9091" +PROVIDER_RPC_LADDR1="$NODE_IP:26668" +PROVIDER_GRPC_ADDR1="$NODE_IP:9101" +CONSUMER_RPC_LADDR="$NODE_IP:26648" +CONSUMER_GRPC_ADDR="$NODE_IP:9081" +CONSUMER_RPC_LADDR1="$NODE_IP:26638" +CONSUMER_GRPC_ADDR1="$NODE_IP:9071" +CONSUMER_USER="consumer" +PROVIDER_HOME="$HOME/.provider" +PROVIDER_HOME1="$HOME/.provider1" +PROVIDER_NODE_ADDRESS="tcp://localhost:26658" + +# Clean start +killall $CONSUMER_BINARY &> /dev/null || true +rm -rf $CONSUMER_HOME +rm -rf $CONSUMER_HOME1 + +################CONSUMER############################ + +# Build genesis file and node directory structure +./$CONSUMER_BINARY init --chain-id $CONSUMER_CHAIN_ID $MONIKER --home $CONSUMER_HOME +sleep 1 + +# Add ccv section +if ! ./$PROVIDER_BINARY q provider consumer-genesis "$CONSUMER_CHAIN_ID" --node "$PROVIDER_NODE_ADDRESS" --output json > "$CONSUMER_HOME"/consumer_section.json; +then + echo "Failed to get consumer genesis for the chain-id '$CONSUMER_CHAIN_ID'! Finalize genesis failed. For more details please check the log file in output directory." + exit 1 +fi + +jq -s '.[0].app_state.ccvconsumer = .[1] | .[0]' "$CONSUMER_HOME"/config/genesis.json "$CONSUMER_HOME"/consumer_section.json > "$CONSUMER_HOME"/genesis_consumer.json && \ + mv "$CONSUMER_HOME"/genesis_consumer.json "$CONSUMER_HOME"/config/genesis.json + +# Modify genesis params +jq ".app_state.ccvconsumer.params.blocks_per_distribution_transmission = \"70\" | .app_state.tokenfactory.paused = { \"paused\": false }" \ + $CONSUMER_HOME/config/genesis.json > \ + $CONSUMER_HOME/edited_genesis.json && mv $CONSUMER_HOME/edited_genesis.json $CONSUMER_HOME/config/genesis.json +sleep 1 + +# Create user account keypair +./$CONSUMER_BINARY keys add $CONSUMER_USER $KEYRING --home $CONSUMER_HOME --output json > $CONSUMER_HOME/consumer_keypair.json 2>&1 + +# Add account in genesis (required by Hermes) +./$CONSUMER_BINARY add-genesis-account $(jq -r .address $CONSUMER_HOME/consumer_keypair.json) 1000000000stake --home $CONSUMER_HOME + +# Copy validator key files +cp $PROVIDER_HOME/config/priv_validator_key.json $CONSUMER_HOME/config/priv_validator_key.json +cp $PROVIDER_HOME/config/node_key.json $CONSUMER_HOME/config/node_key.json + +#######CHAIN2####### +./$CONSUMER_BINARY init --chain-id $CONSUMER_CHAIN_ID $MONIKER --home $CONSUMER_HOME1 +sleep 1 +#copy genesis +cp $CONSUMER_HOME/config/genesis.json $CONSUMER_HOME1/config/genesis.json + +cp $PROVIDER_HOME1/config/priv_validator_key.json $CONSUMER_HOME1/config/priv_validator_key.json +cp $PROVIDER_HOME1/config/node_key.json $CONSUMER_HOME1/config/node_key.json + +##########SET CONFIG.TOML##################### +# Set default client port +sed -i -r "/node =/ s/= .*/= \"tcp:\/\/${CONSUMER_RPC_LADDR1}\"/" $CONSUMER_HOME1/config/client.toml +sed -i -r "/node =/ s/= .*/= \"tcp:\/\/${CONSUMER_RPC_LADDR}\"/" $CONSUMER_HOME/config/client.toml +node=$(./$CONSUMER_BINARY tendermint show-node-id --home $CONSUMER_HOME) +node1=$(./$CONSUMER_BINARY tendermint show-node-id --home $CONSUMER_HOME1) +sed -i -r "/persistent_peers =/ s/= .*/= \"$node1@localhost:26636\"/" "$CONSUMER_HOME"/config/config.toml +sed -i -r "/persistent_peers =/ s/= .*/= \"$node@localhost:26646\"/" "$CONSUMER_HOME1"/config/config.toml + +sed -i -r "114s/.*/address = \"tcp:\/\/0.0.0.0:1318\"/" "$CONSUMER_HOME1"/config/app.toml + +# Start the chain +./$CONSUMER_BINARY start \ + --home $CONSUMER_HOME \ + --rpc.laddr tcp://${CONSUMER_RPC_LADDR} \ + --grpc.address ${CONSUMER_GRPC_ADDR} \ + --address tcp://${NODE_IP}:26645 \ + --p2p.laddr tcp://${NODE_IP}:26646 \ + --grpc-web.enable=false \ + --log_level trace \ + --trace \ + &> $CONSUMER_HOME/logs & + +./$CONSUMER_BINARY start \ + --home $CONSUMER_HOME1 \ + --rpc.laddr tcp://${CONSUMER_RPC_LADDR1} \ + --grpc.address ${CONSUMER_GRPC_ADDR1} \ + --address tcp://${NODE_IP}:26635 \ + --p2p.laddr tcp://${NODE_IP}:26636 \ + --grpc-web.enable=false \ + --log_level trace \ + --trace \ + &> $CONSUMER_HOME1/logs & +sleep 10 + +######################################HERMES################################### + +# Setup Hermes in packet relayer mode +killall hermes 2> /dev/null || true + +tee ~/.hermes/config.toml< ~/.hermes/logs & + +############################################################ + +PROVIDER_VALIDATOR_ADDRESS=$(jq -r .address $PROVIDER_HOME/keypair.json) +DELEGATIONS=$($PROVIDER_BINARY q staking delegations $PROVIDER_VALIDATOR_ADDRESS --home $PROVIDER_HOME --node tcp://${PROVIDER_RPC_LADDR} -o json) +OPERATOR_ADDR=$(echo $DELEGATIONS | jq -r .delegation_responses[0].delegation.validator_address) + +./$PROVIDER_BINARY tx staking delegate $OPERATOR_ADDR 50000000stake \ + --from $VALIDATOR \ + $KEYRING \ + --home $PROVIDER_HOME \ + --node tcp://${PROVIDER_RPC_LADDR} \ + --chain-id $PROVIDER_CHAIN_ID -y -b block +sleep 1 diff --git a/scripts/consumer/start_provider.sh b/scripts/consumer/start_provider.sh new file mode 100644 index 0000000000..b732805363 --- /dev/null +++ b/scripts/consumer/start_provider.sh @@ -0,0 +1,128 @@ +#!/bin/bash +set -eux + +TOTAL_COINS=100000000000stake +STAKE_COINS=100000000stake +TOTAL_COINS1=100000000000stake +STAKE_COINS1=1000000stake +PROVIDER_BINARY=interchain-security-pd +PROVIDER_HOME="$HOME/.provider" +PROVIDER_HOME1="$HOME/.provider1" +PROVIDER_CHAIN_ID=provider +PROVIDER_MONIKER=provider +VALIDATOR=validator +VALIDATOR1=validator1 +NODE_IP="localhost" +PROVIDER_RPC_LADDR="$NODE_IP:26658" +PROVIDER_GRPC_ADDR="$NODE_IP:9091" +PROVIDER_RPC_LADDR1="$NODE_IP:26668" +PROVIDER_GRPC_ADDR1="$NODE_IP:9101" +PROVIDER_DELEGATOR=delegator + +# Clean start +killall $PROVIDER_BINARY &> /dev/null || true + +#######VALIDATOR1####################### +rm -rf $PROVIDER_HOME + +./$PROVIDER_BINARY init $PROVIDER_MONIKER --home $PROVIDER_HOME --chain-id $PROVIDER_CHAIN_ID +jq ".app_state.gov.voting_params.voting_period = \"3s\" | .app_state.staking.params.unbonding_time = \"600s\" | .app_state.provider.params.template_client.trusting_period = \"300s\"" \ + $PROVIDER_HOME/config/genesis.json > \ + $PROVIDER_HOME/edited_genesis.json && mv $PROVIDER_HOME/edited_genesis.json $PROVIDER_HOME/config/genesis.json +sleep 1 + +# Create account keypair +./$PROVIDER_BINARY keys add $VALIDATOR --home $PROVIDER_HOME --keyring-backend test --output json > $PROVIDER_HOME/keypair.json 2>&1 +sleep 1 +./$PROVIDER_BINARY keys add $PROVIDER_DELEGATOR --home $PROVIDER_HOME --keyring-backend test --output json > $PROVIDER_HOME/keypair_delegator.json 2>&1 +sleep 1 + +# Add stake to user +./$PROVIDER_BINARY add-genesis-account $(jq -r .address $PROVIDER_HOME/keypair.json) $TOTAL_COINS --home $PROVIDER_HOME --keyring-backend test +sleep 1 +./$PROVIDER_BINARY add-genesis-account $(jq -r .address $PROVIDER_HOME/keypair_delegator.json) $TOTAL_COINS --home $PROVIDER_HOME --keyring-backend test +sleep 1 + +# Stake 1/1000 user's coins +./$PROVIDER_BINARY gentx $VALIDATOR $STAKE_COINS --chain-id $PROVIDER_CHAIN_ID --home $PROVIDER_HOME --keyring-backend test --moniker $VALIDATOR +sleep 1 + +###########VALIDATOR 2############################ +rm -rf $PROVIDER_HOME1 + +./$PROVIDER_BINARY init $PROVIDER_MONIKER --home $PROVIDER_HOME1 --chain-id $PROVIDER_CHAIN_ID +cp $PROVIDER_HOME/config/genesis.json $PROVIDER_HOME1/config/genesis.json + +# Create account keypair +./$PROVIDER_BINARY keys add $VALIDATOR1 --home $PROVIDER_HOME1 --keyring-backend test --output json > $PROVIDER_HOME1/keypair.json 2>&1 +sleep 1 + +# Add stake to user +./$PROVIDER_BINARY add-genesis-account $(jq -r .address $PROVIDER_HOME1/keypair.json) $TOTAL_COINS1 --home $PROVIDER_HOME1 --keyring-backend test +sleep 1 + +####################GENTX AND DISTRIBUTE GENESIS############################## +cp -r $PROVIDER_HOME/config/gentx $PROVIDER_HOME1/config/ + +# Stake 1/1000 user's coins +./$PROVIDER_BINARY gentx $VALIDATOR1 $STAKE_COINS1 --chain-id $PROVIDER_CHAIN_ID --home $PROVIDER_HOME1 --keyring-backend test --moniker $VALIDATOR1 +sleep 1 + +./$PROVIDER_BINARY collect-gentxs --home $PROVIDER_HOME1 --gentx-dir $PROVIDER_HOME1/config/gentx/ +sleep 1 + +cp $PROVIDER_HOME1/config/genesis.json $PROVIDER_HOME/config/genesis.json + +####################ADDING PEERS#################### +node=$(./$PROVIDER_BINARY tendermint show-node-id --home $PROVIDER_HOME) +node1=$(./$PROVIDER_BINARY tendermint show-node-id --home $PROVIDER_HOME1) +sed -i -r "/persistent_peers =/ s/= .*/= \"$node@localhost:26656\"/" "$PROVIDER_HOME1"/config/config.toml +sed -i -r "/persistent_peers =/ s/= .*/= \"$node1@localhost:26666\"/" "$PROVIDER_HOME"/config/config.toml + +#################### Start the chain node1 ################### +./$PROVIDER_BINARY start \ + --home $PROVIDER_HOME \ + --rpc.laddr tcp://$PROVIDER_RPC_LADDR \ + --grpc.address $PROVIDER_GRPC_ADDR \ + --address tcp://${NODE_IP}:26655 \ + --p2p.laddr tcp://${NODE_IP}:26656 \ + --grpc-web.enable=false \ + --trace \ + &> $PROVIDER_HOME/logs & + +#################### Start the chain node2 ################### +./$PROVIDER_BINARY start \ + --home $PROVIDER_HOME1 \ + --rpc.laddr tcp://$PROVIDER_RPC_LADDR1 \ + --grpc.address $PROVIDER_GRPC_ADDR1 \ + --address tcp://${NODE_IP}:26665 \ + --p2p.laddr tcp://${NODE_IP}:26666 \ + --grpc-web.enable=false \ + --trace \ + &> $PROVIDER_HOME1/logs & +sleep 10 + +# Build consumer chain proposal file +tee $PROVIDER_HOME/consumer-proposal.json<