fix(oo-v3): revalidates cached whitelist entries#4954
Draft
tcoatswo wants to merge 1 commit into
Draft
Conversation
Signed-off-by: Tyler Coatsworth <tyler@coatsworth.me>
0e04fdb to
62eaa1f
Compare
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.
Motivation
OptimisticOracleV3 caches positive collateral and identifier whitelist results
to avoid repeated external calls. The current positive-cache fast paths treat
those results as non-revocable: after governance removes a previously cached
currency or identifier,
assertTruthcontinues to accept it until an externalcaller explicitly invokes
syncUmaParams.This bypasses the live governance state for new assertions. A removed
identifier has an additional failure mode because the DVM revalidates the
identifier when a dispute requests a price. OOv3 can accept the assertion from
its stale cache while the DVM rejects the dispute against the live whitelist.
The reverted dispute leaves the assertion undisputed, allowing it to settle as
true after liveness.
A removed collateral currency can likewise continue securing new assertions
even when governance has determined that the token is no longer suitable.
Summary
every new assertion.
new assertion.
currency is first added or re-added to the OOv3 cache.
or currency immediately blocks new assertions without requiring
syncUmaParams.Details
The identifier path no longer returns early on a cached
truevalue. Itupdates the cached value from
IdentifierWhitelist.isIdentifierSupportedonevery validation.
The currency path first checks
AddressWhitelist.isOnWhitelistlive. If thecurrency has been removed, validation returns false. If it is live-whitelisted
but is not currently represented by a positive cache entry, OOv3 restores the
entry and fetches its final fee. Existing positive entries continue to reuse
their cached final fee.
This keeps the expensive Store lookup cached while ensuring that revocable
authorization is never inferred solely from stale local state.
The change affects only creation of new assertions. Existing assertions retain
their recorded currency and identifier and continue through their existing
lifecycle.
Testing
Command:
Result:
Issue(s)
Security-sensitive fix. No public issue was opened before the patch to avoid
publishing the vulnerable behavior without a proposed remediation.