graphprotocol / graphprotocol/graph-node
[Feature] Internal native asset transfers
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 1.1k
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 1
Description
Description
Currently, there is no way to track internal native asset (ex. ETH) transfers inside of an event handler.
This is because internal transactions are not tracked. This is problematic for figuring out the correct flow of assets during an event.
Specifically, we ran into this issue when creating the 0x community subgraphs. Since internal native asset transfers cannot be tracked, it is not possible to index and assemble full 0x trades in a subgraph using the graph-node without call handlers (which are not supported everywhere).
Ideally, there would be an array of internal transactions as part of the transaction class, where each one would at least have the native asset amount that was transferred. I.e can access these in an event handler like: event.transaction.internalTransfers
For example, you can see internal transactions for a transaction in etherscan:
Could use a feature flag to turn this on like the receipts flag is used today, so internal transactions are off by default speeding up indexing.
This was originally mentioned here (https://github.com/graphprotocol/graph-node/issues/297) in 2018, and was planned as part of "phase 2" but was never implemented.
Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.
No response
Some information to help us out
- Tick this box if you plan on implementing this feature yourself.
- I have searched the issue tracker to make sure this issue is not a duplicate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the transaction class and event-handler access described in this issue, then inspect the existing receipts feature flag and the earlier discussion in issue #297. Define how internal transfers should be represented and exposed, how indexing is enabled, and what tests demonstrate that native asset flows are complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100