feat: add decentralized oracle aggregator with medianizer and outlier trimming (#69) - #200
Open
bellofuad34-ctrl wants to merge 5 commits into
Open
Conversation
…and outlier trimming (agnesnaomiolim-cloud#69)
|
@bellofuad34-ctrl Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Owner
|
This branch has a conflict; resolve it. |
Owner
|
CI check failed; please resolve that. |
Resolve Cargo.lock/Cargo.toml conflicts with main.
Fix security-scan workflow: invalid \\$\{{ matrix.os }}\ reference (no
matrix defined) broke the whole workflow; correct kube-bench download URL,
k6 action, and k6 script name.
- compliance-kube-bench referenced \\$\{{ matrix.os }}\ but the job has no
matrix, which invalidates the whole workflow and fails the run before any
job starts. Use the correct kube-bench release asset URL instead.
- fix escaped quotes in the curl command.
- use the existing grafana/k6-action@v0.3.1 and correct k6 script name.
Author
|
Hi maintainers 👋 -- this PR is ready for review and merge. What has been updated:
Maintainer actions needed:
Could you review and merge? Thanks! |
Author
|
@agnesnaomiolim-cloud this PR is ready to merge -- branch conflict is resolved and the broken security-scan workflow has been fixed in this branch. Could you please approve the pending workflow runs and merge? Thank you! |
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.
Closes #69
Summary
Implements a decentralized oracle aggregator with medianizer and outlier trimming, addressing #69.
Changes
contracts/oracle-aggregator/src/lib.rs: New Soroban contractOracleAggregatorthat:add_feed/remove_feed, admin-only).u128withsaturating_mul, no floating point, no overflow risk).contracts/oracle-aggregator/src/math.rs: Pure, overflow-safe math module (median,median_of_sorted,trimmed_median,deviation_bps,is_outlier,is_stale,mid) with exhaustive unit tests.contracts/oracle-aggregator/tests/oracle_aggregator_tests.rs: Property-based tests (proptest) verifying mathematical safety across edge-case input vectors (extremeu128values, zero references, clustered adversarial feeds), plus end-to-end contract tests including the required +500% spike scenario (1 of 5 oracles spiked; aggregated price stays stable).Cargo.toml: Registers the contract as a workspace member and removeslto/panicfrom the per-package profile override (these keys are invalid in[profile.*.package.*]per the Cargo reference and blocked the whole workspace from parsing; CI on main was already red onBuild).Cargo.lock: Updated for the new workspace member.Verification
cargo build -p oracle-aggregator --target wasm32-unknown-unknown --releasesucceeds.cargo test -p oracle-aggregatorpasses: 8 unit tests + 12 integration/property tests.cargo clippy -p oracle-aggregatoris clean.get_pricereturns the honest median (100), not the spike.