Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Possible invalid gas check #2381

@gabmontes

Description

@gabmontes

Up to version beta.37, there was an issue with checking the receipt for transaction execution status:

https://github.com/ethereum/web3.js/blob/1d9f6c0889c7f551b4ec1041cece0d50bc3ff2c8/packages/web3-core-method/src/index.js#L351

While gasProvided is a hex string, receipt.gasUsed is a number, making the condition always fail -and therefore failing to do any check-. Proper comparison would be:

gasProvided !== utils.numberToHex(receipt.gasUsed)

It looks like after the refactor in version beta.38 and up, the condition is the same:

https://github.com/ethereum/web3.js/blob/599851753b4a35b5c11f902c7c592b111e190073/packages/web3-core-method/src/validators/TransactionReceiptValidator.js#L80

I was unable to check the latests versions yet as will remain in beta.37 for now but it is possible that the error persist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugAddressing a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions