Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gas: Repricing for native wasm #1909

Open
5 tasks
Stebalien opened this issue Oct 4, 2023 · 2 comments
Open
5 tasks

Gas: Repricing for native wasm #1909

Stebalien opened this issue Oct 4, 2023 · 2 comments

Comments

@Stebalien
Copy link
Member

Stebalien commented Oct 4, 2023

We need to improve the accuracy of the gas model to account for some fixed costs before we allow native webassembly actors. We accurately charge for (almost) all variable costs but we have several syscalls that don't have any explicit costs beyond the base "syscall" cost of 14000 gas:

  • fvm_actor1::get_state_root, fvm_actor1::set_state_root, fvm_actor1::current_balance -- small fixed charge?
  • ipld1::block_stat, ipld1::block_read -- charge for block_id resolution.
  • ipld1::block_open -- find some way to handle the variable (size-based) charge before opening the block. We charge after the fact, but we likely need to either (a) reserve some maximum or (b) change the underlying blockstore interface to allow us to lookup a block and the block's size before actually loading it.
  • fvm_actor1::balance_of, fvm_actor1::get_actor_code_cid, fvm_actor1::lookup_delegated_address, fvm_actor1::resolve_address -- charge for cached lookups.
  • fvm_actor1::exit -- charge for "unwinding" the stack?

Assumes filecoin-project/FIPs#845:

  1. Move context APIs to global variables.
  2. Make some APIs privileged.
@maciejwitowski
Copy link
Contributor

@Stebalien to me this sounds more like a direct prerequisite of native WASM actors than general "FVM Foundational improvements". I suggest we schedule it in the roadmap only if we schedule native WASM actors too.

@Stebalien
Copy link
Member Author

That's basically what the foundational improvements are. We need to address this issue for native wasm support, but we likely should address it anyways.

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

No branches or pull requests

2 participants