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
{{ message }}
Repository navigation
Do not apply tradingDelay to forwardRevenue() - #1319
Trust audit question "tradingDelay's old purpose and check in forwardRevenue".
forwardRevenue() already requires the basket to be ready (isReady(), which includes the warmup period) and the RToken to be fully collateralized. After an emergency basket change the RToken is normally undercollateralized, so the delay check added nothing there. Where it did bind, on a fully collateralized RToken, it only paused revenue. For example, after governance swapped a plugin and a permissionless refresh followed, revenue stopped for the whole delay.
This is a change from 4.2.0, where the delay applied to forwardRevenue() after every basket change.
Changes
contracts/p1/BackingManager.sol, contracts/p0/BackingManager.sol: remove the tradingDelay check from forwardRevenue(). The rebalance() check is unchanged.
test/Revenues.test.ts: the two revenue-delay tests become one that checks forwarding waits for the warmup period and not for the trading delay. A second test covers outstanding supply: after a permissionless basket switch, forwardRevenue() reverts with undercollateralized until the backing is restored, then forwards while the trading delay is still running.
docs/deployment-variables.md: says the delay applies to rebalancing only, and adds a second reason for it: it gives bidders time to prepare, so rebalancing auctions do not open into poor liquidity.
CHANGELOG.md
BackingManagerP1 shrinks from 24,573 to 24,249 bytes (limit 24,576).
Verification
Both new revenue tests pass on P0 and P1. The tests they replace asserted the old trading delayed revert.
Full test/*.test.ts on P0 and P1, the plugin, library, scenario and registry suites, and the mainnet and Base upgrade fork task were run at the top of the stack (see the next PR); all pass.
Revenue can now be forwarded during the trading delay, provided the basket is ready, no trades are open, and the system is fully collateralized.
The trading delay continues to apply to rebalancing trades, not revenue forwarding.
Documentation
Clarified when the trading delay applies, including differences between emergency and governance basket changes, and noted that issuance and revenue forwarding remain available during the delay.
forwardRevenue() already requires the basket to be ready and the RToken
to be fully collateralized. The trading delay is about rebalancing, so
it no longer gates revenue forwarding.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Review was skipped as selected files did not have any reviewable changes.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: a3dce0e0-16e8-4ce8-b7d7-be5f36ea9cb9
Commits
Reviewing files that changed from the base of the PR and between 23a528c and 8fea74d.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
Revenue forwarding in both BackingManager versions no longer waits for the trading delay. Tests verify that collateralization and basket readiness still affect forwarding. The changelog and deployment-variable documentation describe the revised delay behavior.
Changes: Revenue forwarding during trading delay
Layer / File(s)
Summary
Remove the forwarding delay gate contracts/p0/BackingManager.sol, contracts/p1/BackingManager.sol
Both BackingManager versions remove the trading-delay check from forwardRevenue(). Other forwarding requirements remain.
Verify and document forwarding behavior test/Revenues.test.ts, CHANGELOG.md, docs/deployment-variables.md
Tests cover forwarding during an active delay, including collateralization and basket readiness. Documentation states that the delay applies to rebalancing, not revenue forwarding.
reserve-protocol/protocol#1297: Changes trading-delay behavior for basket-triggered actions and adds a bypass flag that affects revenue forwarding timing.
Suggested reviewers:akshatmittal, julianmrodri
Merge Risk: Minimal · previous review 761dc
Revenue forwarding no longer waits for the trading delay, while basket readiness and full collateralization are still required. Tests and docs are updated to match. No concrete merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: forwardRevenue() no longer applies tradingDelay. The raw summary shows the P0 and P1 BackingManager changes removing the delay check from forwardRevenue(), plus the ma…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: forwardRevenue() no longer applies tradingDelay. The raw summary shows the P0 and P1 BackingManager changes removing the delay check from forwardRevenue(), plus the matching docs, changelog, and revenue test updates. The title is specific and short, so it fits the changeset.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 931597d0-08a7-4fe7-adc0-33bce7b708c9
Commits
Reviewing files that changed from the base of the PR and between c56151f and 761dcbc.
Files selected for processing: 5
CHANGELOG.md
contracts/p0/BackingManager.sol
contracts/p1/BackingManager.sol
docs/deployment-variables.md
test/Revenues.test.ts
Files with no reviewable changes: 2
contracts/p0/BackingManager.sol
contracts/p1/BackingManager.sol
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
After a permissionless basket switch, forwardRevenue() reverts with
'undercollateralized' until the backing is restored, then forwards while
rebalance() still reverts with 'trading delayed'.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Asserting 'trading delayed' from rebalance() after the backing is restored
pinned the order of two guards.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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
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.
Summary
BackingManager.forwardRevenue()no longer waits fortradingDelay. The delay now only applies to rebalancing.Stacked on #1317.
Why
Trust audit question "tradingDelay's old purpose and check in forwardRevenue".
forwardRevenue()already requires the basket to be ready (isReady(), which includes the warmup period) and the RToken to be fully collateralized. After an emergency basket change the RToken is normally undercollateralized, so the delay check added nothing there. Where it did bind, on a fully collateralized RToken, it only paused revenue. For example, after governance swapped a plugin and a permissionless refresh followed, revenue stopped for the whole delay.This is a change from 4.2.0, where the delay applied to
forwardRevenue()after every basket change.Changes
contracts/p1/BackingManager.sol,contracts/p0/BackingManager.sol: remove thetradingDelaycheck fromforwardRevenue(). Therebalance()check is unchanged.test/Revenues.test.ts: the two revenue-delay tests become one that checks forwarding waits for the warmup period and not for the trading delay. A second test covers outstanding supply: after a permissionless basket switch,forwardRevenue()reverts withundercollateralizeduntil the backing is restored, then forwards while the trading delay is still running.docs/deployment-variables.md: says the delay applies to rebalancing only, and adds a second reason for it: it gives bidders time to prepare, so rebalancing auctions do not open into poor liquidity.CHANGELOG.mdBackingManagerP1shrinks from 24,573 to 24,249 bytes (limit 24,576).Verification
trading delayedrevert.test/*.test.tson P0 and P1, the plugin, library, scenario and registry suites, and the mainnet and Base upgrade fork task were run at the top of the stack (see the next PR); all pass.🤖 Generated with Claude Code
Summary by CodeRabbit