feat: scaffold consumer chain
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
--consumertoignite scaffold chain - Add new
validation:field inconfig.yml, which can takesovereign(or empty, default value),consumerorprovider(not implemented in this PR). I wanted to avoidkindhere, but I'm not really happy with the naming, feel free to suggest better names. - Update templates for consumer chain:
- the
staking,gov,distribandmintmodules are replaced with theconsumermodule - 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).
- the
- Update how genesis is built, when chain config has
validation: consumer, the validators list is moved from thestakingmodule genesis to theconsumergenesis, with the appropriate format.
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? 🤔
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
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
This PR might be merged after the Cosmos SDK
v0.50update
That's a little surprising since the cosmos-sdk v0.50 isn't even released (ony rc1 for now).
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.
Why is there no tests added for testing this flag --consumer?
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.
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.
omg, I'll have to force push to fix that
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
@@ 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%> (ø) |