You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The router in IBCv2 stores exact port IDs. The CosmWasm module needs to route IBC messages to many potential destination contracts. This means that either CosmWasm must register all contracts in the router, or register only one path (e.g., "WasmPort") and implement additional internal routing for the contracts. From both a complexity and performance point of view, each proposal introduces computational overhead and may increase the complexity of the IBC message handler logic. With very little cost, we could improve the behavior of the IBCv2 router to make the entire procedure much simpler and faster.
Use cases
IBCv2 ports can be associated with proper modules based on their prefix. It removes the necessity to register additional paths per module in the IBC-go Router.
Proposal
Use Radix-tree to store prefixes of the port IDs in the IBCv2 Router.
For Admin Use
Not duplicate issue
Appropriate labels applied
Appropriate contributors tagged/assigned
Estimate provided
The text was updated successfully, but these errors were encountered:
kulikthebird
changed the title
Improvement: Prefix-based routing in IBCv2 Router
Prefix-based routing in IBCv2 Router
Apr 15, 2025
Thanks for the update. Do you think we should re-implement the routing mechanism you mentioned? From CW's perspective, I think that would be totally fine. I proposed using a radix tree to make it a bit more efficient and elegant, but I'm not sure how many modules blockchains typically register.
Summary
Add a prefix-based routing in IBCv2 Router.
Problem Definition
The router in IBCv2 stores exact port IDs. The CosmWasm module needs to route IBC messages to many potential destination contracts. This means that either CosmWasm must register all contracts in the router, or register only one path (e.g., "WasmPort") and implement additional internal routing for the contracts. From both a complexity and performance point of view, each proposal introduces computational overhead and may increase the complexity of the IBC message handler logic. With very little cost, we could improve the behavior of the IBCv2 router to make the entire procedure much simpler and faster.
Use cases
IBCv2 ports can be associated with proper modules based on their prefix. It removes the necessity to register additional paths per module in the IBC-go Router.
Proposal
Use Radix-tree to store prefixes of the port IDs in the IBCv2 Router.
For Admin Use
The text was updated successfully, but these errors were encountered: