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

feat: scaffold consumer chain #3660

Merged
merged 67 commits into from
Mar 13, 2024
Merged

Conversation

tbruyelle
Copy link
Contributor

@tbruyelle tbruyelle commented Sep 19, 2023

Relates to #3604

This PR adds the ability to scaffold an ICS Replicated Security consumer chain. Here is the details of the changes:

  • Add new flag --consumer to ignite scaffold chain
  • Add new validation: field in config.yml, which can take sovereign (or empty, default value), consumer or provider (not implemented in this PR). I wanted to avoid kind here, but I'm not really happy with the naming, feel free to suggest better names.
  • Update templates for consumer chain:
    • the staking, gov, distrib and mint modules are replaced with the consumer module
    • a specific ante_handler is added. Note that the consumer ante handler has to be disabled during development, because it rejects any non-IBC message, which would basically make impossible any test without a provider chain and a IBC handshake properly setup. This disable is handled by a new build tag skip_ccv_msg_filter (scavenged from the Neutron source code).
  • Update how genesis is built, when chain config has validation: consumer, the validators list is moved from the staking module genesis to the consumer genesis, with the appropriate format.

@julienrbrt
Copy link
Member

julienrbrt commented Sep 29, 2023

Given that ICS does not support v0.50 yet (https://github.com/cosmos/interchain-security/blob/main/go.mod#L10).
How will this work once #3659 is merged? 🤔

@tbruyelle
Copy link
Contributor Author

Given that ICS does not support v0.50 yet (cosmos/interchain-security@main/go.mod#L10). How will this work once #3659 is merged? 🤔

Good catch, the first merged one will probably lock the other... So it's a question of priority. Summoning @ilgooz

@tbruyelle tbruyelle force-pushed the tbruyelle/feat/scaffold-consumer-chain branch from b7c3cc1 to 74a6048 Compare October 2, 2023 14:09
@tbruyelle tbruyelle marked this pull request as ready for review October 2, 2023 14:09
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Visit the preview URL for this PR (updated for commit 9c12049):

https://igntservices-docs--pr3660-tbruyelle-feat-scaff-ghacxpfw.web.app

(expires Tue, 19 Mar 2024 19:52:37 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 95379efd94dd497aaa37c2d0354e6e2cafca5ec5

jeronimoalbi
jeronimoalbi previously approved these changes Oct 5, 2023
Copy link
Member

@jeronimoalbi jeronimoalbi left a comment

Choose a reason for hiding this comment

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

Good work 👍

This PR might be merged after the Cosmos SDK v0.50 update

@tbruyelle
Copy link
Contributor Author

This PR might be merged after the Cosmos SDK v0.50 update

That's a little surprising since the cosmos-sdk v0.50 isn't even released (ony rc1 for now).

@jeronimoalbi
Copy link
Member

jeronimoalbi commented Oct 5, 2023

That's a little surprising since the cosmos-sdk v0.50 isn't even released (ony rc1 for now).

As of right now we are aiming to first release the CLI with v0.50 support before the replicated security scaffold support in this PR. I will add an update if there is any change.

I understand the SDK release won't take long.

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 88 lines in your changes are missing coverage. Please review.

Project coverage is 26.06%. Comparing base (5127085) to head (9c12049).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3660      +/-   ##
==========================================
- Coverage   26.13%   26.06%   -0.08%     
==========================================
  Files         303      304       +1     
  Lines       25366    25438      +72     
==========================================
  Hits         6630     6630              
- Misses      18159    18231      +72     
  Partials      577      577              
Files Coverage Δ
ignite/services/scaffolder/module.go 0.00% <ø> (ø)
ignite/templates/app/options.go 0.00% <ø> (ø)
ignite/config/chain/base/config.go 72.72% <0.00%> (-16.17%) ⬇️
ignite/cmd/scaffold_chain.go 0.00% <0.00%> (ø)
ignite/services/chain/build.go 0.00% <0.00%> (ø)
ignite/services/scaffolder/init.go 0.00% <0.00%> (ø)
ignite/internal/plugin/consumer.go 0.00% <0.00%> (ø)
ignite/templates/app/app.go 0.00% <0.00%> (ø)
ignite/services/chain/init.go 0.00% <0.00%> (ø)

julienrbrt
julienrbrt previously approved these changes Mar 11, 2024
ilgooz
ilgooz previously approved these changes Mar 12, 2024
@julienrbrt julienrbrt dismissed stale reviews from ilgooz and themself via b31314b March 12, 2024 09:18
julienrbrt
julienrbrt previously approved these changes Mar 12, 2024
toschdev
toschdev previously approved these changes Mar 12, 2024
Copy link
Contributor

@toschdev toschdev left a comment

Choose a reason for hiding this comment

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

ACK

@julienrbrt julienrbrt enabled auto-merge (squash) March 13, 2024 09:54
@julienrbrt julienrbrt merged commit 5ed9632 into main Mar 13, 2024
47 of 48 checks passed
@julienrbrt julienrbrt deleted the tbruyelle/feat/scaffold-consumer-chain branch March 13, 2024 13:51
mergify bot pushed a commit that referenced this pull request Mar 13, 2024
* feat: add validation kind in config

Disable gentx generation when validation is consumer.

* Add consumer chain plush scaffolding

* update config.yml when scaffold consumer chain

* Add hard-coded interchain-security require

* remove comment

* fix bad merge go.sum

* update ibc to v8

* fix changelog

* chore: update interchain-security dependency

Use the latest compatible with sdk50

* update ccvconsumertypes -> ccvtypes

* templates: ibc-go/v7 -> ibc-go/v8

plus other dep updates

* fix imports

* fix imports paths

* do not pass CapabilityKeeper in dep.Inject

* Fix lint

* fix: add missing ibcconsumer.AppModule (#3848)

Co-authored-by: Pantani <Pantani>

* remove ICS dep

* wip exec plugin!

* use plugin repo

* restore templates/app/files w/o IsConsumerChain condition

* create files-consumer alternate template folder

* mark minimal and consumer flags as exclusive

* fix wrong location for consumer_*.go files

* fix error handling for IsInitialized

* revert commit wip plugin exec

* use plugin to read & write consumer module genesis

* fix linter

* backport NFT module #3924 in files-consumer

* update app-consumer url

* move app-consumer address to ignite org

* update CL

* use new plugin location

* use merged version of consumer app

* changelog

* sync fixes

* updates

* fixes

* changelog

* feedback

* fix linter

* update ante handlers

* import

* updates

---------

Co-authored-by: Ehsan-saradar <ehsan.saradar@gmail.com>
Co-authored-by: Danilo Pantani <danpantani@gmail.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
(cherry picked from commit 5ed9632)

# Conflicts:
#	ignite/cmd/scaffold_chain.go
#	ignite/services/scaffolder/init.go
#	ignite/templates/app/files/go.mod.plush
julienrbrt added a commit that referenced this pull request Mar 14, 2024
* feat: scaffold consumer chain (#3660)

* feat: add validation kind in config

Disable gentx generation when validation is consumer.

* Add consumer chain plush scaffolding

* update config.yml when scaffold consumer chain

* Add hard-coded interchain-security require

* remove comment

* fix bad merge go.sum

* update ibc to v8

* fix changelog

* chore: update interchain-security dependency

Use the latest compatible with sdk50

* update ccvconsumertypes -> ccvtypes

* templates: ibc-go/v7 -> ibc-go/v8

plus other dep updates

* fix imports

* fix imports paths

* do not pass CapabilityKeeper in dep.Inject

* Fix lint

* fix: add missing ibcconsumer.AppModule (#3848)

Co-authored-by: Pantani <Pantani>

* remove ICS dep

* wip exec plugin!

* use plugin repo

* restore templates/app/files w/o IsConsumerChain condition

* create files-consumer alternate template folder

* mark minimal and consumer flags as exclusive

* fix wrong location for consumer_*.go files

* fix error handling for IsInitialized

* revert commit wip plugin exec

* use plugin to read & write consumer module genesis

* fix linter

* backport NFT module #3924 in files-consumer

* update app-consumer url

* move app-consumer address to ignite org

* update CL

* use new plugin location

* use merged version of consumer app

* changelog

* sync fixes

* updates

* fixes

* changelog

* feedback

* fix linter

* update ante handlers

* import

* updates

---------

Co-authored-by: Ehsan-saradar <ehsan.saradar@gmail.com>
Co-authored-by: Danilo Pantani <danpantani@gmail.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
(cherry picked from commit 5ed9632)

# Conflicts:
#	ignite/cmd/scaffold_chain.go
#	ignite/services/scaffolder/init.go
#	ignite/templates/app/files/go.mod.plush

* fix conflicts

* Update changelog.md

---------

Co-authored-by: Thomas Bruyelle <thomas.bruyelle@gmail.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
julienrbrt added a commit that referenced this pull request May 29, 2024
* feat: add validation kind in config

Disable gentx generation when validation is consumer.

* Add consumer chain plush scaffolding

* update config.yml when scaffold consumer chain

* Add hard-coded interchain-security require

* remove comment

* fix bad merge go.sum

* update ibc to v8

* fix changelog

* chore: update interchain-security dependency

Use the latest compatible with sdk50

* update ccvconsumertypes -> ccvtypes

* templates: ibc-go/v7 -> ibc-go/v8

plus other dep updates

* fix imports

* fix imports paths

* do not pass CapabilityKeeper in dep.Inject

* Fix lint

* fix: add missing ibcconsumer.AppModule (#3848)

Co-authored-by: Pantani <Pantani>

* remove ICS dep

* wip exec plugin!

* use plugin repo

* restore templates/app/files w/o IsConsumerChain condition

* create files-consumer alternate template folder

* mark minimal and consumer flags as exclusive

* fix wrong location for consumer_*.go files

* fix error handling for IsInitialized

* revert commit wip plugin exec

* use plugin to read & write consumer module genesis

* fix linter

* backport NFT module #3924 in files-consumer

* update app-consumer url

* move app-consumer address to ignite org

* update CL

* use new plugin location

* use merged version of consumer app

* changelog

* sync fixes

* updates

* fixes

* changelog

* feedback

* fix linter

* update ante handlers

* import

* updates

---------

Co-authored-by: Ehsan-saradar <ehsan.saradar@gmail.com>
Co-authored-by: Danilo Pantani <danpantani@gmail.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v28.x.y Backport to v28.x.y component:ci CI/CD workflow and automated jobs. component:cmd component:configs component:docs Documentation additions or improvements. component:templates type:internal type:services Service-related issues.
Projects
Status: Review / QA
Development

Successfully merging this pull request may close these issues.

8 participants