feat: enumerate OffchainQuotedLinearFee standing quotes#8904
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough
ChangesStanding-quote enumeration in OffchainQuotedLinearFee
Sequence Diagram(s)sequenceDiagram
participant Offchain as Offchain Caller
participant Contract as OffchainQuotedLinearFee
participant Sets as EnumerableSet Indices
participant QuoteStore as quotes mapping
rect rgba(34, 139, 34, 0.5)
note over Offchain,QuoteStore: Write path (standing quote)
Offchain->>Contract: storeStandingQuote(dest, recipient, quote)
Contract->>Sets: _domainIds.add(dest)
Contract->>Sets: _recipients[dest].add(recipient)
Contract->>QuoteStore: quotes[dest][recipient] = StoredQuote
end
rect rgba(70, 130, 180, 0.5)
note over Offchain,QuoteStore: Read path (enumeration)
Offchain->>Contract: quoteDomains()
Contract->>Sets: _domainIds.values()
Sets-->>Contract: uint32[] domainIds
Contract-->>Offchain: uint32[] memory
Offchain->>Contract: getQuotesForDomain(domainId)
Contract->>Sets: _recipients[domainId].values()
Sets-->>Contract: bytes32[] recipientKeys
Contract->>QuoteStore: quotes[domainId][key] for each key
QuoteStore-->>Contract: StoredQuote entries
Contract-->>Offchain: QuoteEntry[] memory
end
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## audit-q3-2026 #8904 +/- ##
=================================================
+ Coverage 79.33% 79.42% +0.08%
=================================================
Files 143 143
Lines 4278 4296 +18
Branches 436 437 +1
=================================================
+ Hits 3394 3412 +18
Misses 855 855
Partials 29 29
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Description
Exposes
OffchainQuotedLinearFee's standing-quote mapping for offchain enumeration.The
quotesmapping (destination => recipient => StoredQuote) is write-only from the chain's perspective — there was no way to enumerate which standing quotes exist. This adds enumerable key-tracking and two views:quoteDomains()— returns the domain ids that have at least one standing quote.getQuotesForDomain(domainId)— returns every quote stored under that exact domain key asQuoteEntry[](recipient key +StoredQuote).Implementation:
QuoteEntry { bytes32 recipient; StoredQuote quote; }struct.EnumerableSet.UintSetof domain ids and a per-domainEnumerableSet.Bytes32Setof recipients. Keys are tracked (idempotently) whenever a standing quote is stored; the quote data itself stays in the existingquotesmapping.quote.expiry.WILDCARD_DEST(type(uint32).max) key and apply to every destination, so callers computing effective fees must also querygetQuotesForDomain(WILDCARD_DEST). This is documented on the view and covered by a dedicated test.Drive-by changes
None.
Related issues
None.
Backward compatibility
Yes. Additive only — two new view functions, a new struct, and two private storage sets appended after existing storage. No changes to existing function signatures, the
quotesmapping, or fee resolution behavior.Testing
Unit Tests (Forge). Added a "Quote Enumeration" suite to
OffchainQuotedLinearFee.t.solcovering:WILDCARD_DESTkey, not under specific destinations