-
Notifications
You must be signed in to change notification settings - Fork 12
Update subgraphs to 1.3.0 #375
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
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThis update modifies the subgraph packages for both HOPR on Mainnet and HOPR on Gnosis. It upgrades Graph Protocol dependencies in their package.json files, updates the GraphQL schema to make the Account entity mutable, and amends the subgraph manifests to increase the specVersion and explicitly prevent pruning by adding Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SubgraphManifest
participant Indexer
User->>SubgraphManifest: Deploy/update subgraph.yaml (with indexerHints: prune: never)
SubgraphManifest->>Indexer: Notify indexer of pruning settings
Indexer-->>SubgraphManifest: Acknowledge and retain all historical data (no pruning)
User->>Indexer: Query historical data (older than 500 blocks)
Indexer-->>User: Serve requested historical data
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
subgraph/packages/hopr-on-gnosis/subgraph.yaml (1)
1-5: Same specVersion concern as the mainnet manifestFor consistency and build stability, apply the same specVersion correction here.
Everything else (including theprune: neverhint) looks fine.
🧹 Nitpick comments (1)
subgraph/packages/hopr-on-mainnet/schema.graphql (1)
1-1:immutable: falseis redundant but harmlessEntities are mutable by default; the explicit
immutable: falseis therefore cosmetic.
If the intention is only to document mutability, keep it.
Otherwise you can drop the argument to reduce noise.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
subgraph/packages/hopr-on-gnosis/yarn.lockis excluded by!**/yarn.lock,!**/*.locksubgraph/packages/hopr-on-mainnet/yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (6)
subgraph/packages/hopr-on-gnosis/package.json(1 hunks)subgraph/packages/hopr-on-gnosis/schema.graphql(1 hunks)subgraph/packages/hopr-on-gnosis/subgraph.yaml(1 hunks)subgraph/packages/hopr-on-mainnet/package.json(1 hunks)subgraph/packages/hopr-on-mainnet/schema.graphql(1 hunks)subgraph/packages/hopr-on-mainnet/subgraph.yaml(1 hunks)
🔇 Additional comments (2)
subgraph/packages/hopr-on-mainnet/package.json (1)
14-18: Large version jump warrants compatibility verification
@graphprotocol/graph-cliis being bumped from0.37.x➜0.97.1and@graphprotocol/graph-tsfrom0.29.x➜0.37.0.
These are major-range jumps that introduced several breaking changes (e.g. new code-gen output layout, stricter AssemblyScript targeting, changed CLI flags).Please run
graph build && graph testlocally (or in CI) before merging to ensure:
- AssemblyScript compilation still succeeds under the stricter
as@1.xthat ships with the new CLI.- Generated typings are imported correctly by your
src/mapping.tsfiles.- Matchstick tests compile with
matchstick-as@0.6.0(it expects the new output directory layout).If any of these fail you may need intermediate migrations or a smaller incremental upgrade path.
subgraph/packages/hopr-on-gnosis/package.json (1)
14-19: Apply the same compatibility checks as for the mainnet packageThe gnosis package receives identical dependency jumps; make sure both subgraphs are compiled & tested together to catch cross-package breakage early.
| @@ -1,4 +1,4 @@ | |||
| type Account @entity { | |||
| type Account @entity(immutable: false) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Redundant explicit immutable: false directive
@entity defaults to immutable: false; specifying it explicitly adds noise and slightly increases merge-conflict surface. Unless you expect to toggle this flag programmatically, consider removing the argument for terser schema files.
-type Account @entity(immutable: false) {
+type Account @entity {You can confirm that no other entity relies on an explicit immutable: false by running:
🏁 Script executed:
#!/bin/bash
# List entities that redundantly spell out `immutable: false`
rg --line-number '@entity\(immutable:\s*false' subgraph | headLength of output: 247
Remove redundant immutable: false from entity definitions
The @entity directive defaults to immutable: false, so explicitly specifying it is unnecessary noise and increases merge-conflict surface. Please update both schema files:
• subgraph/packages/hopr-on-gnosis/schema.graphql
-type Account @entity(immutable: false) {
+type Account @entity {• subgraph/packages/hopr-on-mainnet/schema.graphql
-type Account @entity(immutable: false) {
+type Account @entity {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| type Account @entity(immutable: false) { | |
| type Account @entity { |
🤖 Prompt for AI Agents
In subgraph/packages/hopr-on-gnosis/schema.graphql at line 1, remove the
explicit `immutable: false` from the `@entity` directive since it is the default
value. Also apply the same change to the corresponding entity definitions in
subgraph/packages/hopr-on-mainnet/schema.graphql to reduce redundancy and
potential merge conflicts.
| specVersion: 1.3.0 | ||
| schema: | ||
| file: ./schema.graphql | ||
| indexerHints: | ||
| prune: never |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specVersion: 1.3.0 is not a recognised manifest version
The Graph manifest specification currently stops at 0.0.5 (latest stable) and 1.0.0 (beta for Substreams-based subgraphs).
1.3.0 will cause graph build to abort with
✖ Unsupported specVersion 1.3.0.
Double-check the docs/CLI release notes and downgrade to a supported value, e.g.:
-specVersion: 1.3.0
+specVersion: 0.0.5 # or 1.0.0 if you are intentionally targeting the new runtimeKeep the new indexerHints block – it is allowed as of CLI ≥ 0.48 even on 0.0.5.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| specVersion: 1.3.0 | |
| schema: | |
| file: ./schema.graphql | |
| indexerHints: | |
| prune: never | |
| specVersion: 0.0.5 # or 1.0.0 if you are intentionally targeting the new runtime | |
| schema: | |
| file: ./schema.graphql | |
| indexerHints: | |
| prune: never |
🤖 Prompt for AI Agents
In subgraph/packages/hopr-on-mainnet/subgraph.yaml at lines 1 to 5, the
specVersion is set to 1.3.0, which is not supported and causes build errors.
Change the specVersion to a supported value like 0.0.5 or 1.0.0, while keeping
the indexerHints block intact as it is allowed in CLI versions 0.48 and above.
Close #373
0.5.0to1.3.0immutableas falseindexerHintsas neverLatest deployed version:
Summary by CodeRabbit
New Features
Chores