DS-1992 - Add countNilsAsFaults flag to MedianTask #21142
+212
−1
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.




https://smartcontract-it.atlassian.net/browse/DS-1992
What ?
This PR introduces a new flag available for the medianization task:
countNilsAsFaultswhen
countNilsAsFaultsis enabled :This new flags allows for preserving fault tolerance while preventing nils from crashing a medianization task.
added tests for:
Why ?
Problem
When a bridge returns HTTP 200 with a valid schema but null numeric values, the median task fails hard at decimal parsing (ErrBadInput), even when enough valid values exist to compute a result.
The existing lax flag doesn't solve this well: it filters nils early and doesn't count them as faults. With a typical config of allowedFaults = N-1, this silently bypasses fault tolerance, errors that would normally exceed the threshold slip through and the task can emit nil observations instead of failing.