Draft
Conversation
…hooks Add contract approver support and unsigned accept/update operations to RecurringCollector. Extend SubgraphService and IndexingAgreement library with hooks to support external agreement management.
IndexingAgreementManager enables payers to register indexing agreements backed by RecurringCollector escrow. Supports offer/update lifecycle, agreement reconciliation, maintenance, and cancellation with automatic escrow deposit management.
Unit tests covering register, reconcile, maintain, cancel, revoke, offer updates, and removal. Includes fuzz tests, multi-indexer scenarios, and edge case coverage.
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
Escrow management
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
The CancelIndexingAgreementByPayer_Revert_WhenNotAuthorized test could fail when the fuzzer generated a rando address matching the payer or authorized signer, causing the authorization check to legitimately pass.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## rem-baseline-merge #1290 +/- ##
======================================================
- Coverage 86.80% 81.58% -5.22%
======================================================
Files 46 47 +1
Lines 2485 2644 +159
Branches 743 787 +44
======================================================
Hits 2157 2157
- Misses 328 487 +159
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft proposal for discussion. Not final code, but enough to demonstrate the concept.
This model is simpler than the previous spike based on signal and involves no changes to staking, curation, disputes, token economics, or the collection/payment math itself. The existing signed RCA flow continues to work unchanged.
It does involve additional contract code. I think the code changes are minor and the new contract is quite simple. The value of using this approach is high IMO.
An alternative purely off-chain model would require an operator service that holds a payer key, monitors agreement state, calculates escrow requirements, and submits deposit transactions. The contracts here replace that service with a small set of on-chain primitives. The tradeoffs favour on-chain for this use case:
Reliability
An off-chain funding service is a single point of failure. The on-chain model makes escrow funding atomic with agreement offers, there is no window where an agreement exists but escrow doesn't cover it. Reconciliation is permissionless, so any party can top up escrow after a collection without depending on one operator's infrastructure.
State consistency
An off-chain service must reconstruct agreement state from chain events, and every state transition is a potential desync. The on-chain model delegates to RecurringCollector.getMaxNextClaim() as a single source of truth.
Operational simplicity
The off-chain model requires a hot wallet, a monitoring service, deposit scheduling, underfunding alerts, and a state database. The on-chain model requires calling offerAgreement and periodically calling reconcile.
Escrow efficiency
On-chain funding is precise and on-demand: escrow is sized to exactly the sum of worst-case next claims and adjusted after each collection. An off-chain service would need to over-allocate as a safety margin to account for timing uncertainty and latency in deposit transactions.
Transparency
Agreement terms, escrow balances, and funding deficits are all visible on-chain. Indexers and other participants can independently verify that escrow backing exists for their agreements rather than trusting an opaque off-chain service to maintain it. This also supports tighter escrow sizing because participants can be more comfortable with lower margins when top-ups are transparent and predictable.
Time to deliver
The on-chain contract is self-contained and deterministic. It can be tested with standard Foundry/Hardhat tooling and is easy to deploy. An off-chain escrow manager needs event-driven state reconstruction, race condition handling, transaction retry logic, its own infrastructure, and an independent deployment and monitoring pipeline. That's significantly more work to build, test, and get right.