rusk icon indicating copy to clipboard operation
rusk copied to clipboard

Extend contract interface to inform block generator contract pays for gas

Open miloszm opened this issue 11 months ago • 0 comments

Summary

Currently, in order for a contract to pay for gas to execute a given transaction, we need to ask contract for a funding note, and this solution has been implemented in a POC issue #1503. The POC solution requires additional call to a contract. It would be much more efficient to have a mechanism allowing contract to inform the block generator of the gas price and gas limit the contract is willing to pay for transaction execution. Block generator will then act accordingly.

Possible solution design or implementation

An efficient way of passing data from contract to block generator needs to be implemented. This could be a contract call, or preferably, a direct contract data access mechanism.

Additional context

Related issue: #1503

This issue may require new host functions to be available to contracts, providing data about low, average and high gas prices at a given time. This is covered by issue #1604.

This issue will also require changes in PieCrust - TBD.

miloszm avatar Mar 27 '24 13:03 miloszm