Closed
Description
Background
When executing a procedure we need to make sure:
- Unprivileged State Access/Modifications are rejected.
- State Access using a valid capability is accepted.
Proposal
- When executing a procedure from the kernel we use
STATICCALL
instead ofDELEGATECALL
.
When executing a procedure from kernel space: - To prevent state changes instead of checking for opcodes, we rely on
STATICCALL
to prevent them at runtime. - Whenever a procedure requires a kernel resource, it returns the current memory with a 64 byte header which includes: The capability invoked, argument location, input location, and next valid jump location within the procedure stack.
- If a kernel receives a valid invocation, it dispatches the requested resource, if the resource returns any data, the data is included into the input location. The procedure then reads the next jump location, and continues execution.
Considerations
As an example, when accessing SSTORE
, this proposal incurs the additional cost of aSTATICCALL
, it remains to be seen if it is cheaper to simply encapsulate an opcode than to do context switching.
Metadata
Metadata
Assignees
Labels
No labels