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

Make storage instructions cost #361

Merged
merged 2 commits into from
May 16, 2024
Merged

Make storage instructions cost #361

merged 2 commits into from
May 16, 2024

Commits on May 15, 2024

  1. piecrust: upgrade dusk-wasmtime to 21.0.0-alpha

    Eduardo Leegwater Simões committed May 15, 2024
    Configuration menu
    Copy the full SHA
    0b8ee2a View commit details
    Browse the repository at this point in the history
  2. piecrust: make storage instructions cost more

    Each byte stored in the WebAssembly linear memory of a contract is made
    to cost 4 units of fuel - in the units that wasmtime uses. This makes
    storing a single byte as expensive as, for example, multiplying or
    subtracting two numbers.
    
    The `MemoryGrow` instruction is purposefully left with the default price
    - just like any other instruction, due the fact that expanding the size
    of the linear memory doesn't actually cost a lot of resources, owing to
    the fact that a page that is never written to is never written to disk.
    
    A single contract's compiled bytecode will contain a header, encoding
    within it information about the cost per WebAssembly instruction. If
    these don't match the costs configured for the current `VM`
    instantiation, the contract will be recompiled, just as what happens if
    the native instruction set doesn't match.
    
    See-also: #359
    Eduardo Leegwater Simões committed May 15, 2024
    Configuration menu
    Copy the full SHA
    861cdc5 View commit details
    Browse the repository at this point in the history