Skip to content

NYM-1408: Use SkewManager with registration clients. - #6973

Merged
simonwicky merged 6 commits into
developfrom
feature/nym-1408-registration-client-skew-manager
Jul 24, 2026
Merged

NYM-1408: Use SkewManager with registration clients.#6973
simonwicky merged 6 commits into
developfrom
feature/nym-1408-registration-client-skew-manager

Conversation

@trojanfoe

@trojanfoe trojanfoe commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

NYM-1408: Use SkewManager with registration clients.

nym-vpn-client PR: nymtech/nym-vpn-client#5912


This change is Reviewable

Summary by CodeRabbit

  • New Features
    • Added optional spend-time skew configuration for bandwidth credential acquisition.
    • WireGuard and dVPN registration flows (including nested sessions and retry paths) now accept an optional time-skew input to compute credential spend timing.
    • If no skew is provided, the system falls back to the current system time.
  • Tests
    • Updated integration and probe registration calls to include the new optional skew parameter.

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nym-explorer-v2 Ready Ready Preview, Comment Jul 24, 2026 8:42am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs-nextra Ignored Ignored Preview Jul 24, 2026 8:42am
nym-node-status Ignored Ignored Preview Jul 24, 2026 8:42am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for making this first PR

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Registration configuration now accepts an optional bandwidth spend-time skew. The skew is propagated through mixnet, LP, nested-session, and authenticator registration paths, with the current UTC time remaining the fallback when no skew is supplied.

Changes

Bandwidth spend-time injection

Layer / File(s) Summary
Timestamp configuration and client wiring
nym-registration-client/src/builder/..., nym-registration-client/src/clients/...
BuilderConfig stores an optional spend-time skew and passes it through LP and mixnet registration clients.
WireGuard claim timestamp flow
nym-authenticator-client/src/lib.rs, nym-registration-client/src/clients/mixnet.rs
WireGuard registration forwards the skew to bandwidth-ticket acquisition, which subtracts it from the current UTC time.
LP registration timestamp flow
nym-registration-client/src/lp_client/..., integration-tests/src/lp_registration.rs, nym-gateway-probe/src/common/probe_tests.rs
LP registration and retry paths forward the skew into credential acquisition, while updated call sites pass None when no skew is configured.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RegistrationBuilder
  participant RegistrationClient
  participant AuthenticatorOrGateway
  participant BandwidthTicketProvider
  RegistrationBuilder->>RegistrationClient: construct with spend_time_skew
  RegistrationClient->>AuthenticatorOrGateway: register with spend_time_skew
  AuthenticatorOrGateway->>BandwidthTicketProvider: request ticket at current UTC time minus skew
  BandwidthTicketProvider-->>AuthenticatorOrGateway: bandwidth ticket
Loading

Suggested reviewers: simonwicky, jstuczyn

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: registration clients now use SkewManager-derived time skew.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/nym-1408-registration-client-skew-manager

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
nym-registration-client/src/builder/config.rs (1)

42-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Complete the public spend-time skew contract documentation.

The implementation consistently subtracts the skew, but callers are not told the sign convention, and the new parameter is missing from several LP method argument lists.

  • nym-registration-client/src/builder/config.rs#L42-L50: document what positive and negative skew values mean.
  • nym-registration-client/src/lp_client/client.rs#L546-L547: document spend_time_skew for register_dvpn, finalise_dvpn_registration (Line 437), and handshake_and_register_with_retry (Line 656).
  • nym-registration-client/src/lp_client/nested_session/mod.rs#L346-L347: document it for register_dvpn, finalise_dvpn_registration (Line 230), handshake_and_register_dvpn (Line 459), and the retry variant (Line 517).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@nym-registration-client/src/builder/config.rs` around lines 42 - 50, Complete
