From 63b9124694b4325ea1438deabc890058646df708 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 18 Oct 2018 12:36:14 +0200 Subject: [PATCH 1/3] Explain the Sentinel interface in more depth --- sentinel.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sentinel.md b/sentinel.md index 716b50e0..b1d4dc13 100644 --- a/sentinel.md +++ b/sentinel.md @@ -8,3 +8,27 @@ The process of metering is [explained in its own chapter](./metering.md). The Sentinel is a system contract which means its code is fixed and is part of the genesis or hardfork ewasm is enabled on. As a result, changing or updating it requires a hard fork. + +The Sentinel contract has two interfaces: +- raw interface +- ABI encoded interface + +## Error handling + +In both modes, the contract will use an invalid instruction (e.g. regular failure) when an unexpected issue occurs, +or the `revert` operation if the supplied input is invalid. + +## Raw interface + +In the raw interface it accepts any valid WebAssembly binary, applies the Sentinel steps, and returns the transformed +WebAssembly binary. There is no encapsulation of any kind. + +## ABI encoded interface + +The ABI encoded interface is demonstrated by the following Solidity interface: +```solidity +interface Sentinel { + // Expects a WebAssembly binary and returns a transformed WebAssembly binary. + function validateAndMeter(bytes) external view returns (bytes); +} +``` From b8527401621cf6e6f7977b9fae071016edebbe36 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 18 Oct 2018 12:36:41 +0200 Subject: [PATCH 2/3] Remove the obsolete Sentinel interface from system_contracts --- system_contracts.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/system_contracts.md b/system_contracts.md index 13faca00..b4c84811 100644 --- a/system_contracts.md +++ b/system_contracts.md @@ -22,12 +22,6 @@ important processing steps: See the [dedicated chapter](./sentinel.md) about it. -Input: -- **variable length**: *ewasm contract code* - -Output: -- **variable length**: *ewasm contract code* - ## EVM Transcompiler Address: `0x000000000000000000000000000000000000000b` From 78e981304256bd4e31cde6c10de323dc9d47051c Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 18 Oct 2018 12:51:44 +0200 Subject: [PATCH 3/3] State the reason for two sentinel interfaces --- sentinel.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sentinel.md b/sentinel.md index b1d4dc13..e1d16827 100644 --- a/sentinel.md +++ b/sentinel.md @@ -13,6 +13,9 @@ The Sentinel contract has two interfaces: - raw interface - ABI encoded interface +The raw interface is used by the node for contract validation during deployment, while the ABI encoded interface is a more +friendly way to interact with the contract otherwise. + ## Error handling In both modes, the contract will use an invalid instruction (e.g. regular failure) when an unexpected issue occurs,