feat(monitors): detect ManagedOptimisticOracleV2 upgrades and adjust expiration messaging#4929
Open
Reinis-FRP wants to merge 1 commit intomasterfrom
Open
Conversation
…expiration messaging Adds detection for upgraded ManagedOptimisticOracleV2 contracts that have new dispute window behavior where proposals can be disputed even after expirationTime until settled. Changes: - Add managedOOV2PreUpgradeBlock config option to specify pre-upgrade block number - Implement _detectManagedOOV2Upgraded() to check EIP-1967 implementation slot - Adjust proposal message from "will expire at X" to "can be settled after X (but remains disputable until settled)" for upgraded contracts - Add lazy initialization with caching for upgrade detection - Add 5 comprehensive tests covering all detection scenarios The implementation is backward compatible - without the config, standard messaging is used. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
md0x
approved these changes
Feb 5, 2026
Contributor
md0x
left a comment
There was a problem hiding this comment.
Nice work! While porting this to mcp-otb, I considered adding an optional fast path: a managedOOV2UpgradeBlock config that simply checks currentBlock >= upgradeBlock without the EIP-1967 slot comparison.
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
ManagedOptimisticOracleV2 is being upgraded to change how the dispute window works. In the upgraded version,
expirationTimewill mark the earliest time when an undisputed proposal can be settled, but proposals will remain disputable even afterexpirationTimeas long as they haven't been settled yet. The monitor bot needs to detect this upgrade and adjust its messaging accordingly to avoid confusion.Summary
managedOOV2PreUpgradeBlockconfiguration option to specify the block number before the upgrade_detectManagedOOV2Upgraded()method that checks the EIP-1967 implementation slot and compares implementation addresses at different blocksDetails
The implementation detects upgraded ManagedOptimisticOracleV2 contracts by:
0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc)The detection runs once on the first call to
checkForProposals()and the result is cached for subsequent calls to avoid repeated RPC calls.Testing
Added 5 comprehensive tests covering all scenarios:
managedOOV2PreUpgradeBlockis not configuredAll tests passing (5 passing in 25s).
Issue(s)
Fixes #FRO-3