Skip to content

[DIPS] Cherry-pick old commits + contracts setup#1172

Merged
Maikol merged 7 commits into
main-dipsfrom
feat/dips-support
Apr 10, 2026
Merged

[DIPS] Cherry-pick old commits + contracts setup#1172
Maikol merged 7 commits into
main-dipsfrom
feat/dips-support

Conversation

@Maikol

@Maikol Maikol commented Feb 25, 2026

Copy link
Copy Markdown
Member

No description provided.

@github-project-automation github-project-automation Bot moved this to 🗃️ Inbox in Indexer Feb 25, 2026
@MoonBoi9001

Copy link
Copy Markdown
Member

@Maikol, just seen this PR while setting up local-network and had a query about merge strategy. Are we merging to main-dips here instead of main?

@Maikol

Maikol commented Feb 26, 2026

Copy link
Copy Markdown
Member Author

@MoonBoi9001 yes, good point. I'll create a main-dips from main and change the base branch for this PR.

@Maikol Maikol changed the base branch from main to main-dips February 26, 2026 13:48
@Maikol Maikol changed the title [WIP] Indexing Payments support [DIPS] Cherry-pick old commits + contracts setup Feb 26, 2026
@Maikol Maikol marked this pull request as ready for review February 26, 2026 13:48
pcarranzav and others added 6 commits March 11, 2026 15:46
This squashed commit adds support for DIPs (Distributed Indexing Payments), which allows
indexers to receive indexing fees for indexing subgraphs requested via the DIPs system.

Key changes:
- Add 'dips' as a new IndexingDecisionBasis enum value
- Add indexing agreements model and database support
- Add DIPs client for interacting with the gateway DIPs service
- Support for matching DIPs agreements with allocations
- Allow actions on deployments that are not published yet (for DIPs)
- Update allocation management to handle DIPs-based allocations
- Add proper handling for cancelled agreements

Co-authored-by: Multiple contributors from the DIPs development team
- Updated all DIPs-related code to use ethers v6 API
- Migrated from BigNumberish to bigint for all numeric operations
- Fixed provider and signer initialization patterns
- Updated test suite to use new ethers v6 patterns
- Removed temporary migration documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add DipsReceipt model with snake_case fields matching database conventions
- Update DipsCollector to store Receipt IDs instead of TAP receipts
- Implement GetReceiptById polling in collectAllPayments method
- Update to @graphprotocol/dips-proto 0.3.0 for new proto definitions
- Remove TAP receipt dependencies from DIPs payment flow
- Add comprehensive logging for payment status transitions

This completes the indexer-agent implementation for the new DIPs Safe
payment system, replacing TAP receipts with an asynchronous Receipt ID
based approach.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
The third DIP commit changed tryCollectPayment to use receipt-based
responses (receiptId, amount) but the test still mocked the old
tapReceipt-based response shape. Also regenerates yarn.lock with
new DIP dependencies.
@Maikol Maikol force-pushed the feat/dips-support branch from 7d5af34 to e8eb72f Compare March 11, 2026 19:10
Comment on lines +99 to +104
async tryUpdateAgreementAllocation(
deploymentId: string,
oldAllocationId: Address | null,
newAllocationId: Address | null,
) {
const agreement = await this.models.IndexingAgreement.findOne({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If two active agreements exist for the same deployment (e.g. different payers), only one gets its allocation tracking updated. Consider using findAll here, or adding cancelled_at: null to the where clause.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point. I think there might be more things to adjust for supporting multiple agreements. For MVP I think we could enforce a single agreement per subgraph. But we should still try to get it as close to supporting multiple so I can fix this in a later PR.


logger.info('Removing dips from decision basis')
await queryInterface.sequelize.query(
`ALTER TYPE "enum_IndexingRules_decisionBasis" DROP VALUE 'dips'`,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nice, we should probably clean this migration before merging. I'll add a task to do this.

@github-project-automation github-project-automation Bot moved this from 🗃️ Inbox to ✅ Approved in Indexer Apr 8, 2026
@Maikol Maikol merged commit 6b20bf6 into main-dips Apr 10, 2026
3 checks passed
@Maikol Maikol deleted the feat/dips-support branch April 10, 2026 13:21
@github-project-automation github-project-automation Bot moved this from ✅ Approved to 🚗 Merged in Indexer Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚗 Merged

Development

Successfully merging this pull request may close these issues.

3 participants