Skip to content

fix(dotnet-perf): fix dialer bug affecting benchmark runs#23

Merged
dhuseby merged 2 commits intolibp2p:masterfrom
K-21:fix/dotnet-transport-interop
Feb 22, 2026
Merged

fix(dotnet-perf): fix dialer bug affecting benchmark runs#23
dhuseby merged 2 commits intolibp2p:masterfrom
K-21:fix/dotnet-transport-interop

Conversation

@K-21
Copy link
Contributor

@K-21 K-21 commented Feb 22, 2026

Fix #829

Originally in Test Plans as #831

It extends the changes introduced #829

The original PR resolved a critical issue in the .NET performance benchmarking suite: although the listener multiaddr was correctly stored and fetched from Redis, it was never passed properly into the dialer logic, resulting in dialing attempts without any target address and causing benchmark failures (null/empty multiaddr exceptions).

In addition to preserving that fix, this extended description explains the scope of changes and why they matter:

Background & Root Cause

In the .NET performance benchmarks, the benchmarking flow includes:

  • Storing the listener multiaddr (network address of the service) in a shared store (Redis).
  • Retrieving that multiaddr when initiating a dialer (client) process.
  • Dialing the listener from the benchmark runner to measure performance.

However, while the multiaddr was being stored and fetched correctly, it was not passed into the dialer initialization — leading to a failure at runtime where the dialing attempt had no valid multiaddr to connect to. Because the benchmark logic depended on this connection attempt succeeding, the entire benchmark run would throw exceptions and fail prematurely.

Enhacements

  1. Correct multiaddr handling
  • Properly validate the multiaddr retrieved from Redis before attempting a connection.
  • Ensure that the valid multiaddr is correctly passed into the dialer initialization logic.
  • Guarantees that no dial call occurs when the multiaddr is null or empty (protects against runtime exceptions).
  1. Improved Dialer Initialization
  • Updated initialization logic in Program.cs to include explicit checks and assignments.
  • Ensures that the dialer receives the correct multiaddr up front, preventing misconfiguration and making the behavior deterministic.
  1. Additional Safeguards and Resiliency
  • Added defensive checks to fail early if the multiaddr format is invalid (e.g., not a valid libp2p multiaddr).
  • Enhanced error output to make benchmark logs more useful when diagnosing failures (e.g., clear reasons for failed initialization).Updated initialization logic in Program.cs to include explicit checks and assignments.

K-21 and others added 2 commits February 22, 2026 20:08
Co-authored-by: Manu Sheel Gupta <manusheel.edu@gmail.com>
@K-21 K-21 requested a review from dhuseby as a code owner February 22, 2026 16:31
@K-21
Copy link
Contributor Author

K-21 commented Feb 22, 2026

@flcl42 @seetadev @dhuseby
This builds onhttps://github.com/libp2p/test-plans/pull/829 and addresses the dialer multiaddr issue — please review.

Copy link
Contributor

@dhuseby dhuseby left a comment

Choose a reason for hiding this comment

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

LGTM. I ran the perf test local with ./run.sh --impl-ignore !dotnet --force-image-rebuild --yes and it worked flawlessly. Thank you!

@dhuseby dhuseby merged commit de9eada into libp2p:master Feb 22, 2026
4 checks passed
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.

2 participants