graphprotocol / graphprotocol/graph-node

[Feature] Internal native asset transfers

Aperta
#5,173 7 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement
Lingua principale
Rust
Stelle
3.2k
Fork
1.1k
Merge medio
4g 1h
PR unite (30g)
1

Descrizione

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:
Screenshot 2024-01-29 at 15 51 20

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia esaminando la classe della transazione e l’accesso agli event handler descritti in questa issue, quindi ispeziona il feature flag receipts esistente e la discussione precedente nell’issue #297. Definisci come devono essere rappresentati ed esposti i trasferimenti interni, come viene abilitata l’indicizzazione e quali test dimostrano che i flussi degli asset nativi sono completi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
blockchain
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.