Skip to content

refactor(dips): replace off-chain epoch vouchers with on-chain SignedRCA#942

Merged
MoonBoi9001 merged 5 commits intomain-dipsfrom
feat/dips-v2-migration
Feb 17, 2026
Merged

refactor(dips): replace off-chain epoch vouchers with on-chain SignedRCA#942
MoonBoi9001 merged 5 commits intomain-dipsfrom
feat/dips-v2-migration

Conversation

@MoonBoi9001
Copy link
Member

@MoonBoi9001 MoonBoi9001 commented Feb 9, 2026

Motivation

The IndexingAgreement.sol contract uses seconds-based pricing for fee computation. indexer-rs needs to validate and store SignedRCA proposals in a format the indexer agent can read and submit on-chain.

Summary

Implements DIPS using SignedRCA (RecurringCollectionAgreement), aligned with the on-chain contract.

Dipper                 indexer-rs                          Database
  |                        |                                   |
  |-- SignedRCA (gRPC) --> |                                   |
  |                        |-- validate signature              |
  |                        |-- fetch IPFS manifest             |
  |                        |-- verify network                  |
  |                        |-- check pricing                   |
  |                        |-- verify signer authorization     |
  |                        |-- store RCA --------------------->|
  |<-- Accept/Reject ----- |                                   |

Changes

  • Seconds-based pricing: Per-network tokens_per_second + global tokens_per_entity_per_second
  • Full validation: Signature, IPFS manifest, network, pricing, and authorization checks
  • IPFS resilience: 30s timeout per attempt with exponential backoff retry (10s, 20s, 40s delays)
  • Simplified storage: Write-only RcaStore trait (indexer agent reads directly from DB)
  • Config validation: Startup check for recurring_collector, warning if no pricing networks configured
  • Test coverage: 43 unit tests with AAA pattern

Related

@MoonBoi9001 MoonBoi9001 marked this pull request as draft February 9, 2026 22:50
@MoonBoi9001 MoonBoi9001 changed the title feat: migrate DIPS to V2 protocol with complete V1 deprecation refactor(dips): replace epoch-based vouchers with RecurringCollectionAgreement Feb 9, 2026
@MoonBoi9001 MoonBoi9001 force-pushed the feat/dips-v2-migration branch 2 times, most recently from 863d79a to d16bbf2 Compare February 9, 2026 23:09
@MoonBoi9001 MoonBoi9001 changed the title refactor(dips): replace epoch-based vouchers with RecurringCollectionAgreement refactor(dips): replace off-chain epoch vouchers with on-chain SignedRCA Feb 9, 2026
@MoonBoi9001 MoonBoi9001 force-pushed the feat/dips-v2-migration branch 4 times, most recently from cfdaa8c to 14b0ffe Compare February 10, 2026 16:14
@MoonBoi9001 MoonBoi9001 force-pushed the feat/dips-v2-migration branch 3 times, most recently from ffd681e to b4fe016 Compare February 12, 2026 20:24
@MoonBoi9001 MoonBoi9001 marked this pull request as ready for review February 12, 2026 21:00
@MoonBoi9001 MoonBoi9001 requested a review from Maikol February 12, 2026 21:01
@graphprotocol graphprotocol deleted a comment from github-actions bot Feb 12, 2026
@MoonBoi9001 MoonBoi9001 force-pushed the feat/dips-v2-migration branch 2 times, most recently from c516428 to 72ece73 Compare February 13, 2026 15:52
@MoonBoi9001 MoonBoi9001 added the DIPs Decentralized Indexing Payments label Feb 13, 2026
MoonBoi9001 and others added 5 commits February 16, 2026 11:02
Implement RecurringCollectionAgreement (RCA) protocol for DIPS,
aligned with the on-chain IndexingAgreement contract.

Changes:
- RcaStore trait and PostgreSQL implementation for RCA storage
- EIP-712 signature verification via escrow-based authorization
- validate_and_create_rca() with full validation pipeline:
  signature, IPFS manifest, network, pricing, deadline/expiry
- Database migration for pending_rca_proposals table

The indexer agent queries pending_rca_proposals directly and
decides acceptance on-chain via RecurringCollector contract.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add #[serde(default)] to DipsConfig for minimal config files
- Validate recurring_collector != Address::ZERO at startup
- Warn when tokens_per_second is empty (all proposals rejected)
- Bump pricing rejection logs to info level for visibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive documentation explaining architecture,
validation flow, trust model, and component responsibilities.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive test suite with AAA pattern:
- validate_and_create_rca: 11 tests covering all validation paths
- PriceCalculator: 7 tests (previously 0)
- SignerValidator implementations: 5 tests
- Test doubles: FailingIpfsFetcher, FailingRcaStore, RejectingSignerValidator

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add resilience to IPFS manifest fetching:
- 30 second timeout per attempt
- Up to 4 attempts with exponential backoff (10s, 20s, 40s)
- Worst case: ~190 seconds before rejection

Dipper gRPC timeout should be >= 220s. See edgeandnode/dipper#557.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@MoonBoi9001 MoonBoi9001 force-pushed the feat/dips-v2-migration branch from 72ece73 to 4392b79 Compare February 16, 2026 16:03
@MoonBoi9001 MoonBoi9001 changed the base branch from main to main-dips February 16, 2026 16:18

[dips.price_per_epoch]
[dips.tokens_per_second]
mainnet = "100"

Choose a reason for hiding this comment

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

These are quite high example values for per second rates?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link

@RembrandtK RembrandtK left a comment

Choose a reason for hiding this comment

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

Looks good, I think can merge. I left one comment for example config.

@MoonBoi9001 MoonBoi9001 merged commit eeaed69 into main-dips Feb 17, 2026
11 checks passed
@MoonBoi9001 MoonBoi9001 deleted the feat/dips-v2-migration branch February 17, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DIPs Decentralized Indexing Payments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants