Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding min and max ranges to check the value provided by the Oracle's #2922

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

asoto-iov
Copy link
Contributor

Description

This pull request introduces a configurable valid range (minValidPrice and maxValidPrice) for the BTC price retrieved from the oracle. The system will validate the price against this range before updating it. If the price is outside the range, it will not be updated, and a warning will be logged.

Motivation and Context

The motivation behind this change is to improve the robustness of the system by preventing updates with incorrect or extreme BTC prices. By enforcing a valid range, we can ensure that only reliable and expected values are used, minimizing potential risks and maintaining system integrity.

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • Tests for the changes have been added (for bug fixes / features)
  • Requires Activation Code (Hard Fork)
  • Other information:

@asoto-iov asoto-iov requested a review from a team January 9, 2025 16:20
@asoto-iov asoto-iov requested a review from a team as a code owner January 9, 2025 16:20
Copy link

github-actions bot commented Jan 9, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

Copy link
Contributor

@fmacleal fmacleal left a comment

Choose a reason for hiding this comment

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

Good job! I have a few comments though, let me know what you think.

Copy link
Contributor

@fmacleal fmacleal left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for have followed the suggestions. 🙂

@rmoreliovlabs
Copy link
Contributor

LGTM!

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.

3 participants