Skip to content

Procedure Execution with StaticCall #17

Closed
@Latrasis

Description

@Latrasis

Background

When executing a procedure we need to make sure:

  1. Unprivileged State Access/Modifications are rejected.
  2. State Access using a valid capability is accepted.

Proposal

  1. When executing a procedure from the kernel we use STATICCALL instead of DELEGATECALL.
    When executing a procedure from kernel space:
  2. To prevent state changes instead of checking for opcodes, we rely on STATICCALL to prevent them at runtime.
  3. 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.
  4. 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

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions