From d6243f259c4a78640a1aea5d66530d98f721dd24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Thu, 16 Aug 2018 22:03:57 +0200 Subject: [PATCH] ECI: Document the consequences of wasm trap --- contract_interface.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contract_interface.md b/contract_interface.md index f197aa16..927e2dae 100644 --- a/contract_interface.md +++ b/contract_interface.md @@ -51,3 +51,9 @@ In the [WebAssembly Javascript API](https://webassembly.org/docs/js/) however th leaves no time for the client to acquire the memory area. *Note:* This decision was made on WebAssembly version 0xb (pre version 1) and should be revisited. + +### Traps + +If execution of wasm code triggers the wasm _trap_, the contract execution is +terminated with failure and all remaining gas is consumed (OOG-like exception). +This includes execution of `unreachable` instruction.