Skip to content

chore: layer local-network deploy fixes on audit contracts#1332

Draft
MoonBoi9001 wants to merge 7 commits intomainfrom
mb9/dips-local-testing-fixes-v2
Draft

chore: layer local-network deploy fixes on audit contracts#1332
MoonBoi9001 wants to merge 7 commits intomainfrom
mb9/dips-local-testing-fixes-v2

Conversation

@MoonBoi9001
Copy link
Copy Markdown
Member

@MoonBoi9001 MoonBoi9001 commented May 7, 2026

TL;DR

This branch layers six local-network-only deployment fixes onto the audit-fixed contracts so local-network can pin a single contracts commit that has both the audit fixes and the testing fixes. The branch exists to support end-to-end DIPs runtime testing against indexing-payments-management-audit-fixed-rebased. Not intended for merge into main.

Summary

  • Add a missing Ignition dependency for HorizonStaking deployment
  • Link subgraph-service libraries in the Ignition module
  • Link transitive library dependencies for the IndexingAgreement contract stack
  • Add the RecurringCollector type to the toolshed horizon-contracts interface
  • Add the RecurringCollector decoder helpers used by the indexer-agent
  • Add the conditions field to the RCA decoder tuple to match the audit struct layout

MoonBoi9001 and others added 6 commits May 7, 2026 18:49
HorizonStaking's constructor extends GraphDirectory, which queries the
Controller for GraphToken, EpochManager, RewardsManager, etc. These are
registered by GraphPeripheryModule. Without an explicit `after` dependency,
Ignition may schedule HorizonStaking before the periphery registrations,
causing the constructor to read address(0) and revert with
GraphDirectoryInvalidZeroAddress.

Every other core module (GraphPayments, PaymentsEscrow, GraphTallyCollector,
RecurringCollector) declares this dependency. HorizonStaking was the only
outlier.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add IRecurringCollector to GraphHorizonContracts interface
- Re-export IRecurringCollector from interfaces main entrypoint
- Add encodeCollectIndexingFeesData() helper for indexing fee collection
- Add decoders: decodeSignedRCA, decodeAcceptIndexingAgreementMetadata,
  decodeIndexingAgreementTermsV1
- Add round-trip tests for all decoders and encoder
The audit-branch SubgraphService.sol now depends on four external
libraries (StakeClaims, AllocationHandler, IndexingAgreement,
IndexingAgreementDecoder) and a fifth constructor argument for the
RecurringCollector, but the Ignition deploy module was not updated to
match. Deploys fail at validation time with IGN716 (missing libraries)
and IGN703 (4 args expected 5), blocking any fresh hardhat deployment.

Deploy the four libraries up-front via m.library() and pass them
through deployImplementation's libraries option so the bytecode
placeholders resolve. Thread the RecurringCollector address from the
horizon deployment into the $global patch in deploy.ts, and add a
recurringCollectorAddress placeholder to both the default and
localNetwork protocol configs so Ignition can getParameter() it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ignition's validator walks each deployed library's bytecode, so it is
not enough to link the four libraries into SubgraphService and stop
there. IndexingAgreement calls into IndexingAgreementDecoder, which
calls into IndexingAgreementDecoderRaw, so both transitive links have
to be declared up-front or the deploy aborts on IGN716 while validating
the library futures themselves.

Deploy IndexingAgreementDecoderRaw first, link it into the Decoder,
and link the Decoder into IndexingAgreement. SubgraphService keeps its
existing four links unchanged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The audit-branch RecurringCollectionAgreement struct added a uint16
conditions field at position 9 (between maxSecondsPerCollection and
nonce). The toolshed decoder tuple was missing it, so decodeSignedRCA
read 10 fields against 11 ABI-encoded fields: nonce read what was
actually conditions, metadata read the wrong offset, decode threw.

The indexer-agent relies on this decoder to read pending RCA proposals
the indexer-service persists. Without the fix, every proposal logs
"Failed to decode pending RCA proposal" and is skipped, so the agent
never calls acceptIndexingAgreement on-chain and DIPs agreements
expire in dipper's DB.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@MoonBoi9001 MoonBoi9001 mentioned this pull request May 7, 2026
Run eslint --fix and prettier --write on the files introduced by the cherry-picked toolshed and ignition work, restoring the project's required import/export order and multi-line argument layout.
@MoonBoi9001 MoonBoi9001 force-pushed the mb9/dips-local-testing-fixes-v2 branch from 2a63a80 to 36c70b1 Compare May 7, 2026 11:21
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.16%. Comparing base (675d397) to head (36c70b1).

Additional details and impacted files
@@                                Coverage Diff                                 @@
##           indexing-payments-management-audit-fixed-rebased    #1332    +/-   ##
==================================================================================
  Coverage                                             91.16%   91.16%            
==================================================================================
  Files                                                    81       81            
  Lines                                                  5342     5342            
  Branches                                                975     1134   +159     
==================================================================================
  Hits                                                   4870     4870            
  Misses                                                  449      449            
  Partials                                                 23       23            
Flag Coverage Δ
unittests 91.16% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@RembrandtK
Copy link
Copy Markdown
Contributor

You might want to rebased on top of: deployment/testnet/2024-05-06/gip-0088

Base automatically changed from indexing-payments-management-audit-fixed-rebased to main May 9, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants