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

Separate gas for tx parameters #177

Open
lcances opened this issue May 3, 2024 · 0 comments
Open

Separate gas for tx parameters #177

lcances opened this issue May 3, 2024 · 0 comments

Comments

@lcances
Copy link

lcances commented May 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant