Skip to content

fix(envoy-protocol): advertise current protocol version#4800

Closed
NathanFlurry wants to merge 1 commit intographite-base/4800from
engine-stabilize/envoy-protocol-version
Closed

fix(envoy-protocol): advertise current protocol version#4800
NathanFlurry wants to merge 1 commit intographite-base/4800from
engine-stabilize/envoy-protocol-version

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

NathanFlurry commented Apr 27, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link
Copy Markdown

claude Bot commented Apr 27, 2026

PR Review: fix(envoy-protocol): advertise current protocol version

Scope: Single file — engine/sdks/rust/envoy-protocol/src/versioned.rs, 12 additions / 12 deletions. All six OwnedVersionedData impls (ToEnvoy, ToRivet, ToGateway, ToOutbound, ToEnvoyConn, ActorCommandKeyData) change their deserialize_converters() and serialize_converters() from vec![Ok] to vec![Ok, Ok].


The fix is correct

vbare::OwnedVersionedData uses converters.len() + 1 to determine the advertised protocol version. vec![Ok] (length 1) advertised version 2; vec![Ok, Ok] (length 2) correctly advertises version 3, matching PROTOCOL_VERSION: u16 = 3 in lib.rs. The actual per-version migration logic already lives in deserialize_version() / serialize_version(), so identity (Ok) converters are appropriate here. All six types are updated consistently.


Issues and Suggestions

1. Missing invariant test

No test asserts that the converter-length-derived "current version" matches PROTOCOL_VERSION. A regression to vec![Ok] or vec![Ok, Ok, Ok] would silently pass all existing tests. Consider adding a test that locks this for all future bumps:

#[test]
fn all_message_types_advertise_current_protocol_version() {
    assert_eq!(ToEnvoy::current_version(), PROTOCOL_VERSION);
    assert_eq!(ToRivet::current_version(), PROTOCOL_VERSION);
    assert_eq!(ToGateway::current_version(), PROTOCOL_VERSION);
    assert_eq!(ToOutbound::current_version(), PROTOCOL_VERSION);
    assert_eq!(ToEnvoyConn::current_version(), PROTOCOL_VERSION);
    assert_eq!(ActorCommandKeyData::current_version(), PROTOCOL_VERSION);
}

(Verify the exact vbare method name at https://docs.rs/vbare.)

2. Existing tests are inline (pre-existing violation)

Root CLAUDE.md states: "Rust tests live under tests/, not inline #[cfg(test)] mod tests in src/." The three existing tests in versioned.rs are inline. This PR doesn't introduce the violation, but any new test added here should move all tests to engine/sdks/rust/envoy-protocol/tests/versioned.rs rather than compounding it.

3. PR description is boilerplate

The description is the unmodified PR template. A brief note on the observable breakage (e.g., envoy and pegboard negotiating v2 instead of v3, causing command KV keys to use the wrong schema) would help reviewers assess impact and help future readers understand the operational context of the change.


No concerns on

  • Style and formatting are consistent with surrounding code and the vbare usage patterns elsewhere in the repo (e.g., epoxy-protocol/src/versioned.rs, data/src/versioned/namespace_runner_config.rs).
  • No new public API surface, no security impact.
  • Change is minimal and scoped precisely to the affected impls.
  • CLAUDE.md rule to never modify an existing published *.bare runner protocol version is respected — this only updates the converter registration, not the schema itself.

@NathanFlurry NathanFlurry force-pushed the break-up/serialize-gateway-actor-keys branch from 23e83b5 to deba7fa Compare April 27, 2026 17:35
@NathanFlurry NathanFlurry force-pushed the engine-stabilize/envoy-protocol-version branch from c546b5e to a1f99bc Compare April 27, 2026 17:35
@NathanFlurry NathanFlurry changed the base branch from break-up/serialize-gateway-actor-keys to graphite-base/4800 April 27, 2026 19:06
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