-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Feature]: consume block gas meter don't panic #19317
Comments
If you evaluate the execution flow and you really think about it, the |
We have a slightly different situation, we try to keep it compatible with ethereum to refund unused gas (partially), at the same time we try to prevent too much unused gas-wanted waste too much block space, so we cap the tx wanted reported to cometbft, that makes the overflow tx happens occasionally. |
Ahh I see. It's okay to submit a patch for this, but keep in mind. There may be a world in which block gas meter no longer exists as it's unnecessary. cc @testinginprod @tac0turtle for server/v2. |
I guess we can hack this in our 0.47 fork for now, in the future I guess we can also live with it when the block gas meter is removed. |
Summary
When a transaction's execution exceeds the block gas meter, the out-of-gas error overrides the actual transaction execution result, which makes it tricky for indexers, explorers, and RPC wrappers to handle the transaction properly.
The current logic also doesn't commit the unlucky transaction result, I think it's not necessary, since it already passed ante handler logic which means the fee is already collected based on gas-wanted.
So the proposal is to simply ignore the error silently.
Problem Definition
make the transaction result reflect the actual situation, and don't make the unlucky transaction to fail when the sender has paid gas fee.
indexers, explorers, and RPC wrappers can handle all transactions correctly.
No.
Proposed Feature
Make
consumeBlockGas
recover the out-of-gas panic internally, don't let it propagate.Alternatively, we can create a new method
TryConsumeGas
which doesn't panic but returns a proper error result when out of gas happens, andconsumeBlockGas
can log and ignore the error.The text was updated successfully, but these errors were encountered: