Skip to content

Price nil guard - #6227

Merged
mdomasevicius merged 3 commits into
masterfrom
fix/pricer-nil-guard
Oct 26, 2026
Merged

mdomasevicius merged 3 commits into
masterfrom
fix/pricer-nil-guard

Conversation

@mdomasevicius

Copy link
Copy Markdown
Collaborator

No description provided.

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.
@codecov-commenter

codecov-commenter commented Oct 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.91304% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.52%. Comparing base (4aa7406) to head (13ee856).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
session/pingpong/pricing.go 57.14% 3 Missing and 3 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Mantas Domasevicius <mantas@mysterium.network>
@mdomasevicius
mdomasevicius merged commit dbed0d8 into master Oct 26, 2026
19 checks passed
@mdomasevicius
mdomasevicius deleted the fix/pricer-nil-guard branch October 26, 2026 07:18
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.

4 participants