Add maxHeightDelta setting to exclude stale data #47
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.
This pull request introduces a new configuration option
maxHeightDelta
to the application, which represents the maximum acceptable difference between the block heights of the most current fee estimates. ThemaxHeightDelta
is added to theDataProviderManager
class and is used to filter out data points that don't meet the relevancy threshold criteria. The changes also include the necessary updates to the configuration files and the server setup.Here are the most significant changes:
Configuration updates:
README.md
: Added a new configuration optionsettings.maxHeightDelta
to the list of available configuration options.config/custom-environment-variables.json
: Included themaxHeightDelta
in the environment variable mapping.config/default.json
: Added a default value formaxHeightDelta
.Codebase changes:
src/lib/DataProviderManager.ts
: AddedmaxHeightDelta
as a member of theDataProviderManager
class. Replaced thegetSortedDataPoints
method withgetRelevantDataPoints
that filters out data points based on themaxHeightDelta
. [1] [2] [3]src/server.tsx
: RetrievedmaxHeightDelta
from the configuration and passed it to theDataProviderManager
constructor. [1] [2]Test updates:
test/DataProviderManager.test.ts
: Updated the test case to match the new behavior.