-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
Milestone
Description
Based on the ewasm interface and api we need a validator that checks:
- That the code contains an execution guard
- 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 anOk()
on success or aErr(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.
- (1)
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