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

Failed tx cost us entire gas allowance, but not transaction fee #221

Closed
kuoweilai opened this issue Nov 19, 2021 · 7 comments
Closed

Failed tx cost us entire gas allowance, but not transaction fee #221

kuoweilai opened this issue Nov 19, 2021 · 7 comments

Comments

@kuoweilai
Copy link

Describe the bug
When a tx failed, it took all gas allowance from the wallet, not the transaction fee.

To Reproduce
When you tx accidentally failed (e.g. huge price change made your limit order failed), you would lose entire gas allowance (gas price * gas limit), not just the transaction fee

Expected behavior
We should only lose transaction fee shown in explorer.

Screenshots
https://cronos.crypto.org/explorer/address/0x7FBF20916a966Ce00A1cA00F2E679E2A25B3A719/transactions

@thomas-nguy
Copy link
Collaborator

Thank you for the report on the mainnet beta version.

Currently, Cronos mainnet beta uses a standard fixed gas, thus raising gas limits won’t increase the chance that transactions get picked up faster. We suggest users keep the gasLimit setting at their required minimum for now. Additionally, there appear to be issues in the Ethermint library and in the BlockScout explorer. The issue in Ethermint has been resolved (evmos/ethermint#751), but would require a coordinated network upgrade due to a consensus-breaking change: in the meantime, a hotfix release binary contains a gas limit restriction on the Web3 RPC API to reduce the impact (https://github.com/crypto-org-chain/cronos/releases/tag/v0.6.2). The next network upgrade will likely contain the EIP1559-style fee market which will further help to alleviate the gas pricing related issues.
Given the root cause was resolved in Ethermint, this issue can be closed.

If you have further follow ups regarding this issue, feel free to reach out to chain@crypto.org.
Also a friendly reminder that we have dedicated bug bounty programs on HackerOne https://hackerone.com/crypto?type

@kuoweilai
Copy link
Author

Yeah, but i think even we don't increase gas limit, we still should only pay those gas we spent right? Also, it shows differently in explorer and it's hard to keep track of everything.

@thomas-nguy
Copy link
Collaborator

thomas-nguy commented Nov 22, 2021

Yes this is correct, is it due to refund mechanism being ignored when transaction is reverted

The bug has been resolved on Ethermint (evmos/ethermint#751)

@kuoweilai
Copy link
Author

kuoweilai commented Nov 22, 2021

@thomas-nguy but after i upgraded to 0.6.2, I think it still have this issue, it still didn't refund.

I lost 0.5CRO at block 186416
https://cronos.crypto.org/explorer/address/0xDe1FD04317492130A9ca13945c078bA3F5A673DC/coin-balances

but i only spent 0.12593CRO
https://cronos.crypto.org/explorer/tx/0xbcf0c0b8356dd19108c530158fe493323f480a3f0590c0e54e4be1b527f2938c/internal-transactions

@thomas-nguy
Copy link
Collaborator

Yes, tharsis#751 is not yet effective on mainnet beta yet.

tharsis#751 is a consensus breaking change, so the fix can only be included on major binary release (v0.7.x) and it will also require a coordinated network upgrade.

In the meantime, we did released a hotfix in v0.6.2 to mitigate the issue by rejecting transaction with too high gas limit value (crypto-org-chain/ethermint#12)

@kuoweilai
Copy link
Author

@thomas-nguy Understandable. Thank you so much for your hard work.

@weidaxu1988
Copy link

@thomas-nguy Thanks for the fix, is there any chance to get those gas back?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants