penumbra
penumbra copied to clipboard
`RoutingParams::default()` is needlessly inefficient
Describe the bug
The implementation of RoutingParams::default()
builds the entire asset registry multiple times, only to throw it away after getting an asset ID and then starting over. This shows up on CPU profiles of the SimulateTrade
RPC.
Expected behavior
We won't be able to use the list on mainnet anyways, since the assets will be different, so we need to change that anyways. The set of fixed candidates should be a DEX chain parameter, and the Default
impl should probably be removed in favor of reading the parameter holding the configured list of asset IDs.