You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When developing programs with complex interactions, we have to take into account gas consumption. For example, our program A sends a request to another program B. In case of a successful response, A must save some record with the response data.
It is at this point in program A, during post-processing of message B, that the gas may be exhausted.
A common solution is to send a message with a gas deposit for the response and install a reply hook:
This reply hook can be benched later to determine minimal required gas for execution. The gas value then passed to the program's constructor.
The main disadvantage is that we don't have access to the sails service in the such reply hook. So cannot emit any event from it or have access to the program's state/storage, for example.
It would be nice to implement some support of that pattern on the sails side.
Possible Solution
research
Notes
No response
The text was updated successfully, but these errors were encountered:
Problem to Solve
When developing programs with complex interactions, we have to take into account gas consumption. For example, our program A sends a request to another program B. In case of a successful response, A must save some record with the response data.
It is at this point in program A, during post-processing of message B, that the gas may be exhausted.
A common solution is to send a message with a gas deposit for the response and install a reply hook:
This reply hook can be benched later to determine minimal required gas for execution. The gas value then passed to the program's constructor.
The main disadvantage is that we don't have access to the sails service in the such reply hook. So cannot emit any event from it or have access to the program's state/storage, for example.
It would be nice to implement some support of that pattern on the sails side.
Possible Solution
research
Notes
No response
The text was updated successfully, but these errors were encountered: