ref-fvm icon indicating copy to clipboard operation
ref-fvm copied to clipboard

"life before invoke" in wasm code

Open Stebalien opened this issue 3 years ago • 2 comments

Currently, code can run before invoke, but it'll run out of gas immediately and trap (leading to a fatal error).

We need to either:

  1. Properly account for this kind of code.
  2. Forbid it.

Ideally, we'd just forbid it. It looks like we can run wasm-ctor-eval (from binaryen)?

Stebalien avatar Jun 03 '22 15:06 Stebalien

@Stebalien Is this talking specifically about Wasm module start functions? What other bytecode can exist before invoke in our case?

raulk avatar Jun 10 '22 17:06 raulk

  1. The start function.
  2. Table initialization functions. See the exprs that appear in https://webassembly.github.io/spec/core/syntax/modules.html#syntax-elem.

Stebalien avatar Jun 10 '22 19:06 Stebalien

I'm centralizing all wasm validation in https://github.com/filecoin-project/ref-fvm/issues/1038.

Stebalien avatar Nov 12 '22 00:11 Stebalien