Skip to content

Conversation

@0pcom
Copy link
Collaborator

@0pcom 0pcom commented Oct 26, 2025

  • implement versioning with runtime/debug as is done for skywire
  • improve network test utility
  • make dmsg curl able to fetch from dmsg direct clients using dmsghttp or regular dmsg client

0pcom added 8 commits August 23, 2025 18:05
Add retry logic with exponential backoff when validating discovery server reachability via DMSG. This fixes the issue where some dmsg servers would fail with EOF errors immediately after session initialization.

The race condition occurred because the Ready() signal indicated the dmsg session was established, but the session was still initializing (accepting streams). HTTP requests made immediately after Ready() would fail with EOF.

Changes:
- Add 5 retry attempts with 200ms, 400ms, 600ms, 800ms backoff delays (total 2s)
- Log retry attempts at debug level for troubleshooting
- Import time package for sleep functionality

This allows all dmsg servers sufficient time to complete session initialization before declaring the connection invalid.
Enable regular dmsg clients to dial the discovery server even though it doesn't register itself in discovery. The discovery server uses a direct client and isn't listed in its own database.

Solution for dmsghttp mode: Implement a caching discovery client wrapper that intercepts Entry() requests for the discovery server's public key and returns a synthetic entry with all known dmsg servers as delegated servers.

Solution for -Z (HTTP) mode: Use a direct client with pre-populated entries for all dmsg servers, the discovery server, and the local client. This avoids the chicken-and-egg problem of needing dmsg transport to query discovery before having a dmsg client.

Changes:
- Add StartDmsgWithSyntheticDiscovery() for dmsghttp mode
- Add StartDmsgWithDirectClient() for -Z HTTP mode
- Implement cachingDiscClient wrapper for dmsghttp mode
- Direct client includes synthetic entries for discovery server and local client

This allows commands like 'dmsg curl -Z dmsg://discovery-pk:80/health' to work.
@0pcom 0pcom merged commit 5286345 into skycoin:develop Oct 27, 2025
5 of 6 checks passed
@0pcom 0pcom deleted the improvements branch October 27, 2025 00:08
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.

1 participant