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

[SDK] Add specific class to represent Gas #1841

Open
claytonneal opened this issue Feb 20, 2025 · 0 comments · Fixed by #1894
Open

[SDK] Add specific class to represent Gas #1841

claytonneal opened this issue Feb 20, 2025 · 0 comments · Fixed by #1894
Assignees

Comments

@claytonneal
Copy link
Member

claytonneal commented Feb 20, 2025

At the moment signature of GasModule.estimateGas(...) is

interface EstimateGasResult {
    /**
     * The total gas cost estimation of the transaction.
     */
    totalGas: number;

    /**
     * Boolean indicating whether the transaction reverted or not.
     */
    reverted: boolean;

    /**
     * Decoded Solidity revert reasons for each clause.
     * If the n-th clause reverted, then the n-th element of this array will be the decoded revert reason for the n-th clause.
     *
     * @note revertReasons will be undefined if the transaction did not revert.
     */
    revertReasons: Array<string | bigint>;

    /**
     * The error message produced by the Virtual Machine.
     *
     * @note vmErrors will be undefined if the transaction did not revert.
     */
    vmErrors: string[];
}

totalGas is a number, and documentation says that it's a cost, which makes people believe that it can be used directly.

Unfortunately, it's a value that can be converted at the moment into VTHO by fixed means and in future releases of protocol it can be dynamic fee market depending on how full block is.

In order to make it clear that it's not a number that can be fit directly into VTHO most likely different unit of measure have to be introduced that might allow for conversion into the price token (given choice of the model).

@claytonneal claytonneal added this to the 2.0.0-beta (Pre-Release) milestone Feb 20, 2025
@claytonneal claytonneal self-assigned this Feb 25, 2025
@GrandinLuc GrandinLuc self-assigned this Mar 10, 2025
@GrandinLuc GrandinLuc linked a pull request Mar 11, 2025 that will close this issue
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants