Repository navigation
Price nil guard - #6227
Merged
Merged
Price nil guard#6227
Conversation
A pricer that has not loaded prices from discovery only has the built-in defaults, which have no previous price. IsPriceValid then dereferenced a nil pointer in getPreviousByType for any consumer price that was not the default. The panic happens in the session validation goroutine of SessionManager.Start, which has no recover, so it stopped the whole node. Missing price data now yields no price, and the consumer price is refused instead.
The provider accepted any consumer price that was not higher than the built-in default, including zero. A consumer could therefore start a public session at a price that pays nothing. IsPriceValid now accepts only the current or previous discovery price. Until prices are loaded from discovery, the current price is the built-in default, so consumers using that default are still accepted. A refused session is logged as a warning with the consumer, service and price.
mdomasevicius
requested review from
Waldz,
redmundas and
soffokl
as code owners
October 26, 2026 05:59
soffokl
approved these changes
Oct 26, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6227 +/- ##
==========================================
+ Coverage 26.13% 26.52% +0.39%
==========================================
Files 544 544
Lines 31597 31609 +12
==========================================
+ Hits 8258 8385 +127
+ Misses 22491 22372 -119
- Partials 848 852 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Mantas Domasevicius <mantas@mysterium.network>
mdomasevicius
force-pushed
the
fix/pricer-nil-guard
branch
from
October 26, 2026 06:43
3a43fe9 to
13ee856
Compare
9 of 11 tasks
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.
No description provided.