Description
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
- Not duplicate issue
- Appropriate labels applied
- Appropriate contributors tagged/assigned
- Estimate provided