You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
We don't really have a block scoped temporary variable solution currently. We are currently just use storage for that and kill them at on_finalize hook to ensure they are never persisted. However this is just a workaround and could be improved to reduce overhead of enocde/decode/hash/overlay work.
This isn't as simple as an unsafe static global variable as we are exiting wasm context during block production phase and hence in wasm memory global variable can't be persisted. A quick solution is add new host function to store the in memory data on the host side with a stack so it is possible to pop the data if block producer decided to discard a bad tx. A later optimization could make this purely in wasm memory call during block evaluation / import phase to completely eliminate the overhead of host call and potentially encode/decode work.
This makes it possible to build an in memory trie builder to build a more efficient event system paritytech/polkadot-sdk#278
The text was updated successfully, but these errors were encountered:
We don't really have a block scoped temporary variable solution currently. We are currently just use storage for that and kill them at on_finalize hook to ensure they are never persisted. However this is just a workaround and could be improved to reduce overhead of enocde/decode/hash/overlay work.
This isn't as simple as an unsafe static global variable as we are exiting wasm context during block production phase and hence in wasm memory global variable can't be persisted. A quick solution is add new host function to store the in memory data on the host side with a stack so it is possible to pop the data if block producer decided to discard a bad tx. A later optimization could make this purely in wasm memory call during block evaluation / import phase to completely eliminate the overhead of host call and potentially encode/decode work.
This makes it possible to build an in memory trie builder to build a more efficient event system paritytech/polkadot-sdk#278
The text was updated successfully, but these errors were encountered: