[audit-10] document: [TRST-L-7] update() #1207
Open
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.
This patch is NOT A FIX but rather adding some docs. Here's the rationale:
Limited Impact: Opportunity for gain is limited to the last collection period.
Mutual Agreement Required: The update() function requires a signed RCAU (Recurring Collection Agreement Update) from the payer. This means any pricing changes are explicitly
agreed upon by both parties, not a unilateral action by the service provider. Both parties are aware of and consent to the new terms.
Implementation Complexity: The suggested mitigation of updating lastCollectionAt to the current timestamp would create periods where no fees can be collected if indexers forget to collect in the same tx before updating. Forcing this collection would also complicate the code.
Existing Safeguards: The protocol already has multiple safeguards:
This PR adds a small bit of documentation to make this behavior explicit in the contract comments, ensuring all integrators understand the timing implications when implementing update strategies.