Skip to content

Conversation

@DavePearce
Copy link
Collaborator

@DavePearce DavePearce commented Oct 29, 2025

Note

Compute gas cost in TxSkipSection sender-collision path using gasLimit - gasRefunded instead of getGasUsed.

Written by Cursor Bugbot for commit 7d646cf. This will update automatically on new commits. Configure here.

@DavePearce DavePearce linked an issue Oct 29, 2025 that may be closed by this pull request
if (txMetadata.senderAddressCollision()) {
final BigInteger gasUsed = BigInteger.valueOf(txMetadata.getGasUsed());
final BigInteger gasUsed =
BigInteger.valueOf(txMetadata.getGasLimit() - txMetadata.getGasRefunded());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Gas Calculation Error Overcharges Transactions

The gas calculation formula gasLimit - gasRefunded is likely incorrect for calculating actual gas consumed. In Ethereum, the actual gas consumed should be gasUsed - gasRefund (not gasLimit - gasRefund). Using gasLimit - gasRefund will overcharge the sender when gas used is less than the gas limit, since it subtracts only refunds from the full limit rather than from the actual consumed gas amount.

Fix in Cursor Fix in Web

@amkCha amkCha merged commit a0cb670 into arith-dev Oct 29, 2025
24 of 35 checks passed
@amkCha amkCha deleted the 2453-fix-gas-calculation-for-tx-skip branch October 29, 2025 10:38
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

Successfully merging this pull request may close these issues.

fix: gas calculation for TX skip

4 participants