Skip to content

Conversation

@timbrinded
Copy link
Collaborator

When using the extra_addresses list in the idle_balances adapter config, you can add any address you like for scraping extra balances. This can be problematic if adding accounts unrelated to the vault in question (e.g. if typo or copy/paste error).

This PR now adds new checks to ensure that any extra addresses added to the idle_balances config has a public view function that can be called .subvault() which returns an address in that vault's list of subvaults. This is the case with the Swapper component being used on pre-prod: 0x17aeabfd3cb214a8757bf07d2e248d526c8c4809

image
[adapters.idle_balances]
extra_addresses = ["0x17aeabfd3cb214a8757bf07d2e248d526c8c4809"]
skip_extra_address_validation = true

This PR also adds an override to turn off this check for testing, which is gated by the --allow-dangerous CLI option flag

Copilot AI review requested due to automatic review settings December 4, 2025 20:27
@timbrinded timbrinded added the enhancement New feature or request label Dec 4, 2025
Copilot finished reviewing on behalf of timbrinded December 4, 2025 20:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds validation for extra_addresses in the idle_balances adapter to prevent configuration errors where unrelated addresses might be added by mistake. The validation ensures that each extra address has a .subvault() method that returns an address matching one of the auto-discovered subvaults.

Key changes:

  • Added skip_extra_address_validation configuration flag to bypass validation (requires --allow-dangerous CLI flag)
  • Centralized dangerous option validation in main.py using a new get_dangerous_options() method
  • Improved error messages to include detailed failure information
  • Decoupled extra_addresses from additional_asset_support flag

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/tq_oracle/settings.py Added skip_extra_address_validation field to IdleBalancesAdapterSettings and implemented get_dangerous_options() method to centralize dangerous option checking
src/tq_oracle/main.py Added validation to check for dangerous options and require --allow-dangerous flag before execution
src/tq_oracle/adapters/asset_adapters/idle_balances.py Implemented _validate_extra_addresses() method to validate extra addresses have correct .subvault() method, decoupled extra_addresses from additional_asset_support flag
src/tq_oracle/pipeline/assets.py Improved error message formatting to include detailed error information, removed old dangerous option validation (moved to main.py)
tests/adapters/asset_adapters/test_idle_balances.py Added comprehensive tests for validation logic including success, failure, and skip scenarios; updated existing test to reflect extra_addresses decoupling
tests/pipeline/test_assets.py Updated test regex patterns to match new multi-line error message format

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants