-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: custom denom for gas fees #42
Conversation
@@ -237,7 +237,7 @@ func (k *Keeper) ApplyTransaction(ctx sdk.Context, tx *ethtypes.Transaction) (*t | |||
} | |||
|
|||
// refund gas in order to match the Ethereum gas consumption instead of the default SDK one. | |||
if err = k.RefundGas(ctx, msg, msg.Gas()-res.GasUsed, cfg.Params.EvmDenom); err != nil { | |||
if err = k.RefundGas(ctx, msg, msg.Gas()-res.GasUsed, cfg.Params.GasDenom); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So GasDenom
is forced to not empty? Imo should have a ticket to note the migration require this setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You wrote in the docs: On genesis, this parameter is empty (optionally, it equals to evm_denom)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's true, I chose the latter. thought it's more seamless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@omritoptix FYI please make sure we don't forget to add value for this param on upgrade.
return errortypes.ErrInsufficientFee.Wrapf( | ||
"wrong fee denomination; got: %s; required: %s", amount, stakingDenom, | ||
) | ||
// amount is not in staking denom, do not try to claim staking rewards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great catch!!
Description
Implements the following: https://www.notion.so/dymension/Tx-gas-payment-using-optional-denom-in-EVM-106a4a51f86a803a81fdf43be998c93c?pvs=4#106a4a51f86a808c9ae7e989a1f211cd
We cannot use ERC-20 token as a tx fee since currently everything fee-related is tied to SDK coins (eg in CLI you specify fees using SDK coins). Specifically, FeeTx interface. The solution is to always use an SDK representation of token and convert from ERC-20 to SDK if necessary.
This PR modifies AnteHandlers.
Cosmos Ante
Evm Ante
Important changes:
Closes dymensionxyz/rollapp-evm#383