Skip to content
This repository was archived by the owner on May 1, 2026. It is now read-only.
This repository was archived by the owner on May 1, 2026. It is now read-only.

Design a poll-based interface #34

Description

@axic

In case WASM will not support asynchronous methods we might need to take an alternative approach.

A simple way is to have each operation work with polling, storageLoad would become:

  • ethereum.storageLoad(args)
  • ethereum.storageLoadResult() -> i32 (where 1 means result is written to the specified memory location)

And the following pseudocode in WASM:

ethereum.storageLoad()
do { 
  result = ethereum.storageLoadResult()
} while(!result)

The JS interface would need to do the sleep then. It's not efficient at all, but there's no way to sleep in WASM.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions