Skip to content
This repository has been archived by the owner on Dec 26, 2024. It is now read-only.

feat(network): protobuf update #1232

Closed
wants to merge 3 commits into from
Closed

feat(network): protobuf update #1232

wants to merge 3 commits into from

Conversation

nagmo-starkware
Copy link
Contributor

@nagmo-starkware nagmo-starkware commented Oct 2, 2023

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

Other information


This change is Reviewable

@nagmo-starkware nagmo-starkware force-pushed the protobuf-update4 branch 2 times, most recently from fe9502b to 188f994 Compare October 2, 2023 08:11
Copy link
Contributor

@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.

Reviewed 5 of 6 files at r1, 12 of 12 files at r2, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @nagmo-starkware)


crates/papyrus_network/build.rs line 8 at r2 (raw file):

    let dir = env::current_dir().unwrap();
    println!("{dir:?}");
    env::set_var("PROTOC", "./protoc");

Why? What's the problem with using the protoc that PROTOC defined?


crates/papyrus_network/src/streamed_data_protocol/behaviour_test.rs line 104 at r2 (raw file):

    // TODO(shahak): Change to BlockHeadersRequest::default() when the bug that forbids sending
    // default messages is fixed.
    let query = BlockHeadersRequest { ..Default::default() };

This is equivalent to BlockHeadersRequest::default()
Because we don't send messages here, you can simply use default and erase this TODO


crates/papyrus_network/src/streamed_data_protocol/handler_test.rs line 196 at r2 (raw file):

    let (inbound_stream, mut outbound_stream, _) = get_connected_streams().await;
    // TODO(shahak): Change to BlockHeadersRequest::default() when the bug that forbids sending

This is equivalent to BlockHeadersRequest::default()
Because we don't read/write the query here, you can simply use default and erase this TODO

Same for the rest of the file


crates/papyrus_network/src/streamed_data_protocol/handler_test.rs line 317 at r2 (raw file):

    for data in hardcoded_data_vec.clone() {
        validate_received_data_event(&mut handler, &data, outbound_session_id).await;

Why?


docs/CONTRIBUTING.md line 52 at r2 (raw file):

- [Protoc](https://github.com/protocolbuffers/protobuf/releases/tag/v24.3)
  - You'll need Protoc only for compiling the [papyrus_network](../crates/papyrus_network/) crate.
  - required version is: 24.3. 

Remove the space after the dot


docs/CONTRIBUTING.md line 53 at r2 (raw file):

  - You'll need Protoc only for compiling the [papyrus_network](../crates/papyrus_network/) crate.
  - required version is: 24.3. 
  - the `protoc` execution file should be placed in the `papyrus_network` folder (git is set to automatically ignore it).

If you'll accept what I wrote previously, remove this

Copy link
Contributor Author

@nagmo-starkware nagmo-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 13 of 16 files reviewed, 6 unresolved discussions (waiting on @ShahakShama)


crates/papyrus_network/build.rs line 8 at r2 (raw file):

Previously, ShahakShama wrote…

Why? What's the problem with using the protoc that PROTOC defined?

we need to use the latest version the support Ittay's syntax. the only way it worked for me is to download the binaries from the github release and then we need to give it a path to the protoc executable.
this seems easier to me then providing the path addhoc on every cargo build call


crates/papyrus_network/src/streamed_data_protocol/behaviour_test.rs line 104 at r2 (raw file):

Previously, ShahakShama wrote…

This is equivalent to BlockHeadersRequest::default()
Because we don't send messages here, you can simply use default and erase this TODO

right that was relevant for a previous iteration


crates/papyrus_network/src/streamed_data_protocol/handler_test.rs line 196 at r2 (raw file):

Previously, ShahakShama wrote…

This is equivalent to BlockHeadersRequest::default()
Because we don't read/write the query here, you can simply use default and erase this TODO

Same for the rest of the file

Done.


crates/papyrus_network/src/streamed_data_protocol/handler_test.rs line 317 at r2 (raw file):

Previously, ShahakShama wrote…

Why?

fixed


docs/CONTRIBUTING.md line 52 at r2 (raw file):

Previously, ShahakShama wrote…

Remove the space after the dot

Done.


docs/CONTRIBUTING.md line 53 at r2 (raw file):

Previously, ShahakShama wrote…

If you'll accept what I wrote previously, remove this

see my response

Copy link
Contributor

@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.

Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @nagmo-starkware)


crates/papyrus_network/build.rs line 8 at r2 (raw file):

Previously, nagmo-starkware wrote…

we need to use the latest version the support Ittay's syntax. the only way it worked for me is to download the binaries from the github release and then we need to give it a path to the protoc executable.
this seems easier to me then providing the path addhoc on every cargo build call

Then guide the users that if they have multiple installations of protoc from different versions then they'll need to set the env var PROTOC to the correct one. Let users that have only the latest version (like me) to just use it


crates/papyrus_network/src/streamed_data_protocol/handler_test.rs line 196 at r2 (raw file):

Previously, nagmo-starkware wrote…

Done.

You didn't fix for the rest of the file

Copy link

github-actions bot commented Nov 5, 2023

There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale.
This PR will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions bot added the stale No activity for quite some time. label Nov 5, 2023
@github-actions github-actions bot closed this Nov 13, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale No activity for quite some time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants