Skip to content
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

fix(gas-payment): remove check gasObtained == outTxGasFee #1304

Merged
merged 4 commits into from
Oct 16, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions x/crosschain/keeper/gas_payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,13 @@ func (k Keeper) PayGasInERC20AndUpdateCctx(
)
gasObtained := amounts[2]

// FIXME: investigate small mismatches between gasObtained and outTxGasFee
// https://github.com/zeta-chain/node/issues/1303
// check if the final gas received after swap matches the gas fee defined
// if not there might be issues with the pool liquidity and it is safer from an accounting perspective to return an error
if gasObtained.Cmp(outTxGasFee.BigInt()) != 0 {
return cosmoserrors.Wrapf(types.ErrInvalidGasAmount, "gas obtained for burn (%s) not equal to gas fee(%s)", gasObtained, outTxGasFee)
}
//if gasObtained.Cmp(outTxGasFee.BigInt()) != 0 {
lumtis marked this conversation as resolved.
Show resolved Hide resolved
// return cosmoserrors.Wrapf(types.ErrInvalidGasAmount, "gas obtained for burn (%s) not equal to gas fee(%s)", gasObtained, outTxGasFee)
//}

// burn the gas ZRC20
err = k.fungibleKeeper.CallZRC20Burn(ctx, types.ModuleAddressEVM, gasZRC20, gasObtained, noEthereumTxEvent)
Expand Down Expand Up @@ -333,6 +335,9 @@ func (k Keeper) PayGasInZetaAndUpdateCctx(
"zetaAmountIn", amounts[0],
"zrc20AmountOut", amounts[1],
)

// FIXME: investigate small mismatches between amounts[1] and outTxGasFee
// https://github.com/zeta-chain/node/issues/1303
err = k.fungibleKeeper.CallZRC20Burn(ctx, types.ModuleAddressEVM, gasZRC20, amounts[1], noEthereumTxEvent)
if err != nil {
return cosmoserrors.Wrap(err, "PayGasInZetaAndUpdateCctx: unable to CallZRC20Burn")
Expand Down
Loading