Skip to content

feat: on-chain acceptance fixes for DIPs recurring agreements#1178

Open
MoonBoi9001 wants to merge 1 commit intofeat/dips-continuous-collectionfrom
fix/getrewards-subgraph-service
Open

feat: on-chain acceptance fixes for DIPs recurring agreements#1178
MoonBoi9001 wants to merge 1 commit intofeat/dips-continuous-collectionfrom
fix/getrewards-subgraph-service

Conversation

@MoonBoi9001
Copy link
Copy Markdown
Member

@MoonBoi9001 MoonBoi9001 commented Mar 12, 2026

Motivation

The indexer-agent's DIPs on-chain acceptance path had three issues preventing agreements from being accepted on-chain. These were discovered during local end-to-end testing of the full DIPs pipeline (dipper -> IISA -> proposal -> indexer-service -> agent -> SubgraphService contract).

Summary

1. Wrong contract in getRewards call

AllocationManager.stakeUsageSummary() called RewardsManager.getRewards(HorizonStaking, allocationId) but HorizonStaking is not a registered rewards issuer -- SubgraphService is. Every allocation operation (including DIPs acceptance) reverted with "Not a rewards issuer".

2. Acceptance latency exceeded RCA deadline

Proposal acceptance was tied to the agent's 120s reconciliation loop, requiring 2+ cycles (240s+) before attempting on-chain acceptance. The RCA deadline is 300s, leaving insufficient slack. Added a dedicated startProposalAcceptanceLoop() that polls pending_rca_proposals every 5 seconds, independent of the reconciliation cycle.

3. Opaque contract revert errors

When on-chain acceptance failed, the log showed error: null because tryParseCustomError couldn't decode unknown custom errors. Added full revert context (reason, data, message, contract target) to the rejection log so the root cause is immediately visible.

Test metadata version updated to 0 to match IndexingAgreementVersion.V1 (first Solidity enum variant = 0). See companion PRs: edgeandnode/dipper#583, graphprotocol/indexer-rs#983.

Generated with Claude Code

@github-project-automation github-project-automation bot moved this to 🗃️ Inbox in Indexer Mar 12, 2026
@github-project-automation github-project-automation bot moved this from 🗃️ Inbox to ✅ Approved in Indexer Mar 12, 2026
@MoonBoi9001 MoonBoi9001 marked this pull request as draft March 12, 2026 14:09
@MoonBoi9001 MoonBoi9001 changed the title fix: pass SubgraphService to RewardsManager.getRewards feat: on-chain acceptance for DIPs recurring agreements Mar 17, 2026
@MoonBoi9001 MoonBoi9001 force-pushed the fix/getrewards-subgraph-service branch 3 times, most recently from 9e70b84 to 163ac0b Compare March 18, 2026 01:08
@MoonBoi9001 MoonBoi9001 changed the title feat: on-chain acceptance for DIPs recurring agreements feat: on-chain acceptance fixes for DIPs recurring agreements Mar 18, 2026
@MoonBoi9001 MoonBoi9001 force-pushed the fix/getrewards-subgraph-service branch from 163ac0b to 3915cca Compare March 18, 2026 01:25
@MoonBoi9001 MoonBoi9001 marked this pull request as ready for review March 18, 2026 01:25
@MoonBoi9001 MoonBoi9001 force-pushed the fix/getrewards-subgraph-service branch from 3915cca to 3a60410 Compare March 18, 2026 01:30
@MoonBoi9001 MoonBoi9001 changed the base branch from feat/dips-on-chain-accept to feat/dips-continuous-collection March 18, 2026 01:30
@MoonBoi9001 MoonBoi9001 force-pushed the fix/getrewards-subgraph-service branch from 3a60410 to 9a65178 Compare March 18, 2026 01:31
Three fixes that together enable end-to-end DIPs on-chain acceptance:

1. Pass SubgraphService (not HorizonStaking) to RewardsManager.getRewards
   in the allocation stakeUsageSummary call.

2. Decouple DIPs proposal acceptance from the 120s reconciliation loop
   into a dedicated 5s polling loop (startProposalAcceptanceLoop). The
   300s RCA deadline left insufficient slack with the old 240s+ latency.

3. Log full revert context (reason, data, message, contract target) when
   on-chain acceptance fails, instead of just the parsed error (which was
   null for unknown custom errors).

Test metadata version updated to 0 to match the Solidity enum
IndexingAgreementVersion.V1 (first variant = 0).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@MoonBoi9001 MoonBoi9001 force-pushed the fix/getrewards-subgraph-service branch from 9a65178 to 15d1704 Compare March 18, 2026 01:38
@MoonBoi9001 MoonBoi9001 requested a review from Maikol March 18, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Approved

Development

Successfully merging this pull request may close these issues.

2 participants