Skip to content

feat: Re-map all IBCv2 enabled contracts after state sync #2144

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

Open
kulikthebird opened this issue Mar 4, 2025 · 6 comments · May be fixed by #2277
Open

feat: Re-map all IBCv2 enabled contracts after state sync #2144

kulikthebird opened this issue Mar 4, 2025 · 6 comments · May be fixed by #2277
Assignees

Comments

@kulikthebird
Copy link
Contributor

In the ibc-go versions v9 and older the bindPort method was used to inform the IBC about a new mapping portID <-> Contract Address. A method AddRoute was used to inform IBC module about Wasm Application in order to route all messages with a proper module name prefix towards the app.

In IBC v2 the bindPort method is removed and AddRoute is used to map a specific port to a given application. This change is stored in memory and does not become a part of the bc state. In order to set the port mappings to wasm contract, wasmd needs to re-insert every IBCv2 enabled contract using AddRoute during the state sync procedure.

@kulikthebird kulikthebird changed the title feat: Re-insert all v2 enabled contracts after state sync feat: Re-map all IBCv2 enabled contracts after state sync Mar 4, 2025
@kulikthebird kulikthebird self-assigned this Mar 14, 2025
@kulikthebird
Copy link
Contributor Author

IBC-go team accepted the change request on their side. We're waiting for the update of AddRoute method or similar change, that will make the V2 Router persistent in the blockchain state

@hashedone
Copy link

Some internal comments about that: https://confio.slack.com/docs/T02FDPU2DM0/F088ADM30N4

@kulikthebird
Copy link
Contributor Author

I've created issue and a proposal PR for the prefix-based routing in ibc-go:

Waiting for further actions from ibc-go team

@kulikthebird
Copy link
Contributor Author

Once the prefix-based routing is implemented in ibc-go, we can call AddRoute only once with a predefined prefix during the app startup. We should not store the router within our keeper nor call AddRoute during contract initialization/migration.

@kulikthebird
Copy link
Contributor Author

We need to wait for ibc-go v10.3.0 release. Upon bumping the ibc-go dep, we need to update route registering during wasm startup as well as remove an extra AddRoute call from instantiate and migrate procedures.

@kulikthebird
Copy link
Contributor Author

kulikthebird commented May 28, 2025

Update: The ibc-go prefix-based port routing won't be released before end of May, so the other solution is proposed: #2277. Once the implementation is released in ibc-go, this issue should be the next step: #2278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants