[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.
## Motivation
When reviewing PRs with Claude, spinning up review agents produces a lot
of raw findings but the severity rankings are unreliable.
Pattern-matching agents flag dead code as critical vulnerabilities and
rank "two systems exist" as a security breach. The user ends up doing
more work triaging false positives than they saved by delegating the
review.
This skill addresses that by building a severity calibration pipeline
around the agents: each finding must prove impact (who calls it, what
triggers it, what happens), and a post-consolidation challenge step
verifies claims against the actual code before presenting results.
## Summary
- Spawns 6 specialized review agents in parallel (architecture,
correctness, security, test coverage, code quality, integration)
- Each agent has a defined lane with specific patterns to hunt for,
reducing overlap
- Severity challenge step verifies every Significant+ finding by reading
the code, checking callers, and asking "so what?"
- Gap check step searches for patterns agents commonly miss (fail-open
catches, parallel systems, data model inconsistencies, inverse findings)
- Writes verified findings to `pr-reviews/pr-{number}-review.md` with
checkboxes
Developed iteratively over 4 rounds of testing against real PRs
(graphprotocol/indexer#1172 and #1174), with severity calibration
improving each round.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added automated GitHub pull request review capability. The system
analyzes code changes across specialized review dimensions, evaluates
pull request metrics and complexity, identifies code issues at varying
severity levels with confidence signaling, performs targeted gap
analysis, and generates comprehensive review reports with detailed
findings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
No description provided.