graphprotocol / graphprotocol/graph-node
gnd: scaffolding follow-ups from #6660 review
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Rust
- Sterne
- 3.2k
- Forks
- 1.1k
- Ø Merge
- 4 T. 1 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
Follow-ups from the review of #6660.
Int8 support (comment)
Map mid-size Solidity ints (signed 33-64 bits, unsigned 25-63) to Int8 instead of BigInt. The schema scaffold and the ABI codegen need to change together: the generated getter would chain .toBigInt().toI64() since ethereum.Value has no i64 accessor. The entity side already supports Int8. Before adding the band, consolidate the int width cutoff into one shared helper — it's currently duplicated in scaffold/schema.rs and ~8 places in codegen/abi.rs.
Duplicate-name corner cases (comment)
All of these produce a duplicate name in the generated output, so the build fails:
add: an entity renamed on collision isn't checked against the other events in the same batch. ExistingTransfer+ ABI withTransferandTokenTransfer→TokenTransferdeclared twice.- Two params that sanitize to the same field name aren't deduped (e.g. two unnamed params both become
value). The accessor side already dedupes (param0,param1); the field side should too. - The overload suffix can clash with a real event:
Transfer,Transfer,Transfer1→ twoTransfer1s. Bump the counter until the name is free. - An unparseable schema.graphql silently disables collision detection in
add. Should log a warning.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit scaffold/schema.rs und codegen/abi.rs und verfolge den duplizierten Grenzwert für Integer-Breiten sowie den Pfad zum Hinzufügen von Ereignis- und Parameternamen. Vergleiche das im Issue beschriebene Verhalten des generierten Schemas und des ABI-Getters; abgeschlossen ist die Arbeit, wenn Int8-Zuordnungen konsistent funktionieren und jede aufgeführte Kollision ohne doppelte generierte Namen behandelt wird, mit einer Warnung für ein nicht parsbares schema.graphql.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust, solidity
- Bereich
- blockchain, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100