Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify naming #925

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2e3c17f
simplify naming
faddat May 7, 2023
a065680
more simplification
faddat May 8, 2023
6c23de4
Merge branch 'main' into short-name-less-typing
faddat May 9, 2023
ee13d11
Merge branch 'main' into short-name-less-typing
faddat May 11, 2023
e63fdad
complete the renaming
faddat May 11, 2023
d33a660
consumer-democracy => democracy, interchain-security-cd => consumer
faddat May 11, 2023
264b151
little more renaming
faddat May 11, 2023
4ce51ff
lint markdown
faddat May 11, 2023
ea2df13
update Makefile
faddat May 13, 2023
c16d0ce
rename consumerdemocracy => democracy
faddat May 13, 2023
e8cf68a
complete renaming consumerdemocracy
faddat May 13, 2023
e54ce99
naming
faddat May 13, 2023
eb59920
naming
faddat May 13, 2023
da12dad
iprovider -> provider
faddat May 13, 2023
b888529
Merge remote-tracking branch 'origin/main' into short-name-less-typing
faddat Jun 18, 2023
be276b5
Merge branch 'main' into short-name-less-typing
faddat Jun 19, 2023
44ed531
Merge remote-tracking branch 'origin/main' into short-name-less-typing
faddat Jun 23, 2023
02932a8
Merge branch 'main' into short-name-less-typing
faddat Jun 25, 2023
9252a61
change binary names
faddat Jun 25, 2023
b42a452
correct the import paths
faddat Jun 25, 2023
fc31f8a
correct naming issues
faddat Jun 25, 2023
f17cde6
Revert "correct naming issues"
faddat Jun 25, 2023
3857757
change binaryNames
faddat Jun 25, 2023
f548031
change two more names
faddat Jun 25, 2023
4234534
Merge branch 'main' into short-name-less-typing
faddat Jul 3, 2023
4ff94d0
Merge remote-tracking branch 'origin/main' into short-name-less-typing
faddat Jul 6, 2023
6a9b0f3
Update README.md
faddat Jul 6, 2023
4751d0b
Update README.md
faddat Jul 6, 2023
a322178
Update app/democracy/app.go
faddat Jul 6, 2023
3de445f
Merge branch 'main' into short-name-less-typing
faddat Jul 6, 2023
492f4bf
Update key-assignment.md
faddat Jul 6, 2023
0a26b28
Merge branch 'short-name-less-typing' of https://github.com/notional-…
faddat Aug 13, 2023
14b95bc
Merge remote-tracking branch 'origin/main' into short-name-less-typing
faddat Aug 13, 2023
c84191a
Merge remote-tracking branch 'origin/main' into short-name-less-typing
faddat Aug 20, 2023
59471df
Merge remote-tracking branch 'origin/main' into short-name-less-typing
faddat Sep 16, 2023
b1a20b9
fix naming issues
faddat Sep 16, 2023
b378536
Merge remote-tracking branch 'origin/main' into short-name-less-typing
faddat Jan 1, 2024
838fb50
complete merge
faddat Jan 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ 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/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/interchain-security-sd /usr/local/bin/interchain-security-sd
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also change sovereign to standalone? Calling a non-ICS chain sovereign, entails that consumer chains don't have sovereignty, which is not true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I'm good with this change sir





# Copy in the shell scripts that run the testnet
ADD ./tests/e2e/testnet-scripts /testnet-scripts
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile.gaia
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ 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
COPY --from=is-builder /go/bin/interchain-security-sd /usr/local/bin/interchain-security-sd
# swap provider binary with gaia binary but keep the name
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



# Copy in the shell scripts that run the testnet
ADD ./tests/e2e/testnet-scripts /testnet-scripts
Expand Down
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ 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/interchain-security-sd
go install $(BUILD_FLAGS) ./cmd/providerd
go install $(BUILD_FLAGS) ./cmd/consumerd
go install $(BUILD_FLAGS) ./cmd/democracyd
go install $(BUILD_FLAGS) ./cmd/sovereignd



