Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain the Sentinel interface in more depth #151

Merged
merged 3 commits into from
Oct 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions sentinel.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,30 @@ 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

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,
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);
}
```
6 changes: 0 additions & 6 deletions system_contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down