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

[Bugfix + Feature request] transaction.gasUsed is not gasUsed #34

Open
Amxx opened this issue Sep 30, 2019 · 1 comment
Open

[Bugfix + Feature request] transaction.gasUsed is not gasUsed #34

Amxx opened this issue Sep 30, 2019 · 1 comment

Comments

@Amxx
Copy link

Amxx commented Sep 30, 2019

Today, when handling an event, the transaction object contains gas-related entries:

  • event.transaction.gasPrice
  • event.transaction.gasUsed

However, event.transaction.gasUsed does not contain the gas used but the gas limit (which is part of the transaction). Gas used (and cumulative gas used) are part of the transaction receipt.

Steps that should be taken:

  • Rename the current gasUsed into gasLimit
  • Add gasUsed and/or cumulativeGasUsed from the transaction receipt in the event.transaction object
@leoyvens
Copy link

leoyvens commented Sep 30, 2019

We could put a receipt field in the transaction, without all the logs if that's not necessary. But while we do currently pull in all receipts, that's a wasteful thing we do that I hope to refactor away as part of graphprotocol/graph-node#902. So a receipt field should be lazily loaded and fetch the receipt on-the-fly, though we can cache it.

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

No branches or pull requests

4 participants