maybe im wrong with my impression of what an async tx is
Jan 30, 2024, 4:44 PM
There is some message, addressed to a smart contract.
Once all previous messages in queue have been processed, that message initiates a transaction.
Transaction launches contract and determines its response to incoming message: what it sends out and how it changes its persistent storage.
Outgoing actions are validated, balance is updated, and
outgoing messages are added into queue to be processed later.
Once all previous messages in queue have been processed, that message initiates a transaction.
Transaction launches contract and determines its response to incoming message: what it sends out and how it changes its persistent storage.
Outgoing actions are validated, balance is updated, and
outgoing messages are added into queue to be processed later.
Jan 30, 2024, 4:48 PM
that helps. but what if it reverts
does it have to send a message back to the first contract telling it that it was reverted?
@pcrafter thanks for the lesson. I will chew on this stuff and come back when Iām ready for more. Most appreciated
Jan 30, 2024, 4:53 PM
Yes, that's called bouncing. Sender may set that it's not interested in bounces, though. Offchain, that's represented by having destination address converted to unbounceable format (UQ...)
Jan 30, 2024, 4:54 PM
Bonus question
So I guess there has to be a gas transaction that is passed around to all the message receivers in the chain. Appears to be passed via the forward fee field in the message. How do you calculate the gas required for the enitre tx when it spans multiple messages?
So I guess there has to be a gas transaction that is passed around to all the message receivers in the chain. Appears to be passed via the forward fee field in the message. How do you calculate the gas required for the enitre tx when it spans multiple messages?
Jan 30, 2024, 4:57 PM
Transaction in TON, š :tada:, by definition spans one message ā one that initiated it.
How gas is calculated? Sender passes some TON, they're spent for computation and usually whatever remains is forwarded to the next message (contract may instead send a fixed amount, or its entire balance, or something like that; that's based on SendMode).
How gas is calculated? Sender passes some TON, they're spent for computation and usually whatever remains is forwarded to the next message (contract may instead send a fixed amount, or its entire balance, or something like that; that's based on SendMode).
Jan 30, 2024, 5:22 PM
ok yeah i saw some refund transactions so i guess thats the roundabout way to deal with it too
Jan 30, 2024, 5:22 PM