Skip to content

Bound oracle approval polling and handle registry root change gracefully - #787

Open
cyc60 wants to merge 2 commits into
masterfrom
fix-bound-oracle-approval-polling
Open

Bound oracle approval polling and handle registry root change gracefully#787
cyc60 wants to merge 2 commits into
masterfrom
fix-bound-oracle-approval-polling

Conversation

@cyc60

@cyc60 cyc60 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

poll_validation_approval looped without an attempt cap: on persistent NotEnoughOracleApprovalsError (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, ValidatorTask processed no blocks (no event scanning, no withdrawal subtask). poll_consolidation_signature had the same unbounded loop, hanging the consolidate command on a threshold shortfall. Additionally, RegistryRootChangedError — routine control flow raised whenever the registry root moves mid-poll — was caught nowhere and landed in BaseTask's catch-all, logging an error and incrementing exception_count for expected behavior.

Both polling loops are now bounded by APPROVALS_MAX_ATTEMPTS (env-configurable, default 10): validation polling re-raises the last NotEnoughOracleApprovalsError, consolidation polling raises ConsolidationError. register_new_validators handles 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, keeping exception_count for genuine anomalies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant