Skip to content

Conversation

@QYuQianchen
Copy link
Contributor

@QYuQianchen QYuQianchen commented Jul 24, 2025

Close #373

  • Bump spec from 0.5.0 to 1.3.0
  • Specify entity immutable as false
  • Specify indexerHints as never

Latest deployed version:

  • HOPR on Gnosis: v0.0.3
  • HOPR on Mainnet: v0.0.7

Summary by CodeRabbit

  • New Features

    • The Account entity in both subgraphs is now mutable, allowing updates to its fields after creation.
  • Chores

    • Upgraded dependencies for both subgraphs to the latest versions.
    • Updated subgraph specifications to a newer version and added indexer hints to prevent data pruning.

@coderabbitai
Copy link

coderabbitai bot commented Jul 24, 2025

📝 Walkthrough

Walkthrough

This 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 indexerHints: prune: never.

Changes

Files/Paths Change Summary
subgraph/packages/hopr-on-gnosis/package.json
subgraph/packages/hopr-on-mainnet/package.json
Upgraded @graphprotocol/graph-cli, @graphprotocol/graph-ts, and matchstick-as dependency versions.
subgraph/packages/hopr-on-gnosis/schema.graphql
subgraph/packages/hopr-on-mainnet/schema.graphql
Added immutable: false to the Account entity to make it mutable.
subgraph/packages/hopr-on-gnosis/subgraph.yaml
subgraph/packages/hopr-on-mainnet/subgraph.yaml
Updated specVersion to 1.3.0 and added indexerHints: prune: never to prevent data pruning.

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
Loading

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
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch q/add-prune-setting

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@QYuQianchen QYuQianchen self-assigned this Jul 24, 2025
@QYuQianchen QYuQianchen requested a review from jeandemeusy July 24, 2025 21:41
Copy link

@coderabbitai coderabbitai bot left a 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 manifest

For consistency and build stability, apply the same specVersion correction here.
Everything else (including the prune: never hint) looks fine.

🧹 Nitpick comments (1)
subgraph/packages/hopr-on-mainnet/schema.graphql (1)

1-1: immutable: false is redundant but harmless

Entities are mutable by default; the explicit immutable: false is 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

📥 Commits

Reviewing files that changed from the base of the PR and between a4dc63a and f9e0019.

⛔ Files ignored due to path filters (2)
  • subgraph/packages/hopr-on-gnosis/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • subgraph/packages/hopr-on-mainnet/yarn.lock is 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-cli is being bumped from 0.37.x0.97.1 and @graphprotocol/graph-ts from 0.29.x0.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 test locally (or in CI) before merging to ensure:

  1. AssemblyScript compilation still succeeds under the stricter as@1.x that ships with the new CLI.
  2. Generated typings are imported correctly by your src/mapping.ts files.
  3. 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 package

The 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) {
Copy link

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 | head

Length 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.

Suggested change
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.

Comment on lines +1 to +5
specVersion: 1.3.0
schema:
file: ./schema.graphql
indexerHints:
prune: never
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

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 runtime

Keep 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.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specify pruning settings in the Subgraph menifest

2 participants