forked from paritytech/substrate
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[contracts] make
debug_message
execution outcome invariant to node …
…debug logging setting (paritytech#13197) * update benchmark for seal_debug_message * add seal_debug_message_per_kb benchmark * un-fallable debug buffer: silently drops excessive and wrong utf-8 encoded messages * charge debug_message per byte of the message * improved benchmark * cap debug_message * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts * Apply suggestions from code review Co-authored-by: Alexander Theißen <alex.theissen@me.com> * fix applied buggy suggestion * make sure i*1024 < MaxDebugBufferLen * fix schedule for our non-batched benchmark * Switch to a `wasmtime` fork with LTO linking failure workaround * ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_contracts --------- Co-authored-by: command-bot <> Co-authored-by: Alexander Theißen <alex.theissen@me.com> Co-authored-by: Jan Bujak <jan@parity.io>
- Loading branch information
Showing
12 changed files
with
1,372 additions
and
1,064 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
;; Emit a "Hello World!" debug message | ||
;; Emit a debug message with an invalid utf-8 code | ||
(module | ||
(import "seal0" "seal_debug_message" (func $seal_debug_message (param i32 i32) (result i32))) | ||
(import "env" "memory" (memory 1 1)) | ||
|
||
(data (i32.const 0) "\fc") | ||
|
||
(func (export "call") | ||
(call $seal_debug_message | ||
(i32.const 0) ;; Pointer to the text buffer | ||
(i32.const 12) ;; The size of the buffer | ||
(func $assert_eq (param i32 i32) | ||
(block $ok | ||
(br_if $ok | ||
(i32.eq (get_local 0) (get_local 1)) | ||
) | ||
(unreachable) | ||
) | ||
;; the above call traps because we supplied invalid utf8 | ||
unreachable | ||
) | ||
|
||
(func (export "call") | ||
(call $assert_eq | ||
(call $seal_debug_message | ||
(i32.const 0) ;; Pointer to the text buffer | ||
(i32.const 12) ;; The size of the buffer | ||
) | ||
(i32.const 0) ;; Success return code | ||
) | ||
) | ||
|
||
(func (export "deploy")) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.