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

Incorrect gas consumption for SENDMSG #3

Open
Shvandre opened this issue Jan 16, 2025 · 0 comments
Open

Incorrect gas consumption for SENDMSG #3

Shvandre opened this issue Jan 16, 2025 · 0 comments
Labels
invalid-gas Invalid or unknown gas for instruction

Comments

@Shvandre
Copy link

Shvandre commented Jan 16, 2025

tvm-spec says both SENDMSG and SENDRAWMSG consume 526 gas units

Proof:

Seitaro Higuchi wrote

RU

вообще, мб надо sendmsg переделать: мы вытаскивали все параметры комиссий в слайсы и контекст как раз чтобы не надо было вскрывать ячейки которые на самом деле и так вскрыты в процессе исполнения:
https://docs.ton.org/v3/documentation/tvm/changelog/tvm-upgrade-2024-04#c7
получается что sendmsg неоправданно дорог
некритично конечно, но все же

ENG:

In general, maybe sendmsg should be redesigned: we pulled all commission parameters into slides and context just to avoid opening cells that are actually opened during execution:
https://docs.ton.org/v3/documentation/tvm/changelog/tvm-upgrade-2024-04#c7
It turns out that sendmsg is unreasonably expensive.
not critical, of course, but still

When using SENDMSG message is opened and the bits/refs are counted. So if I understand it correctly
gas(SENDMSG) ≈ gas(SENDRAWMSG) + gas(CDATASIZE(msg))

(This needs to be tested, though)

@i582 i582 added the invalid-gas Invalid or unknown gas for instruction label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid-gas Invalid or unknown gas for instruction
Projects
None yet
Development

No branches or pull requests

2 participants