Skip to content

fix(envoy-client): add tls#4595

Open
MasterPtato wants to merge 1 commit into04-08-chore_fix_driver_test_suitefrom
04-08-fix_envoy-client_add_tls
Open

fix(envoy-client): add tls#4595
MasterPtato wants to merge 1 commit into04-08-chore_fix_driver_test_suitefrom
04-08-fix_envoy-client_add_tls

Conversation

@MasterPtato
Copy link
Copy Markdown
Contributor

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@MasterPtato MasterPtato mentioned this pull request Apr 9, 2026
11 tasks
@MasterPtato MasterPtato force-pushed the 04-08-fix_envoy-client_add_tls branch from fd0d710 to 2090c10 Compare April 9, 2026 04:13
@claude
Copy link
Copy Markdown

claude bot commented Apr 9, 2026

PR Review: fix(envoy-client): add tls

The PRs main goal is clear and necessary — adding TLS to the envoy-client WebSocket connection. It also bundles two related bug fixes for the ProtocolVersionKey key layout and namespace subspace. Overall the changes look correct but I have a few concerns worth addressing.


TLS / crypto provider initialization

engine/sdks/rust/envoy-client/src/connection.rs

install_default() is a process-global, one-time operation. Calling it inside single_connection() means it runs on every reconnect in the retry loop. While it is safe (idempotent, error silently ignored), it creates and discards a CryptoProvider on every call after the first.

This should be initialized once before the retry loop — either in start_connection() or at the top of connection_loop(), or guarded by a std::sync::OnceLock.


Breaking key layout change in ProtocolVersionKey

engine/packages/pegboard/src/keys/runner_config.rs

The reordering moves PROTOCOL_VERSION from position 4 to the end of the tuple:

  • Old: (RUNNER, CONFIG, DATA, PROTOCOL_VERSION, namespace_id, name)
  • New: (RUNNER, CONFIG, DATA, namespace_id, name, PROTOCOL_VERSION)

The new layout is semantically correct — it matches the pattern of other keys in this file (DataKey, ByVariantKey) where namespace_id and name come before any trailing field identifier, enabling prefix/range scans by (namespace_id, name).

However, this is a breaking schema change — entries stored under the old key will be orphaned. The conn.rs fix (adding the namespace subspace) similarly changes where new entries are written vs. where old entries exist. If serverful pools are not yet in production this is fine as-is, but a note in the PR description clarifying intent would help.


Cosmetic change in resolve_actor_query.rs

The change collapses a chained method call to one line — purely cosmetic and unrelated to the PRs purpose. Harmless, but worth keeping separate in the future for focused diffs.


rivet-util-serde workspace declaration removed

The [workspace.dependencies.rivet-util-serde] section is removed from Cargo.toml, but engine/sdks/rust/envoy-client/Cargo.toml still has rivet-util-serde.workspace = true. The Cargo.lock still shows it as a resolved dependency so it compiles, but please confirm this removal was intentional and not accidental.


Summary

Area Status
TLS feature (tokio-tungstenite + native certs) Correct
Crypto provider init placement Move out of reconnect loop
Key layout reordering (runner_config.rs) Correct fix, schema-breaking — note intent
Namespace subspace in conn.rs write Correct fix, same caveat
rivet-util-serde workspace removal Verify intentional
Cosmetic cleanup in resolve_actor_query.rs Fine

@NathanFlurry NathanFlurry mentioned this pull request Apr 9, 2026
11 tasks
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