Skip to content

apollo_protobuf: add prost codec for length-delimited messages#11063

Merged
sirandreww-starkware merged 1 commit intomain-v0.14.1-committerfrom
12-24-apollo_propeller_add_prost_codec_for_length-delimited_messages
Jan 27, 2026
Merged

apollo_protobuf: add prost codec for length-delimited messages#11063
sirandreww-starkware merged 1 commit intomain-v0.14.1-committerfrom
12-24-apollo_propeller_add_prost_codec_for_length-delimited_messages

Conversation

@sirandreww-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

sirandreww-starkware commented Dec 24, 2025

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

Copy link
Contributor Author

@sirandreww-starkware sirandreww-starkware left a comment

Choose a reason for hiding this comment

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

@sirandreww-starkware made 4 comments.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @noamsp-starkware and @ShahakShama).


crates/apollo_protobuf/src/codec_test.rs line 77 at r4 (raw file):

Previously, ShahakShama wrote…

No. I meant that i is equal to the last byte of a message

I really don't understand. Are you on the latest version of the PR? Can you give a psudo-code example?


crates/apollo_protobuf/src/codec_test.rs line 138 at r4 (raw file):

Previously, ShahakShama wrote…

Where is it?

I don't understand this? Is this a case that is not covered by the byte by byte implementation?


crates/apollo_protobuf/src/codec_test.rs line 38 at r5 (raw file):

Previously, ShahakShama wrote…

20ms is too much (think that if we have 10000 of tests which there's a chance we have, it will take 200 seconds to run the tests if the bar for all of them is 20ms)

  1. Reduce test_multiple_messages_byte_by_byte constant from 15 to let's say 10
  2. Remove the 10k case from test_encode_decode_multiple_messages_all_at_once::case_6
  3. Remove the 100k case from test_encode_decode_various_sizes

Done.


crates/apollo_protobuf/src/codec_test.rs line 56 at r6 (raw file):

Previously, ShahakShama wrote…

Don't have the same message all over the test. Also, consider a changing message len. For example, message len = i % 100

This change will probably require you to have a smaller num_messages, which is ok. I prefer an interesting test over a big test

Done.

Copy link
Collaborator

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

@ShahakShama reviewed 3 files and all commit messages, made 2 comments, and resolved 3 discussions.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @noamsp-starkware and @sirandreww-starkware).


crates/apollo_protobuf/src/codec_test.rs line 77 at r4 (raw file):

Previously, sirandreww-starkware (Andrew Luka) wrote…

I really don't understand. Are you on the latest version of the PR? Can you give a psudo-code example?

Here's an ugly version of what I want. Please prettify it and add it

let mut expected_next_message_index_in_full_buf = sent_messages.first().unwrap().len();
for i in 0..total_len {
    ...
    if partial_buf.is_empty() {
        assert_eq!(i, expected_next_message_index_in_full_buf);
        expected_next_message_index_in_full_buf += sent_messages[received_messages + 1].len();
        ...

crates/apollo_protobuf/src/codec_test.rs line 138 at r4 (raw file):

Previously, sirandreww-starkware (Andrew Luka) wrote…

I don't understand this? Is this a case that is not covered by the byte by byte implementation?

Oh right

@sirandreww-starkware sirandreww-starkware force-pushed the 12-24-apollo_propeller_add_prost_codec_for_length-delimited_messages branch from fc2a8bb to 1c7eae9 Compare January 27, 2026 09:21
Copy link
Contributor Author

@sirandreww-starkware sirandreww-starkware left a comment

Choose a reason for hiding this comment

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

@sirandreww-starkware made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @noamsp-starkware and @ShahakShama).


crates/apollo_protobuf/src/codec_test.rs line 77 at r4 (raw file):

Previously, ShahakShama wrote…

Here's an ugly version of what I want. Please prettify it and add it

let mut expected_next_message_index_in_full_buf = sent_messages.first().unwrap().len();
for i in 0..total_len {
    ...
    if partial_buf.is_empty() {
        assert_eq!(i, expected_next_message_index_in_full_buf);
        expected_next_message_index_in_full_buf += sent_messages[received_messages + 1].len();
        ...

Done.

Copy link
Collaborator

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

:lgtm:

@ShahakShama reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noamsp-starkware).

@sirandreww-starkware sirandreww-starkware force-pushed the 12-24-apollo_propeller_add_prost_codec_for_length-delimited_messages branch from 1c7eae9 to b835990 Compare January 27, 2026 11:30
Copy link
Contributor Author

@sirandreww-starkware sirandreww-starkware left a comment

Choose a reason for hiding this comment

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

@sirandreww-starkware partially reviewed 9 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noamsp-starkware).

@sirandreww-starkware sirandreww-starkware added this pull request to the merge queue Jan 27, 2026
Merged via the queue into main-v0.14.1-committer with commit 5d14798 Jan 27, 2026
19 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments