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

Compute phase: gas fees deduction logic #32

Open
unboxedtype opened this issue Sep 17, 2021 · 0 comments
Open

Compute phase: gas fees deduction logic #32

unboxedtype opened this issue Sep 17, 2021 · 0 comments
Assignees

Comments

@unboxedtype
Copy link

Hi!

In the compute_phase function, you try to deduct the gas_fee, and in case of an error (not sufficient balance), you just show the debug message, but it doesn't lead (well, not obvious, at least) to any kind of phase error.
Could you please point to the logic that recovers this situation?

if !acc_balance.grams.sub(&vm_phase.gas_fees)? {
   log::debug!(target: "executor", "can't sub funds: {} from acc_balance: {}", vm_phase.gas_fees, acc_balance.grams);
}

You also do the fee deduction from the msg_balance, but it may silently fail by the same reason, because .sub always
returns Ok(bool).
https://github.com/tonlabs/ton-labs-executor/blob/be2f1ec60e09857d8b8f489c1e79f000bba32269/src/ordinary_transaction.rs#L185

@sv-91 sv-91 self-assigned this Oct 18, 2021
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

2 participants