Skip to content

API for EE caching #18

Description

@axic

The current block data limit seems to be around 32-64k. This seems to be challenging given the work done by @s1na and @poemm.

A potential idea is to allow EE to keep some cache. (Not sure who's idea it was.)

Introduce two new EEI methods:

  • loadCache(dst_ptr: u32, offset: u32, len: u32)
  • saveCache(src_ptr: u32, offset: u32, len: u32)

where dst_ptr and src_ptr are memory pointers in the wasm instance and offset and len are properties of the cache space. There is a single linear cache space.

For the initial prototyping lets agree on a fixed-size cache space of 256k and a cache lifetime of 1 block. E.g. EEs can pass on data to the next block.

Potentially one may want to consider a cache expiry based on block time too.

An empty (fresh) or invalidated cache is pre-filled with zero bytes. EEs should leave a non-zero canary byte to determine if the cache is empty or set.

Metadata

Metadata

Assignees

No one assigned

    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