Skip to content

Procedure Verification #141

@Latrasis

Description

@Latrasis

Based on the ewasm interface and api we need a validator that checks:

  1. That the code contains an execution guard
  2. That a procedure does not contain external calls to:

Interface

Interface should be as follows:

cap9_code_validate

Return if the code passes validation

Parameters

  • code: &[u8] immutable reference to code memory location

Returns

  • result: Result<(), CodeValidationError> returns an Ok() on success or a Err(CodeValidationError) on failure

Error Conditions

  • CodeValidationError can be:
    • (1) CodeIsEmpty: code#length was zero
    • (2) CodeIsUnprotected: Code does not contain an execution guard header
    • (3) CodeIsIllegal: an illegal EEI interface call from list as described above.

Trap Conditions

  • #getGasLeft reaches zero with kernel instance running out of gas
  • #getBlockGasLimit becomes less than gas spent which means the block gas limit is reached

Metadata

Metadata

Labels

A-codeArea: CodeT-ewasmTarget system: Ethereum Wasm

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions