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 (backport #3660) #4016

Merged
merged 4 commits into from
Mar 14, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Mar 13, 2024

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.

This is an automatic backport of pull request #3660 done by [Mergify](https://mergify.com).

* 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
Copy link
Contributor Author

mergify bot commented Mar 13, 2024

Cherry-pick of 5ed9632 has failed:

On branch mergify/bp/release/v28.x.y/pr-3660
Your branch is up to date with 'origin/release/v28.x.y'.

You are currently cherry-picking commit 5ed96320.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   changelog.md
	modified:   docs/docs/08-references/02-config.md
	modified:   ignite/config/chain/base/config.go
	new file:   ignite/internal/plugin/consumer.go
	new file:   ignite/internal/plugin/consumer_test.go
	modified:   ignite/internal/plugin/execute_test.go
	new file:   ignite/internal/plugin/testdata/consumer/config/genesis.json
	new file:   ignite/internal/plugin/testdata/consumer/config/priv_validator_key.json
	modified:   ignite/services/chain/build.go
	modified:   ignite/services/chain/init.go
	modified:   ignite/services/scaffolder/module.go
	modified:   ignite/templates/app/app.go
	new file:   ignite/templates/app/files-consumer/app/ante_handler.go.plush
	new file:   ignite/templates/app/files-consumer/app/app.go.plush
	new file:   ignite/templates/app/files-consumer/app/app_config.go.plush
	new file:   ignite/templates/app/files-consumer/app/consumer_devel.go.plush
	new file:   ignite/templates/app/files-consumer/app/consumer_final.go.plush
	new file:   ignite/templates/app/files-consumer/app/export.go.plush
	new file:   ignite/templates/app/files-consumer/app/ibc.go.plush
	new file:   ignite/templates/app/files-consumer/cmd/{{binaryNamePrefix}}d/cmd/root.go.plush
	modified:   ignite/templates/app/files/app/app.go.plush
	modified:   ignite/templates/app/files/app/ibc.go.plush
	modified:   ignite/templates/app/files/cmd/{{binaryNamePrefix}}d/cmd/commands.go.plush
	modified:   ignite/templates/app/files/cmd/{{binaryNamePrefix}}d/cmd/root.go.plush
	renamed:    ignite/templates/app/files/config.yml -> ignite/templates/app/files/config.yml.plush
	modified:   ignite/templates/app/options.go
	modified:   integration/app/cmd_app_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   ignite/cmd/scaffold_chain.go
	both modified:   ignite/services/scaffolder/init.go
	both modified:   ignite/templates/app/files/go.mod.plush

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions github-actions bot added component:docs Documentation additions or improvements. component:ci CI/CD workflow and automated jobs. component:templates component:configs component:cmd type:services Service-related issues. type:internal labels Mar 13, 2024
Copy link
Contributor

github-actions bot commented Mar 13, 2024

Visit the preview URL for this PR (updated for commit 75f5bfc):

https://igntservices-docs--pr4016-mergify-bp-release-v-0sj48wdr.web.app

(expires Thu, 21 Mar 2024 16:32:19 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 95379efd94dd497aaa37c2d0354e6e2cafca5ec5

Copy link

codecov bot commented Mar 14, 2024

Codecov Report

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

Project coverage is 24.74%. Comparing base (a9a254c) to head (75f5bfc).

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##           release/v28.x.y    #4016      +/-   ##
===================================================
- Coverage            24.81%   24.74%   -0.07%     
===================================================
  Files                  296      297       +1     
  Lines                24909    24977      +68     
===================================================
  Hits                  6180     6180              
- Misses               18161    18229      +68     
  Partials               568      568              
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 enabled auto-merge (squash) March 14, 2024 16:32
@julienrbrt julienrbrt merged commit 09f1398 into release/v28.x.y Mar 14, 2024
43 of 46 checks passed
@julienrbrt julienrbrt deleted the mergify/bp/release/v28.x.y/pr-3660 branch March 14, 2024 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:ci CI/CD workflow and automated jobs. component:cmd component:configs component:docs Documentation additions or improvements. component:templates conflicts type:internal type:services Service-related issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants