Currently the runtime upgrade piece has a side effect of writing directly into storage at :code.
It seems cleaner to me (at the moment, but this is up for discussion) to have an access trait for the runtime storage and make pieces like the runtime upgrade piece reference the write access through the necessary accessor method.
Depending how many of these "special" storage keys there are, maybe we could even formalize a notion of global storage item. But I'm not ready to go there quite yet.
Currently the runtime upgrade piece has a side effect of writing directly into storage at
:code
.It seems cleaner to me (at the moment, but this is up for discussion) to have an access trait for the runtime storage and make pieces like the runtime upgrade piece reference the write access through the necessary accessor method.
Something similar is how I handled the relay parent block number storage for the parachain runtime. https://github.com/Off-Narrative-Labs/Tuxedo/blob/1ad23430126711d6fca8899e4f00306e76bf98f8/tuxedo-parachain-core/src/lib.rs#L93-L97
Depending how many of these "special" storage keys there are, maybe we could even formalize a notion of global storage item. But I'm not ready to go there quite yet.