Skip to content

execute_metered_cost doesn't allow to configure the max cost #2162

@jsign

Description

@jsign

We wanted to share some finding we had when we tried using execute_metered_cost.
The context is that using execute for executing Ethereum mainnet blocks, but for some using execute_metered_cost returned empty public inputs (which shouldn't be the case).

Quoting @han0110 in his findings:

OpenVM has the a hook to check if the execution should suspend or not, and the impl MeteredCostCtx::should_suspend check if the cost has exceeded the configured maximum one (default to DEFAULT_MAX_COST and no way to configure in SDK unless we inline the code).

And I tried to run the tests again and found that indeed for some blocks the maximum cost is reached, so the execution is suspended earlier, and that's why we have the public values all zeros.

It feels like the right solution might be to allow the max cost to be configurable via SDK, but leaving that open to maintainers, since maybe there was a reason for not doing that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions