convex
convex copied to clipboard
String rendering specification and controls
We need to place defined rules on String rendering in the CVM with str and related functions.
Requirements:
- Rendering must be deterministic and fully defined for all CVM Objects
- The cost of String generation must be accurately calculated and controlled, since it can be triggered for arbitrary CVM values in CVM code. (e.g.
*state*). - There must not be a DoS attack when string rendering may be externally triggered, e.g. when printing error traces.
An option is to remove str from core, and require users to print externally to the CVM.
It there actually a good use case for str on-chain? We don't have the reader on-chain either....
(discussed initially on Discord)
Besides the fact the CVX runner uses str in abundance, it is probably best leaving it on chain. For instance, it is useful for creating error messages and for metaprogramming (creating keyword, symbols).
Yeah I would prefer to keep it in for these reasons. Just needs careful specification and execution cost guards I think.