From 2e3c17f3b8d3a37038b35739637e1e5d2fbb6c59 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 7 May 2023 22:51:00 +0200 Subject: [PATCH 01/24] simplify naming --- cmd/{interchain-security-cd => consumer}/cmd/genaccounts.go | 0 cmd/{interchain-security-cd => consumer}/cmd/root.go | 0 cmd/{interchain-security-cd => consumer}/main.go | 0 .../cmd/genaccounts.go | 0 cmd/{interchain-security-cdd => consumerdemocracy}/cmd/root.go | 0 cmd/{interchain-security-cdd => consumerdemocracy}/main.go | 0 cmd/{interchain-security-pd => provider}/cmd/genaccounts.go | 0 cmd/{interchain-security-pd => provider}/cmd/root.go | 0 cmd/{interchain-security-pd => provider}/main.go | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename cmd/{interchain-security-cd => consumer}/cmd/genaccounts.go (100%) rename cmd/{interchain-security-cd => consumer}/cmd/root.go (100%) rename cmd/{interchain-security-cd => consumer}/main.go (100%) rename cmd/{interchain-security-cdd => consumerdemocracy}/cmd/genaccounts.go (100%) rename cmd/{interchain-security-cdd => consumerdemocracy}/cmd/root.go (100%) rename cmd/{interchain-security-cdd => consumerdemocracy}/main.go (100%) rename cmd/{interchain-security-pd => provider}/cmd/genaccounts.go (100%) rename cmd/{interchain-security-pd => provider}/cmd/root.go (100%) rename cmd/{interchain-security-pd => provider}/main.go (100%) diff --git a/cmd/interchain-security-cd/cmd/genaccounts.go b/cmd/consumer/cmd/genaccounts.go similarity index 100% rename from cmd/interchain-security-cd/cmd/genaccounts.go rename to cmd/consumer/cmd/genaccounts.go diff --git a/cmd/interchain-security-cd/cmd/root.go b/cmd/consumer/cmd/root.go similarity index 100% rename from cmd/interchain-security-cd/cmd/root.go rename to cmd/consumer/cmd/root.go diff --git a/cmd/interchain-security-cd/main.go b/cmd/consumer/main.go similarity index 100% rename from cmd/interchain-security-cd/main.go rename to cmd/consumer/main.go diff --git a/cmd/interchain-security-cdd/cmd/genaccounts.go b/cmd/consumerdemocracy/cmd/genaccounts.go similarity index 100% rename from cmd/interchain-security-cdd/cmd/genaccounts.go rename to cmd/consumerdemocracy/cmd/genaccounts.go diff --git a/cmd/interchain-security-cdd/cmd/root.go b/cmd/consumerdemocracy/cmd/root.go similarity index 100% rename from cmd/interchain-security-cdd/cmd/root.go rename to cmd/consumerdemocracy/cmd/root.go diff --git a/cmd/interchain-security-cdd/main.go b/cmd/consumerdemocracy/main.go similarity index 100% rename from cmd/interchain-security-cdd/main.go rename to cmd/consumerdemocracy/main.go diff --git a/cmd/interchain-security-pd/cmd/genaccounts.go b/cmd/provider/cmd/genaccounts.go similarity index 100% rename from cmd/interchain-security-pd/cmd/genaccounts.go rename to cmd/provider/cmd/genaccounts.go diff --git a/cmd/interchain-security-pd/cmd/root.go b/cmd/provider/cmd/root.go similarity index 100% rename from cmd/interchain-security-pd/cmd/root.go rename to cmd/provider/cmd/root.go diff --git a/cmd/interchain-security-pd/main.go b/cmd/provider/main.go similarity index 100% rename from cmd/interchain-security-pd/main.go rename to cmd/provider/main.go From a065680164dfeae8af9f2570c590e8b7af30abcd Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 8 May 2023 12:54:57 +0700 Subject: [PATCH 02/24] more simplification --- cmd/consumer/main.go | 2 +- cmd/consumerdemocracy/main.go | 2 +- cmd/provider/main.go | 2 +- tests/e2e/config.go | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/consumer/main.go b/cmd/consumer/main.go index 737a618cb6..adaaf69f30 100644 --- a/cmd/consumer/main.go +++ b/cmd/consumer/main.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" app "github.com/cosmos/interchain-security/app/consumer" - "github.com/cosmos/interchain-security/cmd/interchain-security-cd/cmd" + "github.com/cosmos/interchain-security/cmd/consumer/cmd" ) func main() { diff --git a/cmd/consumerdemocracy/main.go b/cmd/consumerdemocracy/main.go index 3ca199c480..4317dc6888 100644 --- a/cmd/consumerdemocracy/main.go +++ b/cmd/consumerdemocracy/main.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" app "github.com/cosmos/interchain-security/app/consumer-democracy" - "github.com/cosmos/interchain-security/cmd/interchain-security-cdd/cmd" + "github.com/cosmos/interchain-security/cmd/consumerdemocracy/cmd" ) func main() { diff --git a/cmd/provider/main.go b/cmd/provider/main.go index 879e65a06b..0ad4a73696 100644 --- a/cmd/provider/main.go +++ b/cmd/provider/main.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" app "github.com/cosmos/interchain-security/app/provider" - "github.com/cosmos/interchain-security/cmd/interchain-security-pd/cmd" + "github.com/cosmos/interchain-security/cmd/provider/cmd" ) func main() { diff --git a/tests/e2e/config.go b/tests/e2e/config.go index 0379ef2c90..35995d8097 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -150,7 +150,7 @@ func SlashThrottleTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "interchain-security-pd", + binaryName: "iprovider", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.voting_params.voting_period = \"20s\" | " + @@ -193,7 +193,7 @@ func DefaultTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "interchain-security-pd", + binaryName: "iprovider", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.voting_params.voting_period = \"20s\" | " + @@ -236,7 +236,7 @@ func DemocracyTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "interchain-security-pd", + binaryName: "iprovider", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.voting_params.voting_period = \"20s\" | " + @@ -279,7 +279,7 @@ func MultiConsumerTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "interchain-security-pd", + binaryName: "iprovider", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.voting_params.voting_period = \"20s\" | " + From e63fdad451320a9d8737198327b134f5b9dd4025 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 12 May 2023 02:22:17 +0700 Subject: [PATCH 03/24] complete the renaming --- Dockerfile | 6 +++--- Dockerfile.gaia | 8 ++++---- Makefile | 6 +++--- README.md | 10 +++++----- app/consumer-democracy/app.go | 2 +- tests/e2e/config.go | 10 +++++----- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0da9141620..eb6f23f719 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,9 +37,9 @@ USER root COPY --from=hermes-builder /usr/bin/hermes /usr/local/bin/ -COPY --from=is-builder /go/bin/interchain-security-pd /usr/local/bin/interchain-security-pd -COPY --from=is-builder /go/bin/interchain-security-cd /usr/local/bin/interchain-security-cd -COPY --from=is-builder /go/bin/interchain-security-cdd /usr/local/bin/interchain-security-cdd +COPY --from=is-builder /go/bin/provider /usr/local/bin/provider +COPY --from=is-builder /go/bin/consumer /usr/local/bin/consumer +COPY --from=is-builder /go/bin/consumerd /usr/local/bin/consumerd # Copy in the shell scripts that run the testnet diff --git a/Dockerfile.gaia b/Dockerfile.gaia index 196f7dfa74..fe9601f640 100644 --- a/Dockerfile.gaia +++ b/Dockerfile.gaia @@ -70,10 +70,10 @@ USER root COPY --from=hermes-builder /usr/bin/hermes /usr/local/bin/ -# swap interchain-security-pd binary with gaia binary but keep the name -COPY --from=gaia-builder /go/gaia/build/gaiad /usr/local/bin/interchain-security-pd -COPY --from=is-builder /go/bin/interchain-security-cd /usr/local/bin/interchain-security-cd -COPY --from=is-builder /go/bin/interchain-security-cdd /usr/local/bin/interchain-security-cdd +# swap provider binary with gaia binary but keep the name +COPY --from=gaia-builder /go/gaia/build/gaiad /usr/local/bin/provider +COPY --from=is-builder /go/bin/consumer /usr/local/bin/consumer +COPY --from=is-builder /go/bin/consumerd /usr/local/bin/consumerd # Copy in the shell scripts that run the testnet diff --git a/Makefile b/Makefile index 63c606981d..40317b78ec 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,9 @@ install: go.sum export GOFLAGS='-buildmode=pie' export CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2" export CGO_LDFLAGS="-Wl,-z,relro,-z,now -fstack-protector" - go install $(BUILD_FLAGS) ./cmd/interchain-security-pd - go install $(BUILD_FLAGS) ./cmd/interchain-security-cd - go install $(BUILD_FLAGS) ./cmd/interchain-security-cdd + go install $(BUILD_FLAGS) ./cmd/provider + go install $(BUILD_FLAGS) ./cmd/consumer + go install $(BUILD_FLAGS) ./cmd/consumerd # run all tests: unit, integration, diff, and E2E test: diff --git a/README.md b/README.md index d7e63d11f5..2124cd910c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The code for CCV is housed under [x/ccv](./x/ccv). The `types` folder contains t ## Instructions -**Prerequisites** +### Prerequisites ```bash ## For OSX or Linux @@ -28,15 +28,15 @@ brew install jq ``` -**Installing and running binaries** +### Installing and running binaries ```bash -# install interchain-security-pd and interchain-security-cd binaries +# install provider and consumer binaries make install # run provider -interchain-security-pd +provider # run consumer -interchain-security-cd +consumer # (if the above fail, ensure ~/go/bin on $PATH) export PATH=$PATH:$(go env GOPATH)/bin ``` diff --git a/app/consumer-democracy/app.go b/app/consumer-democracy/app.go index b65795f2a2..9e427a3d66 100644 --- a/app/consumer-democracy/app.go +++ b/app/consumer-democracy/app.go @@ -116,7 +116,7 @@ import ( ) const ( - AppName = "interchain-security-cd" + AppName = "democracy" upgradeName = "v07-Theta" // arbitrary name, define your own appropriately named upgrade AccountAddressPrefix = "cosmos" ) diff --git a/tests/e2e/config.go b/tests/e2e/config.go index 35995d8097..a728d181dc 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -165,7 +165,7 @@ func SlashThrottleTestRun() TestRun { }, chainID("consu"): { chainId: chainID("consu"), - binaryName: "interchain-security-cd", + binaryName: "consumer", ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.voting_params.voting_period = \"20s\" | " + @@ -208,7 +208,7 @@ func DefaultTestRun() TestRun { }, chainID("consu"): { chainId: chainID("consu"), - binaryName: "interchain-security-cd", + binaryName: "consumer", ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.voting_params.voting_period = \"20s\" | " + @@ -250,7 +250,7 @@ func DemocracyTestRun() TestRun { }, chainID("democ"): { chainId: chainID("democ"), - binaryName: "interchain-security-cdd", + binaryName: "democracy", ipPrefix: "7.7.9", votingWaitTime: 20, genesisChanges: ".app_state.ccvconsumer.params.blocks_per_distribution_transmission = \"20\" | " + @@ -293,7 +293,7 @@ func MultiConsumerTestRun() TestRun { }, chainID("consu"): { chainId: chainID("consu"), - binaryName: "interchain-security-cd", + binaryName: "consumer", ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.voting_params.voting_period = \"20s\" | " + @@ -304,7 +304,7 @@ func MultiConsumerTestRun() TestRun { }, chainID("densu"): { chainId: chainID("densu"), - binaryName: "interchain-security-cd", + binaryName: "consumer", ipPrefix: "7.7.9", votingWaitTime: 20, genesisChanges: ".app_state.gov.voting_params.voting_period = \"20s\" | " + From d33a6605b1e93553aee66a9962248099ee076d19 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 12 May 2023 02:26:16 +0700 Subject: [PATCH 04/24] consumer-democracy => democracy, interchain-security-cd => consumer interchain-security-pd => provider --- .../ante/forbidden_proposals_ante.go | 0 .../ante/forbidden_proposals_ante_test.go | 0 .../ante_handler.go | 2 +- app/{consumer-democracy => democracy}/app.go | 0 .../export.go | 0 .../genesis.go | 0 .../proposals_whitelisting.go | 0 .../proposals_whitelisting_test.go | 4 ++-- cmd/consumerdemocracy/cmd/root.go | 2 +- cmd/consumerdemocracy/main.go | 2 +- tests/integration/democracy.go | 20 +++++++++---------- tests/integration/instance_test.go | 16 +++++++-------- testutil/ibc_testing/generic_setup.go | 4 ++-- testutil/ibc_testing/specific_setup.go | 12 +++++------ testutil/integration/debug_test.go | 16 +++++++-------- 15 files changed, 39 insertions(+), 39 deletions(-) rename app/{consumer-democracy => democracy}/ante/forbidden_proposals_ante.go (100%) rename app/{consumer-democracy => democracy}/ante/forbidden_proposals_ante_test.go (100%) rename app/{consumer-democracy => democracy}/ante_handler.go (96%) rename app/{consumer-democracy => democracy}/app.go (100%) rename app/{consumer-democracy => democracy}/export.go (100%) rename app/{consumer-democracy => democracy}/genesis.go (100%) rename app/{consumer-democracy => democracy}/proposals_whitelisting.go (100%) rename app/{consumer-democracy => democracy}/proposals_whitelisting_test.go (85%) diff --git a/app/consumer-democracy/ante/forbidden_proposals_ante.go b/app/democracy/ante/forbidden_proposals_ante.go similarity index 100% rename from app/consumer-democracy/ante/forbidden_proposals_ante.go rename to app/democracy/ante/forbidden_proposals_ante.go diff --git a/app/consumer-democracy/ante/forbidden_proposals_ante_test.go b/app/democracy/ante/forbidden_proposals_ante_test.go similarity index 100% rename from app/consumer-democracy/ante/forbidden_proposals_ante_test.go rename to app/democracy/ante/forbidden_proposals_ante_test.go diff --git a/app/consumer-democracy/ante_handler.go b/app/democracy/ante_handler.go similarity index 96% rename from app/consumer-democracy/ante_handler.go rename to app/democracy/ante_handler.go index af809944f4..4f7127139a 100644 --- a/app/consumer-democracy/ante_handler.go +++ b/app/democracy/ante_handler.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/ante" ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" - democracyante "github.com/cosmos/interchain-security/app/consumer-democracy/ante" consumerante "github.com/cosmos/interchain-security/app/consumer/ante" + democracyante "github.com/cosmos/interchain-security/app/democracy/ante" ibcconsumerkeeper "github.com/cosmos/interchain-security/x/ccv/consumer/keeper" ) diff --git a/app/consumer-democracy/app.go b/app/democracy/app.go similarity index 100% rename from app/consumer-democracy/app.go rename to app/democracy/app.go diff --git a/app/consumer-democracy/export.go b/app/democracy/export.go similarity index 100% rename from app/consumer-democracy/export.go rename to app/democracy/export.go diff --git a/app/consumer-democracy/genesis.go b/app/democracy/genesis.go similarity index 100% rename from app/consumer-democracy/genesis.go rename to app/democracy/genesis.go diff --git a/app/consumer-democracy/proposals_whitelisting.go b/app/democracy/proposals_whitelisting.go similarity index 100% rename from app/consumer-democracy/proposals_whitelisting.go rename to app/democracy/proposals_whitelisting.go diff --git a/app/consumer-democracy/proposals_whitelisting_test.go b/app/democracy/proposals_whitelisting_test.go similarity index 85% rename from app/consumer-democracy/proposals_whitelisting_test.go rename to app/democracy/proposals_whitelisting_test.go index a485881b81..a293e96da7 100644 --- a/app/consumer-democracy/proposals_whitelisting_test.go +++ b/app/democracy/proposals_whitelisting_test.go @@ -3,7 +3,7 @@ package app_test import ( "testing" - appConsumer "github.com/cosmos/interchain-security/app/consumer-democracy" + appConsumer "github.com/cosmos/interchain-security/app/democracy" ibctesting "github.com/cosmos/interchain-security/legacy_ibc_testing/testing" icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" "github.com/stretchr/testify/require" @@ -11,7 +11,7 @@ import ( func TestDemocracyGovernanceWhitelistingKeys(t *testing.T) { chain := ibctesting.NewTestChain(t, ibctesting.NewCoordinator(t, 0), - icstestingutils.DemocracyConsumerAppIniter, "test") + icstestingutils.DemocracyAppIniter, "test") paramKeeper := chain.App.(*appConsumer.App).ParamsKeeper for paramKey := range appConsumer.WhitelistedParams { ss, ok := paramKeeper.GetSubspace(paramKey.Subspace) diff --git a/cmd/consumerdemocracy/cmd/root.go b/cmd/consumerdemocracy/cmd/root.go index cf41c6431f..31b83a1813 100644 --- a/cmd/consumerdemocracy/cmd/root.go +++ b/cmd/consumerdemocracy/cmd/root.go @@ -31,7 +31,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - simapp "github.com/cosmos/interchain-security/app/consumer-democracy" + simapp "github.com/cosmos/interchain-security/app/democracy" "github.com/cosmos/interchain-security/app/params" ) diff --git a/cmd/consumerdemocracy/main.go b/cmd/consumerdemocracy/main.go index 4317dc6888..f4433c0d16 100644 --- a/cmd/consumerdemocracy/main.go +++ b/cmd/consumerdemocracy/main.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - app "github.com/cosmos/interchain-security/app/consumer-democracy" + app "github.com/cosmos/interchain-security/app/democracy" "github.com/cosmos/interchain-security/cmd/consumerdemocracy/cmd" ) diff --git a/tests/integration/democracy.go b/tests/integration/democracy.go index 6531bb1a21..895f1a105f 100644 --- a/tests/integration/democracy.go +++ b/tests/integration/democracy.go @@ -19,7 +19,7 @@ import ( "github.com/stretchr/testify/suite" ) -type ConsumerDemocracyTestSuite struct { +type DemocracyTestSuite struct { suite.Suite coordinator *ibctesting.Coordinator consumerChain *ibctesting.TestChain @@ -27,12 +27,12 @@ type ConsumerDemocracyTestSuite struct { setupCallback DemocSetupCallback } -// NewCCVTestSuite returns a new instance of ConsumerDemocracyTestSuite, +// NewCCVTestSuite returns a new instance of DemocracyTestSuite, // ready to be tested against using suite.Run(). -func NewConsumerDemocracyTestSuite[T testutil.DemocConsumerApp]( +func NewDemocracyTestSuite[T testutil.DemocConsumerApp]( democConsumerAppIniter ibctesting.AppIniter, -) *ConsumerDemocracyTestSuite { - democSuite := new(ConsumerDemocracyTestSuite) +) *DemocracyTestSuite { + democSuite := new(DemocracyTestSuite) democSuite.setupCallback = func(t *testing.T) ( *ibctesting.Coordinator, @@ -44,7 +44,7 @@ func NewConsumerDemocracyTestSuite[T testutil.DemocConsumerApp]( coordinator := ibctesting.NewCoordinator(t, 0) // Add single democracy consumer to coordinator, store returned test chain and app. - democConsumer, democConsumerApp := icstestingutils.AddDemocracyConsumer[T]( + democConsumer, democConsumerApp := icstestingutils.AddDemocracy[T]( t, coordinator, democConsumerAppIniter) // Pass variables to suite. @@ -62,13 +62,13 @@ type DemocSetupCallback func(t *testing.T) ( ) // SetupTest sets up in-mem state before every test relevant to ccv with a democracy consumer -func (suite *ConsumerDemocracyTestSuite) SetupTest() { +func (suite *DemocracyTestSuite) SetupTest() { // Instantiate new test utils using callback suite.coordinator, suite.consumerChain, suite.consumerApp = suite.setupCallback(suite.T()) } -func (s *ConsumerDemocracyTestSuite) TestDemocracyRewardsDistribution() { +func (s *DemocracyTestSuite) TestDemocracyRewardsDistribution() { s.consumerChain.NextBlock() stakingKeeper := s.consumerApp.GetTestStakingKeeper() accountKeeper := s.consumerApp.GetTestAccountKeeper() @@ -146,7 +146,7 @@ func (s *ConsumerDemocracyTestSuite) TestDemocracyRewardsDistribution() { } } -func (s *ConsumerDemocracyTestSuite) TestDemocracyGovernanceWhitelisting() { +func (s *DemocracyTestSuite) TestDemocracyGovernanceWhitelisting() { govKeeper := s.consumerApp.GetTestGovKeeper() stakingKeeper := s.consumerApp.GetTestStakingKeeper() bankKeeper := s.consumerApp.GetTestBankKeeper() @@ -249,6 +249,6 @@ func getAccountsBalances(ctx sdk.Context, bankKeeper testutil.TestBankKeeper, bo return accountsBalances } -func (s *ConsumerDemocracyTestSuite) consumerCtx() sdk.Context { +func (s *DemocracyTestSuite) consumerCtx() sdk.Context { return s.consumerChain.GetContext() } diff --git a/tests/integration/instance_test.go b/tests/integration/instance_test.go index cd6ddcfe35..f79acd44f1 100644 --- a/tests/integration/instance_test.go +++ b/tests/integration/instance_test.go @@ -4,7 +4,7 @@ import ( "testing" appConsumer "github.com/cosmos/interchain-security/app/consumer" - appConsumerDemocracy "github.com/cosmos/interchain-security/app/consumer-democracy" + appDemocracy "github.com/cosmos/interchain-security/app/democracy" appProvider "github.com/cosmos/interchain-security/app/provider" intg "github.com/cosmos/interchain-security/tests/integration" icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" @@ -31,15 +31,15 @@ func TestCCVTestSuite(t *testing.T) { } // Executes a standard suite of tests, against a democracy consumer app.go implementation. -func TestConsumerDemocracyCCVTestSuite(t *testing.T) { +func TestDemocracyCCVTestSuite(t *testing.T) { // Pass in concrete app type that implement the interface defined in /testutil/e2e/interfaces.go // IMPORTANT: the concrete app types passed in as type parameters here must match the // concrete app types returned by the relevant app initers. - democSuite := intg.NewCCVTestSuite[*appProvider.App, *appConsumerDemocracy.App]( + democSuite := intg.NewCCVTestSuite[*appProvider.App, *appDemocracy.App]( // Pass in ibctesting.AppIniter for provider and democracy consumer. - // TestRewardsDistribution needs to be skipped since the democracy specific distribution test is in ConsumerDemocracyTestSuite, + // TestRewardsDistribution needs to be skipped since the democracy specific distribution test is in DemocracyTestSuite, // while this one tests consumer app without minter - icstestingutils.ProviderAppIniter, icstestingutils.DemocracyConsumerAppIniter, []string{"TestRewardsDistribution"}) + icstestingutils.ProviderAppIniter, icstestingutils.DemocracyAppIniter, []string{"TestRewardsDistribution"}) // Run tests suite.Run(t, democSuite) @@ -47,13 +47,13 @@ func TestConsumerDemocracyCCVTestSuite(t *testing.T) { // Executes a specialized group of tests specific to a democracy consumer, // against a democracy consumer app.go implementation. -func TestConsumerDemocracyTestSuite(t *testing.T) { +func TestDemocracyTestSuite(t *testing.T) { // Pass in concrete app type that implement the interface defined in /testutil/e2e/interfaces.go // IMPORTANT: the concrete app type passed in as a type parameter here must match the // concrete app type returned by the relevant app initer. - democSuite := intg.NewConsumerDemocracyTestSuite[*appConsumerDemocracy.App]( + democSuite := intg.NewDemocracyTestSuite[*appDemocracy.App]( // Pass in ibctesting.AppIniter for democracy consumer. - icstestingutils.DemocracyConsumerAppIniter) + icstestingutils.DemocracyAppIniter) // Run tests suite.Run(t, democSuite) diff --git a/testutil/ibc_testing/generic_setup.go b/testutil/ibc_testing/generic_setup.go index 5b3eef8fef..c7abab85bb 100644 --- a/testutil/ibc_testing/generic_setup.go +++ b/testutil/ibc_testing/generic_setup.go @@ -62,8 +62,8 @@ func AddProvider[T testutil.ProviderApp](t *testing.T, coordinator *ibctesting.C return provider, providerToReturn } -// AddDemocracyConsumer adds a new democ consumer chain to the coordinator and returns the test chain and app type -func AddDemocracyConsumer[T testutil.DemocConsumerApp](t *testing.T, coordinator *ibctesting.Coordinator, +// AddDemocracy adds a new democ consumer chain to the coordinator and returns the test chain and app type +func AddDemocracy[T testutil.DemocConsumerApp](t *testing.T, coordinator *ibctesting.Coordinator, appIniter ibctesting.AppIniter, ) (*ibctesting.TestChain, T) { t.Helper() diff --git a/testutil/ibc_testing/specific_setup.go b/testutil/ibc_testing/specific_setup.go index dc596a6d45..1797edac14 100644 --- a/testutil/ibc_testing/specific_setup.go +++ b/testutil/ibc_testing/specific_setup.go @@ -15,7 +15,7 @@ import ( tmdb "github.com/tendermint/tm-db" appConsumer "github.com/cosmos/interchain-security/app/consumer" - appConsumerDemocracy "github.com/cosmos/interchain-security/app/consumer-democracy" + appDemocracy "github.com/cosmos/interchain-security/app/democracy" appProvider "github.com/cosmos/interchain-security/app/provider" ) @@ -35,10 +35,10 @@ func ConsumerAppIniter() (ibctesting.TestingApp, map[string]json.RawMessage) { return testApp, appConsumer.NewDefaultGenesisState(encoding.Marshaler) } -// DemocracyConsumerAppIniter implements ibctesting.AppIniter for a democracy consumer app -func DemocracyConsumerAppIniter() (ibctesting.TestingApp, map[string]json.RawMessage) { - encoding := appConsumerDemocracy.MakeTestEncodingConfig() - testApp := appConsumerDemocracy.New(log.NewNopLogger(), tmdb.NewMemDB(), nil, true, map[int64]bool{}, +// DemocracyAppIniter implements ibctesting.AppIniter for a democracy consumer app +func DemocracyAppIniter() (ibctesting.TestingApp, map[string]json.RawMessage) { + encoding := appDemocracy.MakeTestEncodingConfig() + testApp := appDemocracy.New(log.NewNopLogger(), tmdb.NewMemDB(), nil, true, map[int64]bool{}, simapp.DefaultNodeHome, 5, encoding, simapp.EmptyAppOptions{}) - return testApp, appConsumerDemocracy.NewDefaultGenesisState(encoding.Marshaler) + return testApp, appDemocracy.NewDefaultGenesisState(encoding.Marshaler) } diff --git a/testutil/integration/debug_test.go b/testutil/integration/debug_test.go index 8549d12217..33b4082d54 100644 --- a/testutil/integration/debug_test.go +++ b/testutil/integration/debug_test.go @@ -7,7 +7,7 @@ import ( "testing" appConsumer "github.com/cosmos/interchain-security/app/consumer" - appConsumerDemocracy "github.com/cosmos/interchain-security/app/consumer-democracy" + appDemocracy "github.com/cosmos/interchain-security/app/democracy" appProvider "github.com/cosmos/interchain-security/app/provider" integr "github.com/cosmos/interchain-security/tests/integration" icstestingutils "github.com/cosmos/interchain-security/testutil/ibc_testing" @@ -25,13 +25,13 @@ func runCCVTestByName(t *testing.T, methodName string) { findAndCallMethod(t, suite, methodName) } -// runConsumerDemocracyTestByName runs a single consumer democracy integration test by name, -// using a ConsumerDemocracyTestSuite initialized with the dummy +// runDemocracyTestByName runs a single consumer democracy integration test by name, +// using a DemocracyTestSuite initialized with the dummy // democracy consumer defined in this repo. -func runConsumerDemocracyTestByName(t *testing.T, methodName string) { +func runDemocracyTestByName(t *testing.T, methodName string) { t.Helper() - suite := integr.NewConsumerDemocracyTestSuite[*appConsumerDemocracy.App]( - icstestingutils.DemocracyConsumerAppIniter) + suite := integr.NewDemocracyTestSuite[*appDemocracy.App]( + icstestingutils.DemocracyAppIniter) suite.SetT(t) suite.SetupTest() @@ -62,11 +62,11 @@ func TestInitTimeout(t *testing.T) { // func TestDemocracyRewardsDistribution(t *testing.T) { - runConsumerDemocracyTestByName(t, "TestDemocracyRewardsDistribution") + runDemocracyTestByName(t, "TestDemocracyRewardsDistribution") } func TestDemocracyGovernanceWhitelisting(t *testing.T) { - runConsumerDemocracyTestByName(t, "TestDemocracyGovernanceWhitelisting") + runDemocracyTestByName(t, "TestDemocracyGovernanceWhitelisting") } // From 264b1511d94ca41e871d72af0f69c7847a71a9be Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 12 May 2023 02:29:36 +0700 Subject: [PATCH 05/24] little more renaming --- app/democracy/ante/forbidden_proposals_ante_test.go | 4 ++-- docs/docs/consumer-development/app-integration.md | 2 +- docs/docs/consumer-development/consumer-chain-governance.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/democracy/ante/forbidden_proposals_ante_test.go b/app/democracy/ante/forbidden_proposals_ante_test.go index 7a1f26b3f3..ec6507378c 100644 --- a/app/democracy/ante/forbidden_proposals_ante_test.go +++ b/app/democracy/ante/forbidden_proposals_ante_test.go @@ -8,8 +8,8 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/params/types/proposal" - app "github.com/cosmos/interchain-security/app/consumer-democracy" - "github.com/cosmos/interchain-security/app/consumer-democracy/ante" + app "github.com/cosmos/interchain-security/app/democracy" + "github.com/cosmos/interchain-security/app/democracy/ante" "github.com/stretchr/testify/require" ) diff --git a/docs/docs/consumer-development/app-integration.md b/docs/docs/consumer-development/app-integration.md index 81d9141242..c8d32f5303 100644 --- a/docs/docs/consumer-development/app-integration.md +++ b/docs/docs/consumer-development/app-integration.md @@ -19,7 +19,7 @@ You should not need to manage or override any code from the `x/consumer` module. ## Democracy consumer chain -The source code for the example app can be found [here](https://github.com/cosmos/interchain-security/tree/main/app/consumer-democracy). +The source code for the example app can be found [here](https://github.com/cosmos/interchain-security/tree/main/app/democracy). This type of consumer chain wraps the basic CosmosSDK `x/distribution`, `x/staking` and `x/governance` modules allowing the consumer chain to perform democratic actions such as participating and voting within the chain's governance system. diff --git a/docs/docs/consumer-development/consumer-chain-governance.md b/docs/docs/consumer-development/consumer-chain-governance.md index ca99286d93..8188a42c4d 100644 --- a/docs/docs/consumer-development/consumer-chain-governance.md +++ b/docs/docs/consumer-development/consumer-chain-governance.md @@ -12,7 +12,7 @@ The democracy module provides a governance experience identical to what exists o Using the democracy module on a consumer chain is the exact same experience, except for the fact that it is not the actual validator set of the chain (since it is a consumer chain, these are the Cosmos Hub validators) acting as representatives. Instead, there is a separate representative role who token holders can delegate to and who can perform the functions that validators do in Cosmos governance, without participating in proof of stake consensus. -For an example, see the [Democracy Consumer](https://github.com/cosmos/interchain-security/tree/main/app/consumer-democracy) +For an example, see [Democracy](https://github.com/cosmos/interchain-security/tree/main/app/democracy) ## CosmWasm From 4ce51ff2cbd7d9c00e105b22da509fb2e44ec561 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 12 May 2023 02:30:13 +0700 Subject: [PATCH 06/24] lint markdown --- docs/docs/consumer-development/app-integration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/consumer-development/app-integration.md b/docs/docs/consumer-development/app-integration.md index c8d32f5303..cc9bea35c1 100644 --- a/docs/docs/consumer-development/app-integration.md +++ b/docs/docs/consumer-development/app-integration.md @@ -28,5 +28,5 @@ This allows the consumer chain to leverage those modules while also using the `x With these modules enabled, the consumer chain can mint its own governance tokens, which can then be delegated to prominent community members which are referred to as "representatives" (as opposed to "validators" in standalone chains). The token may have different use cases besides just voting on governance proposals. ## Standalone chain to consumer chain changeover -This feature is being actively worked on. Information will be provided at a later time. +This feature is being actively worked on. Information will be provided at a later time. From ea2df1317d492f5ea2e1b3f8cbf8d0a89bbc9012 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 14 May 2023 06:22:31 +0700 Subject: [PATCH 07/24] update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 40317b78ec..4f1e2e386f 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ install: go.sum export CGO_LDFLAGS="-Wl,-z,relro,-z,now -fstack-protector" go install $(BUILD_FLAGS) ./cmd/provider go install $(BUILD_FLAGS) ./cmd/consumer - go install $(BUILD_FLAGS) ./cmd/consumerd + go install $(BUILD_FLAGS) ./cmd/democracy # run all tests: unit, integration, diff, and E2E test: From c16d0ce15ae91224c88b3d8b8d13a9ecd2920957 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 14 May 2023 06:24:57 +0700 Subject: [PATCH 08/24] rename consumerdemocracy => democracy --- cmd/{consumerdemocracy => democracy}/cmd/genaccounts.go | 0 cmd/{consumerdemocracy => democracy}/cmd/root.go | 0 cmd/{consumerdemocracy => democracy}/main.go | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename cmd/{consumerdemocracy => democracy}/cmd/genaccounts.go (100%) rename cmd/{consumerdemocracy => democracy}/cmd/root.go (100%) rename cmd/{consumerdemocracy => democracy}/main.go (100%) diff --git a/cmd/consumerdemocracy/cmd/genaccounts.go b/cmd/democracy/cmd/genaccounts.go similarity index 100% rename from cmd/consumerdemocracy/cmd/genaccounts.go rename to cmd/democracy/cmd/genaccounts.go diff --git a/cmd/consumerdemocracy/cmd/root.go b/cmd/democracy/cmd/root.go similarity index 100% rename from cmd/consumerdemocracy/cmd/root.go rename to cmd/democracy/cmd/root.go diff --git a/cmd/consumerdemocracy/main.go b/cmd/democracy/main.go similarity index 100% rename from cmd/consumerdemocracy/main.go rename to cmd/democracy/main.go From e8cf68a22ea8c1b7f691affce25172323c748dfb Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 14 May 2023 06:28:27 +0700 Subject: [PATCH 09/24] complete renaming consumerdemocracy --- cmd/democracy/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/democracy/main.go b/cmd/democracy/main.go index f4433c0d16..7f9428efb3 100644 --- a/cmd/democracy/main.go +++ b/cmd/democracy/main.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" app "github.com/cosmos/interchain-security/app/democracy" - "github.com/cosmos/interchain-security/cmd/consumerdemocracy/cmd" + "github.com/cosmos/interchain-security/cmd/democracy/cmd" ) func main() { From e54ce99e557c34372e7fbf06641829ee93be97c7 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 14 May 2023 06:33:23 +0700 Subject: [PATCH 10/24] naming --- Dockerfile | 2 +- Dockerfile.gaia | 2 +- docs/docs/features/key-assignment.md | 16 ++++++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index eb6f23f719..f7b10c8f60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ COPY --from=hermes-builder /usr/bin/hermes /usr/local/bin/ COPY --from=is-builder /go/bin/provider /usr/local/bin/provider COPY --from=is-builder /go/bin/consumer /usr/local/bin/consumer -COPY --from=is-builder /go/bin/consumerd /usr/local/bin/consumerd +COPY --from=is-builder /go/bin/democracy /usr/local/bin/democracy # Copy in the shell scripts that run the testnet diff --git a/Dockerfile.gaia b/Dockerfile.gaia index fe9601f640..97b2e24ea8 100644 --- a/Dockerfile.gaia +++ b/Dockerfile.gaia @@ -73,7 +73,7 @@ COPY --from=hermes-builder /usr/bin/hermes /usr/local/bin/ # swap provider binary with gaia binary but keep the name COPY --from=gaia-builder /go/gaia/build/gaiad /usr/local/bin/provider COPY --from=is-builder /go/bin/consumer /usr/local/bin/consumer -COPY --from=is-builder /go/bin/consumerd /usr/local/bin/consumerd +COPY --from=is-builder /go/bin/democracy /usr/local/bin/democracy # Copy in the shell scripts that run the testnet diff --git a/docs/docs/features/key-assignment.md b/docs/docs/features/key-assignment.md index 54d93359a7..9d9246b4a3 100644 --- a/docs/docs/features/key-assignment.md +++ b/docs/docs/features/key-assignment.md @@ -3,6 +3,7 @@ sidebar_position: 1 --- # Key Assignment + Key Assignment (aka. as key delegation) allows validator operators to use different consensus keys for each consumer chain validator node that they operate. There are various reasons to use different consensus keys on different chains, but the main benefit is that validator's provider chain consensus key cannot be compromised if their consumer chain node (or other infrastructure) gets compromised. Interchain security module adds queries and transactions for assigning keys on consumer chains. @@ -14,28 +15,29 @@ By sending an `AssignConsumerKey` transaction, validators are able to indicate w Key assignment is handled only by the provider chain - the consumer chains are not aware of the fact that different consensus keys represent the same validator entity. ::: - ## Rules + - a key can be assigned before the consumer addition proposal passes on the provider - validator A cannot assign consumer key K to consumer chain X if there is already a validator B (B!=A) using K on the provider - validator A cannot assign consumer key K to consumer chain X if there is already a validator B using K on X - a new validator on the provider cannot use a consensus key K if K is already used by any validator on any consumer chain :::tip -Validators can use a different key for each consumer chain. +Validators can use a different key for each consumer chain. ::: - ## Adding a key First, create a new node on the consumer chain using the equivalent: + ```bash -consumerd init +consumer init ``` Then query your node for the consensus key. + ```bash -consumerd tendermint show-validator # {"@type":"/cosmos.crypto.ed25519.PubKey","key":""} +consumer tendermint show-validator # {"@type":"/cosmos.crypto.ed25519.PubKey","key":""} ``` Then, make an `assign-consensus-key` transaction on the provider chain in order to inform the provider chain about the consensus key you will be using for a specific consumer chain. @@ -48,6 +50,7 @@ gaiad tx provider assign-consensus-key '' --from "}` Check that the key was assigned correcly by querying the provider: + ```bash gaiad query provider validator-consumer-key cosmosvalcons1e....3xsj3ayzf4uv6 ``` @@ -63,8 +66,9 @@ gaiad query provider validator-provider-key consumervalcons1 You must use a `valcons` address. You can obtain it by querying your node on the consumer `consumerd tendermint show-address` ## Changing a key -To change your key, simply repeat all of the steps listed above. Take note that your old key will be remembered for at least the unbonding period of the consumer chain so any slashes can be correctly applied +To change your key, simply repeat all of the steps listed above. Take note that your old key will be remembered for at least the unbonding period of the consumer chain so any slashes can be correctly applied ## Removing a key + To remove a key, simply switch it back to the consensus key you have assigned on the provider chain by following steps in the `Adding a key` section and using your provider consensus key. From eb5992094e845a5e9f4a02661e33bc1a40ed5105 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 14 May 2023 06:33:40 +0700 Subject: [PATCH 11/24] naming --- docs/docs/features/key-assignment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/features/key-assignment.md b/docs/docs/features/key-assignment.md index 9d9246b4a3..4c8a919153 100644 --- a/docs/docs/features/key-assignment.md +++ b/docs/docs/features/key-assignment.md @@ -63,7 +63,7 @@ OR gaiad query provider validator-provider-key consumervalcons1e....123asdnoaisdao ``` -You must use a `valcons` address. You can obtain it by querying your node on the consumer `consumerd tendermint show-address` +You must use a `valcons` address. You can obtain it by querying your node on the consumer `consumer tendermint show-address` ## Changing a key From da12dadba67c3e32a68fe65728e550e0cb3c668d Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 14 May 2023 06:44:43 +0700 Subject: [PATCH 12/24] iprovider -> provider --- tests/e2e/config.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/e2e/config.go b/tests/e2e/config.go index a728d181dc..7fca000ece 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -150,7 +150,7 @@ func SlashThrottleTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "iprovider", + binaryName: "provider", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.voting_params.voting_period = \"20s\" | " + @@ -193,7 +193,7 @@ func DefaultTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "iprovider", + binaryName: "provider", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.voting_params.voting_period = \"20s\" | " + @@ -236,7 +236,7 @@ func DemocracyTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "iprovider", + binaryName: "provider", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.voting_params.voting_period = \"20s\" | " + @@ -279,7 +279,7 @@ func MultiConsumerTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "iprovider", + binaryName: "provider", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.voting_params.voting_period = \"20s\" | " + From 9252a6148a277387f89abcad814105f223029a31 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 25 Jun 2023 12:06:49 +0800 Subject: [PATCH 13/24] change binary names --- Dockerfile | 8 ++++---- Dockerfile.gaia | 8 ++++---- cmd/{consumer => consumerd}/cmd/root.go | 0 cmd/{consumer => consumerd}/main.go | 0 cmd/{democracy => democracyd}/cmd/root.go | 0 cmd/{democracy => democracyd}/main.go | 0 cmd/{provider => providerd}/cmd/root.go | 0 cmd/{provider => providerd}/main.go | 0 cmd/{sovereign => sovereignd}/cmd/root.go | 0 cmd/{sovereign => sovereignd}/main.go | 0 10 files changed, 8 insertions(+), 8 deletions(-) rename cmd/{consumer => consumerd}/cmd/root.go (100%) rename cmd/{consumer => consumerd}/main.go (100%) rename cmd/{democracy => democracyd}/cmd/root.go (100%) rename cmd/{democracy => democracyd}/main.go (100%) rename cmd/{provider => providerd}/cmd/root.go (100%) rename cmd/{provider => providerd}/main.go (100%) rename cmd/{sovereign => sovereignd}/cmd/root.go (100%) rename cmd/{sovereign => sovereignd}/main.go (100%) diff --git a/Dockerfile b/Dockerfile index 17aa111b53..7bfced2a41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,10 +46,10 @@ COPY --from=hermes-builder /usr/bin/hermes /usr/local/bin/ COPY --from=cometmock-builder /usr/local/bin/cometmock /usr/local/bin/cometmock COPY --from=gorelayer-builder /bin/rly /usr/local/bin/ -COPY --from=is-builder /go/bin/provider /usr/local/bin/provider -COPY --from=is-builder /go/bin/consumer /usr/local/bin/consumer -COPY --from=is-builder /go/bin/democracy /usr/local/bin/democracy -COPY --from=is-builder /go/bin/sovereign /usr/local/bin/sovereign +COPY --from=is-builder /go/bin/providerd /usr/local/bin/providerd +COPY --from=is-builder /go/bin/consumerd /usr/local/bin/consumerd +COPY --from=is-builder /go/bin/democracyd /usr/local/bin/democracyd +COPY --from=is-builder /go/bin/sovereignd /usr/local/bin/sovereignd diff --git a/Dockerfile.gaia b/Dockerfile.gaia index 792ea95c42..0ee50ce563 100644 --- a/Dockerfile.gaia +++ b/Dockerfile.gaia @@ -71,10 +71,10 @@ USER root COPY --from=hermes-builder /usr/bin/hermes /usr/local/bin/ # swap provider binary with gaia binary but keep the name -COPY --from=gaia-builder /go/gaia/build/gaiad /usr/local/bin/provider -COPY --from=is-builder /go/bin/consumer /usr/local/bin/consumer -COPY --from=is-builder /go/bin/democracy /usr/local/bin/democracy -COPY --from=is-builder /go/bin/sovereign /usr/local/bin/sovereign +COPY --from=gaia-builder /go/gaia/build/gaiad /usr/local/bin/providerd +COPY --from=is-builder /go/bin/consumerd /usr/local/bin/consumerd +COPY --from=is-builder /go/bin/democracyd /usr/local/bin/democracyd +COPY --from=is-builder /go/bin/sovereignd /usr/local/bin/sovereignd diff --git a/cmd/consumer/cmd/root.go b/cmd/consumerd/cmd/root.go similarity index 100% rename from cmd/consumer/cmd/root.go rename to cmd/consumerd/cmd/root.go diff --git a/cmd/consumer/main.go b/cmd/consumerd/main.go similarity index 100% rename from cmd/consumer/main.go rename to cmd/consumerd/main.go diff --git a/cmd/democracy/cmd/root.go b/cmd/democracyd/cmd/root.go similarity index 100% rename from cmd/democracy/cmd/root.go rename to cmd/democracyd/cmd/root.go diff --git a/cmd/democracy/main.go b/cmd/democracyd/main.go similarity index 100% rename from cmd/democracy/main.go rename to cmd/democracyd/main.go diff --git a/cmd/provider/cmd/root.go b/cmd/providerd/cmd/root.go similarity index 100% rename from cmd/provider/cmd/root.go rename to cmd/providerd/cmd/root.go diff --git a/cmd/provider/main.go b/cmd/providerd/main.go similarity index 100% rename from cmd/provider/main.go rename to cmd/providerd/main.go diff --git a/cmd/sovereign/cmd/root.go b/cmd/sovereignd/cmd/root.go similarity index 100% rename from cmd/sovereign/cmd/root.go rename to cmd/sovereignd/cmd/root.go diff --git a/cmd/sovereign/main.go b/cmd/sovereignd/main.go similarity index 100% rename from cmd/sovereign/main.go rename to cmd/sovereignd/main.go From b42a452f81b4b7d4fd3c367c85fb8c05d1bc3abc Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 25 Jun 2023 12:29:39 +0800 Subject: [PATCH 14/24] correct the import paths --- cmd/consumerd/main.go | 2 +- cmd/democracyd/main.go | 2 +- cmd/providerd/main.go | 2 +- cmd/sovereignd/main.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/consumerd/main.go b/cmd/consumerd/main.go index d2f8f8994e..4925ea1419 100644 --- a/cmd/consumerd/main.go +++ b/cmd/consumerd/main.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" app "github.com/cosmos/interchain-security/v3/app/consumer" - "github.com/cosmos/interchain-security/v3/cmd/consumer/cmd" + "github.com/cosmos/interchain-security/v3/cmd/consumerd/cmd" ) func main() { diff --git a/cmd/democracyd/main.go b/cmd/democracyd/main.go index 2034f00b33..10437cd00d 100644 --- a/cmd/democracyd/main.go +++ b/cmd/democracyd/main.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" app "github.com/cosmos/interchain-security/v3/app/democracy" - "github.com/cosmos/interchain-security/v3/cmd/democracy/cmd" + "github.com/cosmos/interchain-security/v3/cmd/democracyd/cmd" ) func main() { diff --git a/cmd/providerd/main.go b/cmd/providerd/main.go index 95d715a906..2b7a9d3b63 100644 --- a/cmd/providerd/main.go +++ b/cmd/providerd/main.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" app "github.com/cosmos/interchain-security/v3/app/provider" - "github.com/cosmos/interchain-security/v3/cmd/provider/cmd" + "github.com/cosmos/interchain-security/v3/cmd/providerd/cmd" ) func main() { diff --git a/cmd/sovereignd/main.go b/cmd/sovereignd/main.go index cd55bb9c6d..ce0e7c470d 100644 --- a/cmd/sovereignd/main.go +++ b/cmd/sovereignd/main.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" app "github.com/cosmos/interchain-security/v3/app/sovereign" - "github.com/cosmos/interchain-security/v3/cmd/sovereign/cmd" + "github.com/cosmos/interchain-security/v3/cmd/sovereignd/cmd" ) func main() { From fc31f8afaee0aa71a796f0f4f42434359a389a39 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 25 Jun 2023 12:48:59 +0800 Subject: [PATCH 15/24] correct naming issues --- docs/docs/features/key-assignment.md | 6 +++--- tests/e2e/config.go | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/docs/features/key-assignment.md b/docs/docs/features/key-assignment.md index a92f78c46c..c68343255c 100644 --- a/docs/docs/features/key-assignment.md +++ b/docs/docs/features/key-assignment.md @@ -31,13 +31,13 @@ Validators can use a different key for each consumer chain. First, create a new node on the consumer chain using the equivalent: ```bash -consumer init +consumerd init ``` Then query your node for the consensus key. ```bash -consumer tendermint show-validator # {"@type":"/cosmos.crypto.ed25519.PubKey","key":""} +consumerd tendermint show-validator # {"@type":"/cosmos.crypto.ed25519.PubKey","key":""} ``` Then, make an `assign-consensus-key` transaction on the provider chain in order to inform the provider chain about the consensus key you will be using for a specific consumer chain. @@ -63,7 +63,7 @@ OR gaiad query provider validator-provider-key consumervalcons1e....123asdnoaisdao ``` -You must use a `valcons` address. You can obtain it by querying your node on the consumer `consumer tendermint show-address` +You must use a `valcons` address. You can obtain it by querying your node on the consumer `consumerd tendermint show-address` ## Changing a key diff --git a/tests/e2e/config.go b/tests/e2e/config.go index c97d822101..a40f3732ba 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -164,7 +164,7 @@ func SlashThrottleTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "provider", + binaryName: "providerd", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -179,7 +179,7 @@ func SlashThrottleTestRun() TestRun { }, chainID("consu"): { chainId: chainID("consu"), - binaryName: "consumer", + binaryName: "consumerd", ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -209,7 +209,7 @@ func DefaultTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "provider", + binaryName: "providerd", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -224,7 +224,7 @@ func DefaultTestRun() TestRun { }, chainID("consu"): { chainId: chainID("consu"), - binaryName: "consumer", + binaryName: "consumerd", ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -255,7 +255,7 @@ func DemocracyTestRun(allowReward bool) TestRun { } tr := TestRun{ - name: "democracy", + name: "democracyd", containerConfig: ContainerConfig{ containerName: "interchain-security-democ-container", instanceName: "interchain-security-democ-instance", @@ -266,7 +266,7 @@ func DemocracyTestRun(allowReward bool) TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "provider", + binaryName: "providerd", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -280,7 +280,7 @@ func DemocracyTestRun(allowReward bool) TestRun { }, chainID("democ"): { chainId: chainID("democ"), - binaryName: "democracy", + binaryName: "democracyd", ipPrefix: "7.7.9", votingWaitTime: 20, genesisChanges: consumerGenChanges, @@ -306,7 +306,7 @@ func MultiConsumerTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "provider", + binaryName: "providerd", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"30s\" | " + @@ -320,7 +320,7 @@ func MultiConsumerTestRun() TestRun { }, chainID("consu"): { chainId: chainID("consu"), - binaryName: "consumer", + binaryName: "consumerd", ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -331,7 +331,7 @@ func MultiConsumerTestRun() TestRun { }, chainID("densu"): { chainId: chainID("densu"), - binaryName: "consumer", + binaryName: "consumerd", ipPrefix: "7.7.9", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + From f17cde693673605efabe4764c1307335cef5f321 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 25 Jun 2023 13:04:26 +0800 Subject: [PATCH 16/24] Revert "correct naming issues" This reverts commit fc31f8afaee0aa71a796f0f4f42434359a389a39. --- docs/docs/features/key-assignment.md | 6 +++--- tests/e2e/config.go | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/docs/features/key-assignment.md b/docs/docs/features/key-assignment.md index c68343255c..a92f78c46c 100644 --- a/docs/docs/features/key-assignment.md +++ b/docs/docs/features/key-assignment.md @@ -31,13 +31,13 @@ Validators can use a different key for each consumer chain. First, create a new node on the consumer chain using the equivalent: ```bash -consumerd init +consumer init ``` Then query your node for the consensus key. ```bash -consumerd tendermint show-validator # {"@type":"/cosmos.crypto.ed25519.PubKey","key":""} +consumer tendermint show-validator # {"@type":"/cosmos.crypto.ed25519.PubKey","key":""} ``` Then, make an `assign-consensus-key` transaction on the provider chain in order to inform the provider chain about the consensus key you will be using for a specific consumer chain. @@ -63,7 +63,7 @@ OR gaiad query provider validator-provider-key consumervalcons1e....123asdnoaisdao ``` -You must use a `valcons` address. You can obtain it by querying your node on the consumer `consumerd tendermint show-address` +You must use a `valcons` address. You can obtain it by querying your node on the consumer `consumer tendermint show-address` ## Changing a key diff --git a/tests/e2e/config.go b/tests/e2e/config.go index a40f3732ba..c97d822101 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -164,7 +164,7 @@ func SlashThrottleTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "providerd", + binaryName: "provider", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -179,7 +179,7 @@ func SlashThrottleTestRun() TestRun { }, chainID("consu"): { chainId: chainID("consu"), - binaryName: "consumerd", + binaryName: "consumer", ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -209,7 +209,7 @@ func DefaultTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "providerd", + binaryName: "provider", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -224,7 +224,7 @@ func DefaultTestRun() TestRun { }, chainID("consu"): { chainId: chainID("consu"), - binaryName: "consumerd", + binaryName: "consumer", ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -255,7 +255,7 @@ func DemocracyTestRun(allowReward bool) TestRun { } tr := TestRun{ - name: "democracyd", + name: "democracy", containerConfig: ContainerConfig{ containerName: "interchain-security-democ-container", instanceName: "interchain-security-democ-instance", @@ -266,7 +266,7 @@ func DemocracyTestRun(allowReward bool) TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "providerd", + binaryName: "provider", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -280,7 +280,7 @@ func DemocracyTestRun(allowReward bool) TestRun { }, chainID("democ"): { chainId: chainID("democ"), - binaryName: "democracyd", + binaryName: "democracy", ipPrefix: "7.7.9", votingWaitTime: 20, genesisChanges: consumerGenChanges, @@ -306,7 +306,7 @@ func MultiConsumerTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "providerd", + binaryName: "provider", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"30s\" | " + @@ -320,7 +320,7 @@ func MultiConsumerTestRun() TestRun { }, chainID("consu"): { chainId: chainID("consu"), - binaryName: "consumerd", + binaryName: "consumer", ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -331,7 +331,7 @@ func MultiConsumerTestRun() TestRun { }, chainID("densu"): { chainId: chainID("densu"), - binaryName: "consumerd", + binaryName: "consumer", ipPrefix: "7.7.9", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + From 3857757ada70017bf8ac65023ca4d42cacb3b240 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 25 Jun 2023 13:11:17 +0800 Subject: [PATCH 17/24] change binaryNames --- Makefile | 8 ++++---- tests/e2e/config.go | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 4d28ab339c..ab17d528c3 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,10 @@ install: go.sum export GOFLAGS='-buildmode=pie' export CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2" export CGO_LDFLAGS="-Wl,-z,relro,-z,now -fstack-protector" - go install $(BUILD_FLAGS) ./cmd/provider - go install $(BUILD_FLAGS) ./cmd/consumer - go install $(BUILD_FLAGS) ./cmd/democracy - go install $(BUILD_FLAGS) ./cmd/sovereign + go install $(BUILD_FLAGS) ./cmd/providerd + go install $(BUILD_FLAGS) ./cmd/consumerd + go install $(BUILD_FLAGS) ./cmd/democracyd + go install $(BUILD_FLAGS) ./cmd/sovereignd diff --git a/tests/e2e/config.go b/tests/e2e/config.go index c97d822101..0b0c9d3f64 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -164,7 +164,7 @@ func SlashThrottleTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "provider", + binaryName: "providerd", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -179,7 +179,7 @@ func SlashThrottleTestRun() TestRun { }, chainID("consu"): { chainId: chainID("consu"), - binaryName: "consumer", + binaryName: "consumerd", ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -209,7 +209,7 @@ func DefaultTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "provider", + binaryName: "providerd", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -224,7 +224,7 @@ func DefaultTestRun() TestRun { }, chainID("consu"): { chainId: chainID("consu"), - binaryName: "consumer", + binaryName: "consumerd", ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -266,7 +266,7 @@ func DemocracyTestRun(allowReward bool) TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "provider", + binaryName: "providerd", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -280,7 +280,7 @@ func DemocracyTestRun(allowReward bool) TestRun { }, chainID("democ"): { chainId: chainID("democ"), - binaryName: "democracy", + binaryName: "democracyd", ipPrefix: "7.7.9", votingWaitTime: 20, genesisChanges: consumerGenChanges, @@ -306,7 +306,7 @@ func MultiConsumerTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "provider", + binaryName: "providerd", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"30s\" | " + @@ -320,7 +320,7 @@ func MultiConsumerTestRun() TestRun { }, chainID("consu"): { chainId: chainID("consu"), - binaryName: "consumer", + binaryName: "consumerd", ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -331,7 +331,7 @@ func MultiConsumerTestRun() TestRun { }, chainID("densu"): { chainId: chainID("densu"), - binaryName: "consumer", + binaryName: "consumerd", ipPrefix: "7.7.9", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + From f548031c31d13bd3d256b229c47d3172c631b5fc Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sun, 25 Jun 2023 13:16:33 +0800 Subject: [PATCH 18/24] change two more names --- tests/e2e/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/config.go b/tests/e2e/config.go index 0b0c9d3f64..f2b1e665df 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -361,7 +361,7 @@ func ChangeoverTestRun() TestRun { chainConfigs: map[chainID]ChainConfig{ chainID("provi"): { chainId: chainID("provi"), - binaryName: "interchain-security-pd", + binaryName: "providerd", ipPrefix: "7.7.7", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + @@ -376,8 +376,8 @@ func ChangeoverTestRun() TestRun { }, chainID("sover"): { chainId: chainID("sover"), - binaryName: "interchain-security-sd", - upgradeBinary: "interchain-security-cdd", + binaryName: "sovereignd", + upgradeBinary: "consumerd", ipPrefix: "7.7.8", votingWaitTime: 20, genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + From 6a9b0f3a8eb1e440539e19e1619839a81be167de Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 7 Jul 2023 00:52:01 +0800 Subject: [PATCH 19/24] Update README.md Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4adbaba46a..ce238c9dc4 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ brew install jq # install provider and consumer binaries make install # run provider -provider +providerd # run consumer consumer # (if the above fail, ensure ~/go/bin on $PATH) From 4751d0bee68d242128c26112e22d3b836ec720b2 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 7 Jul 2023 00:52:14 +0800 Subject: [PATCH 20/24] Update README.md Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ce238c9dc4..5f94bb9eea 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ make install # run provider providerd # run consumer -consumer +consumerd # (if the above fail, ensure ~/go/bin on $PATH) export PATH=$PATH:$(go env GOPATH)/bin ``` From a322178f15ee05ce72676c2be3e5f301d11f9231 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 7 Jul 2023 00:52:33 +0800 Subject: [PATCH 21/24] Update app/democracy/app.go Co-authored-by: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> --- app/democracy/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/democracy/app.go b/app/democracy/app.go index 77f07551d7..255089eb53 100644 --- a/app/democracy/app.go +++ b/app/democracy/app.go @@ -119,7 +119,7 @@ import ( ) const ( - AppName = "democracy" + AppName = "democracyd" upgradeName = "sovereign-changeover" // arbitrary name, define your own appropriately named upgrade AccountAddressPrefix = "cosmos" ) From 492f4bfdb2fe9b2048b3093b040db18a546cb719 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Fri, 7 Jul 2023 00:59:31 +0800 Subject: [PATCH 22/24] Update key-assignment.md restore d's --- docs/docs/features/key-assignment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/features/key-assignment.md b/docs/docs/features/key-assignment.md index a92f78c46c..20e90d57f2 100644 --- a/docs/docs/features/key-assignment.md +++ b/docs/docs/features/key-assignment.md @@ -31,13 +31,13 @@ Validators can use a different key for each consumer chain. First, create a new node on the consumer chain using the equivalent: ```bash -consumer init +consumerd init ``` Then query your node for the consensus key. ```bash -consumer tendermint show-validator # {"@type":"/cosmos.crypto.ed25519.PubKey","key":""} +consumerd tendermint show-validator # {"@type":"/cosmos.crypto.ed25519.PubKey","key":""} ``` Then, make an `assign-consensus-key` transaction on the provider chain in order to inform the provider chain about the consensus key you will be using for a specific consumer chain. From b1a20b97ac2e8e1e8fa9ba12a0463ab149268543 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Sat, 16 Sep 2023 12:01:12 +0800 Subject: [PATCH 23/24] fix naming issues --- tests/integration/instance_test.go | 2 +- testutil/integration/debug_test.go | 2 +- x/ccv/provider/keeper/proposal_test.go | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/integration/instance_test.go b/tests/integration/instance_test.go index e881218680..c8ea6c88e0 100644 --- a/tests/integration/instance_test.go +++ b/tests/integration/instance_test.go @@ -52,7 +52,7 @@ func TestDemocracyTestSuite(t *testing.T) { // Pass in concrete app type that implement the interface defined in /testutil/e2e/interfaces.go // IMPORTANT: the concrete app type passed in as a type parameter here must match the // concrete app type returned by the relevant app initer. - democSuite := intg.NewDemocracyTestSuite[*appDemocracy.App]( + democSuite := intg.NewConsumerDemocracyTestSuite[*appDemocracy.App]( // Pass in ibctesting.AppIniter for democracy consumer. icstestingutils.DemocracyConsumerAppIniter) diff --git a/testutil/integration/debug_test.go b/testutil/integration/debug_test.go index 097017c86c..e68bb5aa60 100644 --- a/testutil/integration/debug_test.go +++ b/testutil/integration/debug_test.go @@ -30,7 +30,7 @@ func runCCVTestByName(t *testing.T, methodName string) { // democracy consumer defined in this repo. func runConsumerDemocracyTestByName(t *testing.T, methodName string) { t.Helper() - suite := integr.NewDemocracyTestSuite[*appConsumerDemocracy.App]( + suite := integr.NewConsumerDemocracyTestSuite[*appConsumerDemocracy.App]( icstestingutils.DemocracyConsumerAppIniter) suite.SetT(t) suite.SetupTest() diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 135e16eaae..74ec7fbe6e 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -232,6 +232,7 @@ func TestPendingConsumerAdditionPropDeletion(t *testing.T) { defer ctrl.Finish() for _, tc := range testCases { + tc := tc providerKeeper.SetPendingConsumerAdditionProp(ctx, &tc.ConsumerAdditionProposal) } @@ -603,6 +604,7 @@ func TestPendingConsumerRemovalPropDeletion(t *testing.T) { defer ctrl.Finish() for _, tc := range testCases { + tc := tc providerKeeper.SetPendingConsumerRemovalProp(ctx, &tc.ConsumerRemovalProposal) } From 838fb50039633da5afb970ef35b5702e66717ab6 Mon Sep 17 00:00:00 2001 From: Jacob Gadikian Date: Mon, 1 Jan 2024 17:41:23 +0700 Subject: [PATCH 24/24] complete merge --- tests/e2e/config.go | 132 ++---------------- .../consumer/migrations/v2/migration_test.go | 1 + .../provider/migrations/v3/migration_test.go | 32 ++--- x/ccv/provider/migrations/v3/migrations.go | 4 +- x/ccv/provider/types/codec.go | 5 +- 5 files changed, 37 insertions(+), 137 deletions(-) diff --git a/tests/e2e/config.go b/tests/e2e/config.go index aeba23430c..f6f16f650c 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -161,23 +161,14 @@ func SlashThrottleTestConfig() TestConfig { Now: time.Now(), }, validatorConfigs: getDefaultValidators(), -<<<<<<< HEAD - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "providerd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= + chainConfigs: map[ChainID]ChainConfig{ ChainID("provi"): { ChainId: ChainID("provi"), - BinaryName: "interchain-security-pd", + BinaryName: "providerd", IpPrefix: "7.7.7", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -187,21 +178,13 @@ func SlashThrottleTestConfig() TestConfig { ".app_state.provider.params.slash_meter_replenish_fraction = \"0.10\" | " + ".app_state.provider.params.slash_meter_replenish_period = \"20s\"", }, -<<<<<<< HEAD - chainID("consu"): { - chainId: chainID("consu"), - binaryName: "consumerd", - ipPrefix: "7.7.8", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= + ChainID("consu"): { ChainId: ChainID("consu"), - BinaryName: "interchain-security-cd", + BinaryName: "consumerd", IpPrefix: "7.7.8", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main ".app_state.slashing.params.signed_blocks_window = \"15\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -226,23 +209,13 @@ func DefaultTestConfig() TestConfig { Now: time.Now(), }, validatorConfigs: getDefaultValidators(), -<<<<<<< HEAD - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "providerd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= chainConfigs: map[ChainID]ChainConfig{ ChainID("provi"): { ChainId: ChainID("provi"), - BinaryName: "interchain-security-pd", + BinaryName: "providerd", IpPrefix: "7.7.7", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -252,21 +225,12 @@ func DefaultTestConfig() TestConfig { ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\" | " + // This disables slash packet throttling ".app_state.provider.params.slash_meter_replenish_period = \"3s\"", }, -<<<<<<< HEAD - chainID("consu"): { - chainId: chainID("consu"), - binaryName: "consumerd", - ipPrefix: "7.7.8", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= ChainID("consu"): { ChainId: ChainID("consu"), - BinaryName: "interchain-security-cd", + BinaryName: "consumerd", IpPrefix: "7.7.8", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main ".app_state.slashing.params.signed_blocks_window = \"15\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -303,23 +267,13 @@ func DemocracyTestConfig(allowReward bool) TestConfig { Now: time.Now(), }, validatorConfigs: getDefaultValidators(), -<<<<<<< HEAD - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "providerd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= chainConfigs: map[ChainID]ChainConfig{ ChainID("provi"): { ChainId: ChainID("provi"), - BinaryName: "interchain-security-pd", + BinaryName: "providerd", IpPrefix: "7.7.7", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -328,21 +282,12 @@ func DemocracyTestConfig(allowReward bool) TestConfig { ".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\" | " + ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\"", // This disables slash packet throttling }, -<<<<<<< HEAD - chainID("democ"): { - chainId: chainID("democ"), - binaryName: "democracyd", - ipPrefix: "7.7.9", - votingWaitTime: 20, - genesisChanges: consumerGenChanges, -======= ChainID("democ"): { ChainId: ChainID("democ"), - BinaryName: "interchain-security-cdd", + BinaryName: "democracyd", IpPrefix: "7.7.9", VotingWaitTime: 20, GenesisChanges: consumerGenChanges, ->>>>>>> origin/main }, }, tendermintConfigOverride: `s/timeout_commit = "5s"/timeout_commit = "1s"/;` + @@ -362,23 +307,13 @@ func MultiConsumerTestConfig() TestConfig { Now: time.Now(), }, validatorConfigs: getDefaultValidators(), -<<<<<<< HEAD - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "providerd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"30s\" | " + -======= chainConfigs: map[ChainID]ChainConfig{ ChainID("provi"): { ChainId: ChainID("provi"), - BinaryName: "interchain-security-pd", + BinaryName: "providerd", IpPrefix: "7.7.7", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"30s\" | " + ->>>>>>> origin/main // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -387,41 +322,24 @@ func MultiConsumerTestConfig() TestConfig { ".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\" | " + ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\"", // This disables slash packet throttling }, -<<<<<<< HEAD - chainID("consu"): { - chainId: chainID("consu"), - binaryName: "consumerd", - ipPrefix: "7.7.8", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= ChainID("consu"): { ChainId: ChainID("consu"), - BinaryName: "interchain-security-cd", + BinaryName: "consumerd", IpPrefix: "7.7.8", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main ".app_state.slashing.params.signed_blocks_window = \"10\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + ".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\"", }, -<<<<<<< HEAD - chainID("densu"): { - chainId: chainID("densu"), - binaryName: "consumerd", - ipPrefix: "7.7.9", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= + ChainID("densu"): { ChainId: ChainID("densu"), - BinaryName: "interchain-security-cd", + BinaryName: "consumerd", IpPrefix: "7.7.9", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main ".app_state.slashing.params.signed_blocks_window = \"10\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + @@ -445,23 +363,13 @@ func ChangeoverTestConfig() TestConfig { Now: time.Now(), }, validatorConfigs: getDefaultValidators(), -<<<<<<< HEAD - chainConfigs: map[chainID]ChainConfig{ - chainID("provi"): { - chainId: chainID("provi"), - binaryName: "providerd", - ipPrefix: "7.7.7", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= chainConfigs: map[ChainID]ChainConfig{ ChainID("provi"): { ChainId: ChainID("provi"), - BinaryName: "interchain-security-pd", + BinaryName: "providerd", IpPrefix: "7.7.7", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main // Custom slashing parameters for testing validator downtime functionality // See https://docs.cosmos.network/main/modules/slashing/04_begin_block.html#uptime-tracking ".app_state.slashing.params.signed_blocks_window = \"10\" | " + @@ -471,23 +379,13 @@ func ChangeoverTestConfig() TestConfig { ".app_state.provider.params.slash_meter_replenish_fraction = \"1.0\" | " + // This disables slash packet throttling ".app_state.provider.params.slash_meter_replenish_period = \"3s\"", }, -<<<<<<< HEAD - chainID("sover"): { - chainId: chainID("sover"), - binaryName: "sovereignd", - upgradeBinary: "consumerd", - ipPrefix: "7.7.8", - votingWaitTime: 20, - genesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + -======= ChainID("sover"): { ChainId: ChainID("sover"), - BinaryName: "interchain-security-sd", - UpgradeBinary: "interchain-security-cdd", + BinaryName: "sovereignd", + UpgradeBinary: "consumerd", IpPrefix: "7.7.8", VotingWaitTime: 20, GenesisChanges: ".app_state.gov.params.voting_period = \"20s\" | " + ->>>>>>> origin/main ".app_state.slashing.params.signed_blocks_window = \"15\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + diff --git a/x/ccv/consumer/migrations/v2/migration_test.go b/x/ccv/consumer/migrations/v2/migration_test.go index 94193cc1f2..1d54127442 100644 --- a/x/ccv/consumer/migrations/v2/migration_test.go +++ b/x/ccv/consumer/migrations/v2/migration_test.go @@ -8,6 +8,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + testutil "github.com/cosmos/interchain-security/v3/testutil/keeper" v2 "github.com/cosmos/interchain-security/v3/x/ccv/consumer/migrations/v2" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" diff --git a/x/ccv/provider/migrations/v3/migration_test.go b/x/ccv/provider/migrations/v3/migration_test.go index d82fb3c904..40b93122ae 100644 --- a/x/ccv/provider/migrations/v3/migration_test.go +++ b/x/ccv/provider/migrations/v3/migration_test.go @@ -19,41 +19,41 @@ func TestMigrate2To3(t *testing.T) { providerKeeper.SetConsumerClientId(ctx, "chain-3", "client-3") // Queue some data for chain-1 - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-1", 66, testutil.GetNewSlashPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-1", 67, testutil.GetNewVSCMaturedPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-1", 68, testutil.GetNewSlashPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-1", 69, testutil.GetNewVSCMaturedPacketData()) // Queue some data for chain-2 - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-2", 789, testutil.GetNewVSCMaturedPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-2", 790, testutil.GetNewSlashPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-2", 791, testutil.GetNewVSCMaturedPacketData()) // Queue some data for chain-3 - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-3", 123, testutil.GetNewSlashPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-3", 124, testutil.GetNewVSCMaturedPacketData()) - providerKeeper.LegacyQueueThrottledPacketData( //nolint:staticcheck // SA1019: used in migration tests + providerKeeper.LegacyQueueThrottledPacketData( ctx, "chain-3", 125, testutil.GetNewVSCMaturedPacketData()) // Confirm getter methods return expected values - slash1, vscm1 := providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-1") //nolint:staticcheck // SA1019: used in migration tests + slash1, vscm1 := providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-1") require.Len(t, slash1, 2) require.Len(t, vscm1, 2) - slash2, vscm2 := providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-2") //nolint:staticcheck // SA1019: used in migration tests + slash2, vscm2 := providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-2") require.Len(t, slash2, 1) require.Len(t, vscm2, 2) - slash3, vscm3 := providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-3") //nolint:staticcheck // SA1019: used in migration tests + slash3, vscm3 := providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-3") require.Len(t, slash3, 1) require.Len(t, vscm3, 2) @@ -91,13 +91,13 @@ func TestMigrate2To3(t *testing.T) { require.NoError(t, err) // Confirm throttled data is now deleted - slash1, vscm1 = providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-1") //nolint:staticcheck // SA1019: used in migration tests + slash1, vscm1 = providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-1") require.Empty(t, slash1) require.Empty(t, vscm1) - slash2, vscm2 = providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-2") //nolint:staticcheck // SA1019: used in migration tests + slash2, vscm2 = providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-2") require.Empty(t, slash2) require.Empty(t, vscm2) - slash3, vscm3 = providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-3") //nolint:staticcheck // SA1019: used in migration tests + slash3, vscm3 = providerKeeper.LegacyGetAllThrottledPacketData(ctx, "chain-3") require.Empty(t, slash3) require.Empty(t, vscm3) diff --git a/x/ccv/provider/migrations/v3/migrations.go b/x/ccv/provider/migrations/v3/migrations.go index 0022d4584a..f07b85565e 100644 --- a/x/ccv/provider/migrations/v3/migrations.go +++ b/x/ccv/provider/migrations/v3/migrations.go @@ -12,14 +12,14 @@ import ( // on the provider in the v2 consensus version (jail throttling v1). func MigrateQueuedPackets(ctx sdk.Context, k providerkeeper.Keeper) error { for _, consumer := range k.GetAllConsumerChains(ctx) { - slashData, vscmData := k.LegacyGetAllThrottledPacketData(ctx, consumer.ChainId) //nolint:staticcheck // SA1019: function used for migration + slashData, vscmData := k.LegacyGetAllThrottledPacketData(ctx, consumer.ChainId) if len(slashData) > 0 { k.Logger(ctx).Error(fmt.Sprintf("slash data being dropped: %v", slashData)) } for _, data := range vscmData { k.HandleVSCMaturedPacket(ctx, consumer.ChainId, data) } - k.LegacyDeleteThrottledPacketDataForConsumer(ctx, consumer.ChainId) //nolint:staticcheck // SA1019: function used for migration + k.LegacyDeleteThrottledPacketDataForConsumer(ctx, consumer.ChainId) } return nil } diff --git a/x/ccv/provider/types/codec.go b/x/ccv/provider/types/codec.go index 6ab621f0e1..e5900bcf04 100644 --- a/x/ccv/provider/types/codec.go +++ b/x/ccv/provider/types/codec.go @@ -1,13 +1,14 @@ package types import ( + "github.com/cosmos/ibc-go/v7/modules/core/exported" + tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/cosmos/ibc-go/v7/modules/core/exported" - tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" ) // RegisterLegacyAminoCodec registers the necessary x/ibc transfer interfaces and concrete types