You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: document race condition between config changes and reward claims (TRST-L-2)
Add comprehensive documentation for TRST-L-2 race condition where
configuration changes (reducing eligibility period or enabling validation)
can cause indexers to permanently lose rewards if their claim transactions
are in-flight when the change occurs.
Changes include:
- NatSpec warnings on setEligibilityPeriod() and setEligibilityValidation()
- Contract-level security warning in RewardsEligibilityOracle
- Operational considerations section in documentation with mitigation strategies
- Monitoring guidance for operators and indexers
No code changes - mitigation relies on operational practices.
Copy file name to clipboardExpand all lines: packages/issuance/contracts/eligibility/RewardsEligibilityOracle.md
+103-2Lines changed: 103 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,6 +161,107 @@ It might initially seem safer to allow indexers by default unless an oracle expl
161
161
162
162
In general to be rewarded for providing service on The Graph, there is expected to be proof provided of good operation (such as for proof of indexing). While proof should be required to receive rewards, the system is designed for participants to have confidence is being able to adequately prove good operation (and in the case of oracles, be seen by at least one observer) that is sufficient to allow the indexer to receive rewards. The oracle model is in general far more suited to collecting evidence of good operation, from multiple independent observers, rather than any observer being able to establish that an indexer is not providing good service.
163
163
164
+
## Operational Considerations
165
+
166
+
### Race Conditions with Configuration Changes
167
+
168
+
Configuration changes can create race conditions with in-flight reward claim transactions, potentially causing indexers to permanently lose rewards.
169
+
170
+
When an indexer submits a transaction to claim rewards through the RewardsManager:
171
+
172
+
1. The indexer is eligible at the time of transaction submission
173
+
2. The transaction enters the mempool and waits for execution
174
+
3. A configuration change occurs (e.g., reducing `eligibilityPeriod` or enabling `eligibilityValidation`)
175
+
4. The transaction executes after the indexer is no longer eligible
176
+
5.**The indexer is denied rewards** resulting in permanent loss for the indexer
177
+
178
+
This occurs because the RewardsManager's `takeRewards()` function returns 0 rewards for ineligible indexers, but the calling contract (Staking or SubgraphService) still marks the allocation as processed.
179
+
180
+
Circumstances potentially leading to this race condition:
0 commit comments