graph-node: transaction.gasUsed is not gasUsed.

When handling an event, I wanted to log gas-related information. However, I noticed that event.trasaction.gasUsed does not contain the gas used but gas limit.

It would be nice to gas these 2 entries (gasUsed and gasLimit) in the transaction object

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 12
  • Comments: 15 (3 by maintainers)

Most upvoted comments

any chance of adding real gasUsed ? Probably has to be added as a method call - since indeed not all handlers need actual gas, and it takes an extra call to the node, much like view calls into the contracts.

Bumping this issue. Would be fantastic to track gasUsed for transactions, even if the team could provide a workaround calculation method (though I am not aware of one).

Hi @leoyvens & @azf20 ! Is there any ETA for gasUsed support? We’ve been relying on gasUsed at SimpleFi. We started upgrading our subgraphs to 24.1 and found it’s always been gasLimit. Thank you.

Hi this is available on the Hosted Service with the alpha versions of graph-ts and graph-cli, and will be in the next Graph Node release, documentation here https://github.com/graphprotocol/docs/pull/102. Note that an eventHandler has to specifically require receipts. Kudos to @tilacog and @evaporei

Including the receipt is being worked on and tracked here https://github.com/graphprotocol/graph-node/issues/3218