gear icon indicating copy to clipboard operation
gear copied to clipboard

Implement `UnspentReservationPool` in `gstd` to ease gas reservations management

Open techraed opened this issue 3 years ago • 0 comments

Problem to Solve

After #1505, gcore and gstd users will have an opportunity to reserve gas from the message on their programs. The downside of the implementation is that programs have to count saved amount of gas along with reservations ids, because programs have no possibility to know, how much did they reserved.

Possible Solution

The idea is to make some kind of reservations manager, which abstracts the crate's user from reservation Ids and such. The simplest version of the suggesting entity just reserves the gas and unreserves it with a amount: u64 argument instead of reservation id. Under the hood the type must effectively free existing reservations. By effectiveness I mean it should cause less read/writes in node's storage.

techraed avatar Sep 28 '22 12:09 techraed