GasUsed
does not affect gas fees taken from the user
#3805
Labels
📦 ⛰️ gno.land
Issues or PRs gno.land package related
Description
This issue is meant to bring light to some cumbersome aspects of dealing with user fees in gno.land, which started on a rabbit hole from #3771.
Issue 1 - actual gas used for a tx doesn't affect fees taken from the user
Our
std.Fee
is very misleading:The amount the user puts in the Fee is actually the total amount of whatever the user is willing to pay for the entire transaction, not just a single unit of gas.
The effective gas price is the ratio of the maximum gas wanted and the maximum fee (for the entire tx).
There are 2 problems I see with this approach:
DeductFees
, and trace where the banker sends the funds). This is a separate effort / issuegno/tm2/pkg/sdk/auth/ante.go
Lines 325 to 328 in 2c2c018
I don't see how the
GasWanted
is not useless for transaction payments, given the user just specifies the maximum amount of gas to bypass a node limit, and the actual source of truth for what the user pays is whatever they put down as theFee.Amount
:gno/tm2/pkg/sdk/auth/ante.go
Lines 123 to 132 in 2c2c018
Issue 2 - it's impossible to fetch the minimum price per unit of gas
The gno chain has a set minimum gas price in the form of a ratio, ex. 0.001ugnot/gas. There is a limit which is node controlled (validator), and a limit which is set by the network.
The second issue with utilizing fees and fee ratios the way we do -- is that the client (user) sending the transaction to the gno.land chain cannot estimate the gas fee ratio they'd need to put down for their transaction to go through.
For example, a user (client) who wants to send a transaction needs to do a few things:
abci.simulate
query. We have this endpoint in all of our gno clients (Go & JS). It is worth noting that the user needs to set an initial guessed value for the gas limit which is high, so the transaction will even be simulated by the nodeinsufficient fees; got: {Gas-Wanted: 100000, Gas-Fee 5ugnot}, fee required: {Gas:1000 Price:1ugnot} as block gas
These 2 issues affect different types of UX:
I'd like to know if we can reach some kind of agreement on user transaction fees that mitigates these issues, given we're not too far from the launch, and they have the biggest impact on user experience.
cc @jaekwon @moul @piux2 @dongwon8247
The text was updated successfully, but these errors were encountered: