Skip to content

Refactor Graph network topology#318

Merged
Theodus merged 10 commits intomainfrom
theodus/subgraphs
May 5, 2023
Merged

Refactor Graph network topology#318
Theodus merged 10 commits intomainfrom
theodus/subgraphs

Conversation

@Theodus
Copy link
Member

@Theodus Theodus commented May 5, 2023

This is an important step for facilitating many upcoming features. Changes include:

  • Ensuring that all manifests get at least one chance to cat from IPFS before accepting client queries. This should reduce the occasional hiccups on gateway restarts.
  • Simplify the data pipeline between the network subgraph & other sources into the gateway's view of the Graph network.
  • Only load network parameters once on startup, to reduce unnecessary network subgraph queries.
  • Allow the ISA to select over potentially multiple deployments (not used yet).

Important files to review: topology.rs & network_subgraph.rs

@Theodus Theodus requested a review from cmwhited May 5, 2023 16:56
Copy link
Contributor

@cmwhited cmwhited left a comment

Choose a reason for hiding this comment

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

Pretty mega code change. I wouldn't say "no" to more tests. But LGTM. Didn't say anything that I thought needed changes. Good work, as always

// https://github.com/graphprotocol/graph-node/blob/master/docs/subgraph-manifest.md
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ManifestSrc {
Copy link
Contributor

Choose a reason for hiding this comment

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

rust question here. does marking these as pub mean they are available outside of this module (file)? Or not because they are defined within the scope of this cat_manifest fn? Also, what is the reason for putting them in here, other than constraining them to this scope?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question. As far as I know, putting pub on these structs & fields is completely nonsensical. And my reason for putting them in function scope is just because they're only used in this function, and just describe how to deserialize the response body.

@Theodus Theodus merged commit a246f64 into main May 5, 2023
@Theodus Theodus deleted the theodus/subgraphs branch May 5, 2023 20:18
@Theodus Theodus mentioned this pull request May 8, 2023
Theodus added a commit that referenced this pull request May 10, 2023
This is an important step for facilitating many upcoming features.
Changes include:
- Ensuring that all manifests get at least one chance to cat from IPFS
before accepting client queries. This should reduce the occasional
hiccups on gateway restarts.
- Simplify the data pipeline between the network subgraph & other
sources into the gateway's view of the Graph network.
- Only load network parameters once on startup, to reduce unnecessary
network subgraph queries.
- Allow the ISA to select over potentially multiple deployments (not
used yet).
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.

2 participants