filecoin-project / ref-fvm

Reference implementation of the Filecoin Virtual Machine
https://fvm.filecoin.io/
Other
380 stars 136 forks source link

Add an integration test that defines a new syscall #1957

Open Stebalien opened 9 months ago

Stebalien commented 9 months ago

Basically, we need to make sure we can attach a new syscall to an FVM instance from a different crate. We should write an integration test that:

  1. Constructs a custom FVM with a custom kernel/syscall.
  2. Calls the custom syscall from an actor.
fridrik01 commented 9 months ago

@Stebalien for making the new custom syscall (for example math::doubleme) available to the wasm actor, I am thinking about creating a new crate containing the custom kernel and syscall, then in the wasm test actor, import that syscall module which I can then call to invoke the custom syscall, makes sense?

Stebalien commented 9 months ago

There's nothing special about the SDK (it's just a crate). You should be able to put that code inside your custom actor itself.