[DIPS] Cherry-pick old commits + contracts setup#1172
Conversation
|
@Maikol, just seen this PR while setting up local-network and had a query about merge strategy. Are we merging to |
|
@MoonBoi9001 yes, good point. I'll create a main-dips from main and change the base branch for this PR. |
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.
7d5af34 to
e8eb72f
Compare
| async tryUpdateAgreementAllocation( | ||
| deploymentId: string, | ||
| oldAllocationId: Address | null, | ||
| newAllocationId: Address | null, | ||
| ) { | ||
| const agreement = await this.models.IndexingAgreement.findOne({ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'`, |
There was a problem hiding this comment.
PostgreSQL doesn't support ALTER TYPE ... DROP VALUE.
https://www.postgresql.org/docs/current/datatype-enum.html#DATATYPE-ENUM-IMPLEMENTATION-DETAILS
There was a problem hiding this comment.
Nice, we should probably clean this migration before merging. I'll add a task to do this.
No description provided.