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

Chainspec wasm configuration doesn't allow defining different costs for different VMs #4914

Open
zajko opened this issue Oct 10, 2024 · 0 comments
Assignees
Labels
bug Something isn't working rc-5 Release Candidate 5 release blocker PR to be merged before releasing

Comments

@zajko
Copy link

zajko commented Oct 10, 2024

Currently the cost properties look like:

[wasm.host_function_costs]
add = { cost = 5_800, arguments = [0, 0, 0, 0] }
add_associated_key = { cost = 1_200_000, arguments = [0, 0, 0] }
add_contract_version = { cost = 200, arguments = [0, 0, 0, 0, 120_000, 0, 0, 0, 0, 0] }
add_package_version = { cost = 200, arguments = [0, 0, 0, 0, 120_000, 0, 0, 0, 30_000, 0, 0] }
[wasm.opcode_costs.*]

This gives us no possibility of differentiating between costs for different virtual machines. Also, it would be hard to support a different set of host functions for different VMs
We want the structure to be like:

[wasm.v1.host_function_costs]
add = { cost = 5_800, arguments = [0, 0, 0, 0] }
add_associated_key = { cost = 1_200_000, arguments = [0, 0, 0] }
add_contract_version = { cost = 200, arguments = [0, 0, 0, 0, 120_000, 0, 0, 0, 0, 0] }
add_package_version = { cost = 200, arguments = [0, 0, 0, 0, 120_000, 0, 0, 0, 30_000, 0, 0] }
[wasm.v1.opcode_costs.*]

[wasm.v2.host_function_costs]
add = { cost = 5_800, arguments = [0, 0, 0, 0] }
add_associated_key = { cost = 1_200_000, arguments = [0, 0, 0] }
add_contract_version = { cost = 200, arguments = [0, 0, 0, 0, 120_000, 0, 0, 0, 0, 0] }
add_package_version = { cost = 200, arguments = [0, 0, 0, 0, 120_000, 0, 0, 0, 30_000, 0, 0] }
[wasm.v2.opcode_costs.*]

Additionally, promote the [wasm.storage_costs] to a root level property ([storage_costs])

@zajko zajko added bug Something isn't working rc-5 Release Candidate 5 release blocker PR to be merged before releasing labels Oct 10, 2024
@zajko zajko self-assigned this Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rc-5 Release Candidate 5 release blocker PR to be merged before releasing
Projects
None yet
Development

No branches or pull requests

1 participant