gear
gear copied to clipboard
Re-check gas reduction and charge fairness
Proposal
There are some host functions for which gas reduction and consumption is considered unfair. For example:
-
sendmessage -> here - https://github.com/gear-tech/gear/blob/fc520c673014ef599e520dd62897a0f34f965503/core-processor/src/ext.rs#L556-L557 we first reduce gas-left counter and then reduce gas for sending message itself (different fees for messages with/without delay). If the second charge fails, the reduction of gas for the actually unsent message remains. -
read-> here - https://github.com/gear-tech/gear/blob/fc520c673014ef599e520dd62897a0f34f965503/core-processor/src/ext.rs#L730-L733 we can charge for the requested read length, but fail on the fact, that length is greate than the payload iteself. So we will charge for things didn't happen.
related to #2822