# run all tests: unit, integration, diff, and E2E
test:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For more details on the Replicated Security protocol, take a look at the [docs](

## Instructions

**Prerequisites**
### Prerequisites

```bash
## For OSX or Linux
Expand All @@ -26,15 +26,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
faddat marked this conversation as resolved.
Show resolved Hide resolved
# run consumer
interchain-security-cd
consumer
faddat marked this conversation as resolved.
Show resolved Hide resolved
# (if the above fail, ensure ~/go/bin on $PATH)
export PATH=$PATH:$(go env GOPATH)/bin
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
"github.com/cosmos/cosmos-sdk/x/params/types/proposal"
app "github.com/cosmos/interchain-security/v3/app/consumer-democracy"
"github.com/cosmos/interchain-security/v3/app/consumer-democracy/ante"
app "github.com/cosmos/interchain-security/v3/app/democracy"
"github.com/cosmos/interchain-security/v3/app/democracy/ante"
"github.com/stretchr/testify/require"

ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/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"
democracyante "github.com/cosmos/interchain-security/v3/app/democracy/ante"
ibcconsumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper"
)

Expand Down
2 changes: 1 addition & 1 deletion app/consumer-democracy/app.go → app/democracy/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ import (
)

const (
AppName = "interchain-security-cd"
AppName = "democracy"
faddat marked this conversation as resolved.
Show resolved Hide resolved
upgradeName = "sovereign-changeover" // arbitrary name, define your own appropriately named upgrade
AccountAddressPrefix = "cosmos"
)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package app_test
import (
"testing"

appConsumer "github.com/cosmos/interchain-security/v3/app/consumer-democracy"
appConsumer "github.com/cosmos/interchain-security/v3/app/democracy"
ibctesting "github.com/cosmos/interchain-security/v3/legacy_ibc_testing/testing"
icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing"
"github.com/stretchr/testify/require"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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/interchain-security-cd/cmd"
"github.com/cosmos/interchain-security/v3/cmd/consumerd/cmd"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/crisis"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"

cdd "github.com/cosmos/interchain-security/v3/app/consumer-democracy"
cdd "github.com/cosmos/interchain-security/v3/app/democracy"
"github.com/cosmos/interchain-security/v3/app/params"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"github.com/cosmos/cosmos-sdk/server"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
app "github.com/cosmos/interchain-security/v3/app/consumer-democracy"
"github.com/cosmos/interchain-security/v3/cmd/interchain-security-cdd/cmd"
app "github.com/cosmos/interchain-security/v3/app/democracy"
"github.com/cosmos/interchain-security/v3/cmd/democracyd/cmd"
)

func main() {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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/interchain-security-pd/cmd"
"github.com/cosmos/interchain-security/v3/cmd/providerd/cmd"
)

func main() {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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/interchain-security-sd/cmd"
"github.com/cosmos/interchain-security/v3/cmd/sovereignd/cmd"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/consumer-development/app-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/features/key-assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <moniker>
shaspitz marked this conversation as resolved.
Show resolved Hide resolved
consumer init <moniker>
```

Then query your node for the consensus key.

```bash
consumerd tendermint show-validator # {"@type":"/cosmos.crypto.ed25519.PubKey","key":"<key>"}
consumer tendermint show-validator # {"@type":"/cosmos.crypto.ed25519.PubKey","key":"<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.
Expand All @@ -63,7 +63,7 @@ OR
gaiad query provider validator-provider-key <consumer-chain-id> 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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be consumerd.


## Changing a key

Expand Down
24 changes: 12 additions & 12 deletions tests/e2e/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func SlashThrottleTestRun() 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\" | " +
Expand All @@ -179,7 +179,7 @@ func SlashThrottleTestRun() TestRun {
},
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\" | " +
Expand Down Expand Up @@ -209,7 +209,7 @@ func DefaultTestRun() 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\" | " +
Expand All @@ -224,7 +224,7 @@ func DefaultTestRun() TestRun {
},
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\" | " +
Expand Down Expand Up @@ -266,7 +266,7 @@ func DemocracyTestRun(allowReward bool) 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\" | " +
Expand All @@ -280,7 +280,7 @@ func DemocracyTestRun(allowReward bool) TestRun {
},
chainID("democ"): {
chainId: chainID("democ"),
binaryName: "interchain-security-cdd",
binaryName: "democracyd",
ipPrefix: "7.7.9",
votingWaitTime: 20,
genesisChanges: consumerGenChanges,
Expand All @@ -306,7 +306,7 @@ func MultiConsumerTestRun() 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 = \"30s\" | " +
Expand All @@ -320,7 +320,7 @@ func MultiConsumerTestRun() TestRun {
},
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\" | " +
Expand All @@ -331,7 +331,7 @@ func MultiConsumerTestRun() TestRun {
},
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\" | " +
Expand Down Expand Up @@ -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\" | " +
Expand All @@ -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\" | " +
Expand Down
20 changes: 10 additions & 10 deletions tests/integration/democracy.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ import (
"github.com/stretchr/testify/suite"
)

type ConsumerDemocracyTestSuite struct {
type DemocracyTestSuite struct {
suite.Suite
coordinator *ibctesting.Coordinator
consumerChain *ibctesting.TestChain
consumerApp testutil.DemocConsumerApp
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,
Expand All @@ -43,7 +43,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.
Expand All @@ -61,13 +61,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()
Expand Down Expand Up @@ -145,7 +145,7 @@ func (s *ConsumerDemocracyTestSuite) TestDemocracyRewardsDistribution() {
}
}

func (s *ConsumerDemocracyTestSuite) TestDemocracyGovernanceWhitelisting() {
func (s *DemocracyTestSuite) TestDemocracyGovernanceWhitelisting() {
govKeeper := s.consumerApp.GetTestGovKeeper()
params := govKeeper.GetParams(s.consumerCtx())
stakingKeeper := s.consumerApp.GetTestStakingKeeper()
Expand Down Expand Up @@ -259,6 +259,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()
}
Loading