graphprotocol / graphprotocol/graph-node

gnd: scaffolding follow-ups from #6660 review

Open
#6,684 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3.2k
Forks
1.1k
Avg merge
4d 1h
Merged PRs (30d)
1

Description

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. Existing Transfer + ABI with Transfer and TokenTransferTokenTransfer declared 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 → two Transfer1s. Bump the counter until the name is free.
  • An unparseable schema.graphql silently disables collision detection in add. Should log a warning.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with scaffold/schema.rs and codegen/abi.rs, tracing the duplicated integer-width cutoff and the add path for event and parameter names. Compare the generated schema and ABI getter behavior described in the issue; done means Int8 mappings work consistently and each listed collision is handled without duplicate generated names, with a warning for an unparseable schema.graphql.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, solidity
Domain
blockchain, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.