[move] Enabled debug printing in code published on chain (+ Move version bump) #4356
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Being able to use debug printing in local testing but being forced to remove it for publishing has been a source of confusion for a while now (e.g., #3590).
We have discussed different solutions and the current consensus is that we should allow publishing code with debug prints on chain but have it being a no-op unless used for testing. This is already implemented on core Move side where the printing code is gated with the
testing
feature in the native function implementation (otherwise the native function's printing part is a no-op): https://github.com/move-language/move/blob/bc57bf2df7aee3f639ec670af5c6ff5341d89a9d/language/move-stdlib/src/natives/debug.rs#L39This could be enhanced by additional (linter) warnings on Sui side, but we don't have a linting framework at the moment. We could also increase the gas cost of debug printing functions but let's delegate it to a potential future PR.