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

function to callibrate max_gas parameter for web-on-chain #1269

Closed
Thykof opened this issue Nov 15, 2023 · 2 comments · Fixed by #1271 or #1273
Closed

function to callibrate max_gas parameter for web-on-chain #1269

Thykof opened this issue Nov 15, 2023 · 2 comments · Fixed by #1271 or #1273
Assignees
Labels
issue:bug Something isn't working

Comments

@Thykof
Copy link
Contributor

Thykof commented Nov 15, 2023

The problem(s)
On the web on chain, we have no idea what to use as max_gas, so we use the maximum value. The consequence is that the operation could never be chosen by a block creator.

To Reproduce

On secure net for example, try to deploy a website with several chunks (laby) ans maybe on operation of appending a chunk will not passe.

MassaStation version
The version of MassaStation the bug is present in.

main branch as of c1b8cfd

@Thykof Thykof added the issue:bug Something isn't working label Nov 15, 2023
@Thykof Thykof linked a pull request Nov 16, 2023 that will close this issue
10 tasks
@Thykof Thykof self-assigned this Nov 16, 2023
@Thykof Thykof linked a pull request Nov 16, 2023 that will close this issue
10 tasks
@Thykof
Copy link
Contributor Author

Thykof commented Nov 17, 2023

Context: I have worked on this task during the preparation for the migration of buildnet v24.1 to v27.

After experimentation, some error occur:
execute_read_only_call v24 : OK
execute_read_only_call v27 : Invalid params
execute_read_only_bytecode v24 : Internal error
execute_read_only_bytecode v27 : Invalid params

So in the 2 PRs, the gas cost estimation function ignore the error of the node and return the default gas limit value.

Now, we are only interested in having this estimation functions work on v27, so the PR are ready, but the node isn't.

@Thykof
Copy link
Contributor Author

Thykof commented Nov 21, 2023

execute_read_only_bytecode v27 and execute_read_only_call v27 are supposed to work.

We need to take this value for max_gas: min(max allowed gas, readonly gas cost result)

max allowed gas =

MaxGasAllowedExecuteSC     = 3_980_167_295
MaxGasAllowedCallSC        = 4_294_167_295

gas cost result = the result of the read only, if no error, gives the gas cost

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue:bug Something isn't working
Projects
None yet
1 participant