Skip to content

feat(price_oracle): implement feeder registration, removal, and rotation admin surface (#200) - #326

Open
Dimank92 wants to merge 1 commit into
Zenith-options:mainfrom
Dimank92:feat/issue-200-price-oracle-feeder-admin
Open

Dimank92 wants to merge 1 commit into
Zenith-options:mainfrom
Dimank92:feat/issue-200-price-oracle-feeder-admin

Conversation

@Dimank92

Copy link
Copy Markdown

Summary

Closes #200

Implements the complete feeder management and governance admin surface for price_oracle:

  • Atomic Global Feeder Rotation: rotate_feeder replaces an active feeder with a new feeder in a single atomic transaction, preventing duplicate feeders, self-rotations, and emitting feeder_rotated(old, new).
  • Multisig Feeder Rotation: rotate_feeder_via_multisig validates and consumes proposal approvals through the pinned multisig contract.
  • Symbol-Specific Feeder Governance:
    • add_feeder_for_symbol: registers dedicated feeders for individual asset symbols (symbol_feeder_added).
    • remove_feeder_for_symbol: removes feeders with strict quorum underrun validation (Error::BelowQuorum if active feeders drop below min_reports, emitting symbol_feeder_removed).
    • rotate_feeder_for_symbol: atomically rotates symbol-specific feeders (symbol_feeder_rotated).
    • Query views: is_feeder_for_symbol, get_feeder_count_for_symbol, get_feeders_for_symbol.
  • Effective Feeder Resolution: storage::effective_feeder_list(env, symbol) prioritizes symbol-specific feeders when configured, seamlessly falling back to global feeders for full backwards compatibility.
  • Aggregate Recalculation: current_price resolves and averages reports from the effective feeder list.

Test Verification

All 157 unit, property, and admin tests in zenith-price-oracle pass cleanly:

test result: ok. 157 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.02s

Clippy passes with 0 warnings:

cargo clippy -p zenith-price-oracle --tests --no-deps -- -D warnings

Payout Address

  • Wallet: 0xC345C07229307d4f1c7935aD2cAe48e390215808
  • Network: Polygon / Base / Arbitrum / Stellar

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.

Implement price_oracle Feeder Registration, Removal, and Rotation Admin Surface

1 participant