Skip to content

Separate gas for tx parameters  #177

@lcances

Description

@lcances

The gas storage is consumed both by the size of the parameters passed to the invoked SC function but also when using store and load

Given the function below

Function GasTest(someString: String) Uint64
1 STORE("test", someString)
2 RETURN 0
End Function 

The following call GasTest("hello") will consume 10 gas Storage. 5 due to the tx parameter and 5 due to the store

If I understand the need to limit the tx size, and that it is used to calculate the transaction fee, I suggest implementing an independent gas for the tx parameter simply called txGas

This will have several benefits:

  • Fully utilize the gas storage maximum limit of 20k
  • every existing project that requires storing large data inside the SC will benefit from it without having to change anything
  • UPDATE_SC_CODE will be able to update up to 20kB smart contract.

I will come with a PR soon but wanted to share the idea first.

Let me know

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