Skip to content
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

Port subgraph indexer-service to the indexer service framework #104

Merged
merged 20 commits into from
Dec 13, 2023

Conversation

Jannis
Copy link
Collaborator

@Jannis Jannis commented Nov 24, 2023

This partly reimplements the existing Rust indexer-service and ports it to the HTTP indexer framework that was merged in #80. I've tested this using a local network environment setup, to make sure that various pieces work, including

  • handling queries received from the gateway
  • extracting and storing receipts
  • status API compatibility with the gateway
  • cost API compatibility with the gateway
  • forwarding requests to graph-node
  • detecting if graph-node responses are attestable and creating attestations if that's the case
  • returning valid responses to the gateway

I can confirm that all of this works end to end.

And thanks to using the framework, we're able to delete ~1200 lines of code.

@Jannis Jannis changed the base branch from main to jannis/http-indexer-service November 24, 2023 14:12
@Jannis Jannis force-pushed the jannis/http-indexer-service branch from c6f220b to 6f7316a Compare November 24, 2023 17:53
@Jannis Jannis force-pushed the jannis/subgraph-service branch from cb9adee to f9f4728 Compare November 27, 2023 21:16
@Jannis Jannis force-pushed the jannis/http-indexer-service branch from 21fa80d to daa7acd Compare November 28, 2023 12:43
@Jannis Jannis force-pushed the jannis/http-indexer-service branch 3 times, most recently from 882d7f0 to 760df33 Compare December 1, 2023 23:27
@Jannis Jannis force-pushed the jannis/subgraph-service branch 3 times, most recently from 69aa73a to 82c2b60 Compare December 7, 2023 16:57
Base automatically changed from jannis/http-indexer-service to main December 8, 2023 13:24
@Jannis Jannis force-pushed the jannis/subgraph-service branch from 82c2b60 to 0434d96 Compare December 8, 2023 13:46
@Jannis Jannis marked this pull request as ready for review December 8, 2023 13:47
@Jannis Jannis requested a review from aasseman December 8, 2023 13:48
@Jannis Jannis requested review from hopeyen and Theodus December 8, 2023 13:48
Copy link
Contributor

github-actions bot commented Dec 8, 2023

Pull Request Test Coverage Report for Build 7182324916

  • 186 of 496 (37.5%) changed or added relevant lines in 16 files are covered.
  • 54 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+7.0%) to 63.286%

Changes Missing Coverage Covered Lines Changed/Added Lines %
common/src/attestations/dispute_manager.rs 10 11 90.91%
service/src/cli.rs 0 2 0.0%
service/src/config.rs 0 3 0.0%
common/src/indexer_service/http/request_handler.rs 0 4 0.0%
common/src/escrow_accounts.rs 18 24 75.0%
common/src/indexer_service/http/static_subgraph.rs 0 9 0.0%
service/src/database.rs 0 9 0.0%
common/src/subgraph_client/client.rs 91 102 89.22%
service/src/routes/cost.rs 0 12 0.0%
common/src/indexer_service/http/indexer_service.rs 0 68 0.0%
Files with Coverage Reduction New Missed Lines %
common/src/indexer_service/http/indexer_service.rs 1 0.0%
common/src/indexer_service/http/request_handler.rs 1 0.0%
service/src/config.rs 1 0.0%
common/src/attestations/signer.rs 24 73.03%
common/src/subgraph_client/client.rs 27 87.01%
Totals Coverage Status
Change from base Build 7141914841: 7.0%
Covered Lines: 2296
Relevant Lines: 3628

💛 - Coveralls

Copy link
Contributor

@aasseman aasseman left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple questions.
Also a test is failing.

service/src/config.rs Outdated Show resolved Hide resolved
@Jannis
Copy link
Collaborator Author

Jannis commented Dec 11, 2023

Added the optional, previously missing /network and /escrow subgraph serving back in, including an optional auth token for each endpoint and a 50 req/s rate limit. All very similar to this: https://github.com/graphprotocol/indexer/blob/main/packages/indexer-service/src/server/index.ts#L211-L236

@Jannis Jannis force-pushed the jannis/subgraph-service branch 3 times, most recently from 9379047 to 718e96d Compare December 11, 2023 21:58
@Jannis Jannis force-pushed the jannis/subgraph-service branch from 718e96d to 138a5e6 Compare December 11, 2023 22:15
@Jannis
Copy link
Collaborator Author

Jannis commented Dec 12, 2023

@aasseman Tests are passing now 😄

@Jannis Jannis merged commit b5eebce into main Dec 13, 2023
7 checks passed
@Jannis Jannis deleted the jannis/subgraph-service branch December 13, 2023 09:07
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