the public spend-time skew documentation: in
nym-registration-client/src/builder/config.rs lines 42-50, state that positive
values subtract time and negative values add time; document spend_time_skew in
register_dvpn, finalise_dvpn_registration, and handshake_and_register_with_retry
in nym-registration-client/src/lp_client/client.rs lines 546-547; and document
it in register_dvpn, finalise_dvpn_registration, handshake_and_register_dvpn,
and the retry variant in
nym-registration-client/src/lp_client/nested_session/mod.rs lines 346-347.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@nym-registration-client/src/builder/config.rs`:
- Around line 42-50: Complete the public spend-time skew documentation: in
nym-registration-client/src/builder/config.rs lines 42-50, state that positive
values subtract time and negative values add time; document spend_time_skew in
register_dvpn, finalise_dvpn_registration, and handshake_and_register_with_retry
in nym-registration-client/src/lp_client/client.rs lines 546-547; and document
it in register_dvpn, finalise_dvpn_registration, handshake_and_register_dvpn,
and the retry variant in
nym-registration-client/src/lp_client/nested_session/mod.rs lines 346-347.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4e5e1406-024e-41c6-aa32-227fbd18abbb

📥 Commits

Reviewing files that changed from the base of the PR and between f2ae9a6 and 48b205c.

📒 Files selected for processing (7)
  • nym-authenticator-client/src/lib.rs
  • nym-registration-client/src/builder/config.rs
  • nym-registration-client/src/builder/mod.rs
  • nym-registration-client/src/clients/lp.rs
  • nym-registration-client/src/clients/mixnet.rs
  • nym-registration-client/src/lp_client/client.rs
  • nym-registration-client/src/lp_client/nested_session/mod.rs

…me skew

Clippy's too_many_arguments lint (deny-by-default via -D warnings in CI)
started failing after the spend_time_skew parameter pushed these methods to
8 arguments, matching the existing allow already present on the sibling
handshake_and_register_dvpn_with_retry.
integration-tests and nym-gateway-probe call the LP registration client's
register_dvpn directly and were missing the new spend_time_skew argument,
which broke the build on all platforms.
Comment thread nym-authenticator-client/src/lib.rs
Comment thread nym-registration-client/src/builder/config.rs Outdated
Comment thread nym-registration-client/src/clients/lp.rs Outdated
Comment thread nym-registration-client/src/lp_client/client.rs
…s doc

Per review: the skew is plain config data shared with entry/exit/mode, so
it belongs alongside them in RegistrationClientConfig rather than as a
separate field next to bandwidth_provider on each client struct. Also
trimmed the field doc to the essentials and folded in the sign convention
clarification that came up in review.
@simonwicky
simonwicky merged commit c8bab17 into develop Jul 24, 2026
10 checks passed
@simonwicky
simonwicky deleted the feature/nym-1408-registration-client-skew-manager branch July 24, 2026 09:03
trojanfoe added a commit that referenced this pull request Jul 24, 2026
* NYM-1408: Use `SkewManager` with registration clients.

* Simplify approach.

* Pass skew off to registration clients.

* fix: allow too_many_arguments on registration methods taking spend-time skew

Clippy's too_many_arguments lint (deny-by-default via -D warnings in CI)
started failing after the spend_time_skew parameter pushed these methods to
8 arguments, matching the existing allow already present on the sibling
handshake_and_register_dvpn_with_retry.

* fix: update remaining register_dvpn call sites for spend_time_skew param

integration-tests and nym-gateway-probe call the LP registration client's
register_dvpn directly and were missing the new spend_time_skew argument,
which broke the build on all platforms.

* refactor: move spend_time_skew into RegistrationClientConfig, trim its doc

Per review: the skew is plain config data shared with entry/exit/mode, so
it belongs alongside them in RegistrationClientConfig rather than as a
separate field next to bandwidth_provider on each client struct. Also
trimmed the field doc to the essentials and folded in the sign convention
clarification that came up in review.
trojanfoe added a commit to nymtech/nym-vpn-client that referenced this pull request Jul 24, 2026
The NYM-1408 SkewManager registration-client changes have landed on the
release branch (nymtech/nym@ab72e0362), so drop the temporary pin to the
feature branch used to unblock CI while nymtech/nym#6973 was in review.
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