I think it would be good to explore the feasibility of promoting Greymass Fuel from a layer 2 service to layer 1 system contract.
Quick rundown of Greymass Fuel for those who aren’t familiar with how it works: It’s a service run by Greymass that exposes a HTTP API where users can submit a transaction (or EEP-7 signing request) and get a modified transaction back where the greymassfuel
account is the resource payer, along with a signature to approve the transaction. The user can then sign the transaction and submit it to the chain to transact without having resources staked or rented.
The resources for the service can be paid for in the following ways:
- Free quotas per user account or smart contract account (designed for staking, likely to go away with PowerUp deployed)
- A pre-paid balance on a smart-contract that fuel maintains
- Transaction fees appended to the transaction returned by the service
To achieve this the service employs a “taste-tester”, which is a nodeos instance with a patch applied that allows it to push transactions without the required authorizations (and immediately roll them back). The taste tester node is what allows it to figure out how much resources a transaction would use and what fees to charge (and even buy RAM for the user if it’s needed).
I think implementing something like fuel at a system contract level would be a great complement to PowerUp.
Question is how hard would it be to implement something that would allow a contract to access the metering information? E.g. where the last action or some special deferred inline action could user.balance - usage_us; assert(usage_us < max_usage_us && user.balance >= 0)