penumbra-zone / web

Apache License 2.0
10 stars 7 forks source link

Avoid 'AssetMetadataById' queries, use prax registry and wasm metadata generation instead #1189

Open Valentine1898 opened 1 month ago

Valentine1898 commented 1 month ago

We have the issue that we create a lot of requests during sync #887 Most of these requests are AssetMetadataById for delegation tokens

https://github.com/penumbra-zone/web/blob/777b68c45eb06fc0d8a4080e9fd2439aff1d1500/packages/query/src/block-processor.ts#L366-L371

There is also an issue for adding an AssetMetadataByIds query https://github.com/penumbra-zone/penumbra/issues/4162

The suggestion is to simply not use AssetMetadataById queries, instead use only asset data from https://github.com/prax-wallet/registry and for delegation tokens we can simply generate metadata with wasm using validator_identity (we already do that for lpnft and auctionnft)

DelegationToken::from(&validator_identity).denom();

This should solve #887 and we'll get rid of a hundred requests during sync Plus, from a privacy standpoint, we should avoid network requests whenever possible

grod220 commented 1 month ago

simply generate metadata with wasm using validator_identity

Great suggestion! That looks like low hanging fruit and saving a network call.

not use AssetMetadataById queries, instead use only asset data from https://github.com/prax-wallet/registry

I think I need some help on this one. If we do not request metadata for this unknown asset, does it effectively become a brick in my account? (aka can't swap with it). What are the possible consequences for not making the assetMetadataById call at all?