Repository navigation
feat(nns): Store wasm_metadata in SNS-W's stable memory (attempt #2) - #977
Conversation
|
Maybe dumb question - why not have get_wasm_metadata_impl just read from the cache if it's populated, and then if not, do the work of processing the WASM for the first time? Then you can avoid all the stuff in heartbeat etc? |
I've considered this approach, but that would require making metadata an optional field, and it seems slightly better to me have metadata as non-optional. |
Maybe - is there possibly another approach? Like tracking which WASMs have been processed? Then you could remove all that code next upgrade... |
This PR is the first step towards enabling the
SnsW.get_wasm_metadataendpoint in production. For that, we need a way to store the metadata in the stable memory, as recomputing it each time is expensive (because canister WASMs stored in SNS-W are often compressed).Unlike the first attempt, this PR makes it harder to represent disallowed states in the type system, e.g., there cannot metadata that does not belong to any WASM stored in SNS-W.