cli icon indicating copy to clipboard operation
cli copied to clipboard

feat: scaffold consumer chain

Open tbruyelle opened this issue 2 years ago • 10 comments

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.

tbruyelle avatar Sep 19 '23 13:09 tbruyelle

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 https://github.com/ignite/cli/pull/3659 is merged? 🤔

julienrbrt avatar Sep 29 '23 15:09 julienrbrt

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 avatar Sep 29 '23 15:09 tbruyelle

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

github-actions[bot] avatar Oct 05 '23 09:10 github-actions[bot]

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).

tbruyelle avatar Oct 05 '23 14:10 tbruyelle

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.

jeronimoalbi avatar Oct 05 '23 14:10 jeronimoalbi

Why is there no tests added for testing this flag --consumer?

toschdev avatar Nov 23 '23 10:11 toschdev

Why is there no tests added for testing this flag --consumer?

Good point, there should be an integration test with that flag, let's add it when ICS is ready for sdk50.

tbruyelle avatar Nov 24 '23 13:11 tbruyelle

I rebased the branch on main so that it contains the latest changes from the SDK50 upgrade. The rebase was hard :sweat:, I had to squash as much as possible, I wanted to preserve @Ehsan-saradar's commits.

Obviously the code doesn't compile anymore since we are waiting for the ICS SDK50 upgrade. But this rebase allows to split the work into 2 steps.

tbruyelle avatar Nov 24 '23 13:11 tbruyelle

omg, I'll have to force push to fix that image

tbruyelle avatar Mar 11 '24 09:03 tbruyelle

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%) :arrow_down:
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%> (ø)

codecov[bot] avatar Mar 11 '24 10:03 codecov[bot]