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

refactor: changes to dips to better support payment collection in indexer-agent #608

Merged
merged 3 commits into from
Feb 12, 2025

Conversation

pcarranzav
Copy link
Member

@pcarranzav pcarranzav commented Feb 7, 2025

  • add last_allocation_id and last_payment_collected_at to the indexing_agreements table
  • improve the dips store to allow getting all the fields from the db (not needed now, but leaving it anyways as it's a nicer interface if we need it later)
  • move the dips database store to the dips crate
  • rename the grpc services to IndexerDipsService (indexer side) and DipperService (gateway side)
  • configure the tonic build to build both server and client for each service, and bump the npm package accordingly

Copy link
Contributor

github-actions bot commented Feb 7, 2025

Pull Request Test Coverage Report for Build 13208353292

Details

  • 38 of 303 (12.54%) changed or added relevant lines in 6 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-2.0%) to 76.823%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/dips/src/store.rs 17 18 94.44%
crates/service/src/service.rs 0 2 0.0%
crates/dips/src/proto/graphprotocol.indexer.dips.rs 0 116 0.0%
crates/dips/src/proto/graphprotocol.gateway.dips.rs 0 146 0.0%
Files with Coverage Reduction New Missed Lines %
crates/dips/src/lib.rs 1 91.6%
crates/tap-agent/src/agent/sender_allocation.rs 3 89.48%
Totals Coverage Status
Change from base Build 13184601149: -2.0%
Covered Lines: 7375
Relevant Lines: 9600

💛 - Coveralls

@pcarranzav pcarranzav force-pushed the pcv/dips-collection branch 2 times, most recently from d8b88eb to cfb8358 Compare February 7, 2025 21:27
@pcarranzav pcarranzav changed the title feat: collecting payments for DIPs agreements refactor: changes to dips to better support payment collection in indexer-agent Feb 7, 2025
@pcarranzav pcarranzav force-pushed the pcv/dips-collection branch 2 times, most recently from 8b139f7 to 845f6f3 Compare February 7, 2025 21:37
@pcarranzav pcarranzav marked this pull request as ready for review February 7, 2025 21:38
LNSD
LNSD previously approved these changes Feb 12, 2025
Copy link
Contributor

@LNSD LNSD left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@@ -2,7 +2,7 @@ syntax = "proto3";

package graphprotocol.indexer.dips;

service DipsService {
service IndexerDipsService {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest naming it GatewayDipsService.

Suggested change
service IndexerDipsService {
service GatewayDipsService {

I want to rename the "Dipper" to DIPs Gateway at some point in the future.

Copy link
Member Author

Choose a reason for hiding this comment

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

I imagine you mean in DipperService, rather than here, right?

@@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0

pub mod cost_model;
pub mod dips;
Copy link
Contributor

Choose a reason for hiding this comment

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

You removed dips from the modules but didn't remove dips.rs file. Is there any reason?

Copy link
Member Author

Choose a reason for hiding this comment

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

I moved it to database.rs on the dips crate, so it shows in git as moved rather than removed

Copy link
Contributor

Choose a reason for hiding this comment

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

You are right! Github tricked me

@pcarranzav pcarranzav requested a review from LNSD February 12, 2025 12:46
Copy link
Contributor

@gusinacio gusinacio left a comment

Choose a reason for hiding this comment

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

This PR affects directly DIPs with no changes in the rest of the application. LGTM

@pcarranzav pcarranzav merged commit f9453c4 into main Feb 12, 2025
10 checks passed
@pcarranzav pcarranzav deleted the pcv/dips-collection branch February 12, 2025 14:03
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.

3 participants