penumbra icon indicating copy to clipboard operation
penumbra copied to clipboard

`RoutingParams::default()` is needlessly inefficient

Open hdevalence opened this issue 11 months ago • 0 comments

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.

hdevalence avatar Mar 11 '24 21:03 hdevalence