Bound oracle approval polling and handle registry root change gracefully - #787
Open
cyc60 wants to merge 2 commits into
Open
Bound oracle approval polling and handle registry root change gracefully#787cyc60 wants to merge 2 commits into
cyc60 wants to merge 2 commits into
Conversation
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.
Description
poll_validation_approvallooped without an attempt cap: on persistentNotEnoughOracleApprovalsError(oracles split on the expected validator index, or stuck one short of threshold) it spun until an unrelated network deposit changed the registry root — minutes on mainnet, potentially hours on quiet networks — and while it spun,ValidatorTaskprocessed no blocks (no event scanning, no withdrawal subtask).poll_consolidation_signaturehad the same unbounded loop, hanging theconsolidatecommand on a threshold shortfall. Additionally,RegistryRootChangedError— routine control flow raised whenever the registry root moves mid-poll — was caught nowhere and landed inBaseTask's catch-all, logging an error and incrementingexception_countfor expected behavior.Both polling loops are now bounded by
APPROVALS_MAX_ATTEMPTS(env-configurable, default 10): validation polling re-raises the lastNotEnoughOracleApprovalsError, consolidation polling raisesConsolidationError.register_new_validatorshandles both expected outcomes — registry root changed (info log) and approvals not collected (warning) — by returning cleanly so the next task cycle retries with fresh state, keepingexception_countfor genuine anomalies.