Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The subversion of protobuf3 is important for envoy proxy? #29546

Closed
PoisWu opened this issue Sep 11, 2023 · 5 comments
Closed

The subversion of protobuf3 is important for envoy proxy? #29546

PoisWu opened this issue Sep 11, 2023 · 5 comments
Labels
area/wasm question Questions that are neither investigations, bugs, nor enhancements

Comments

@PoisWu
Copy link

PoisWu commented Sep 11, 2023

Title: *The subversion of protobuf3 is important for envoy proxy? *

Description:

I realize that the release of protobuf is quite often, roughly once per 2 weeks. I would like to know which version of proto3 is used by envoy? I'm asking the question because I found that in the project, proxy-wasm-cpp-sdk, the implementation is based on proto3 v.3.9.1 whereas the newest proto3 version is v.24.3 and I would like to know that a program is build on top of proto3 v3.9.1 can talk to envoy properly or not. I guess the proto3 version is important because some files have been removed/renamed such as google/protobuf/generated_message_table_driven.h which is in proto3 v3.9.1 whereas it can not be found in v.24.3.

[optional Relevant Links:]

ref of proto3 v.3.9.1 in the description https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/blob/master/sdk_container.sh#L40
More detail documentation of proxy-wasm-cpp-sdk which is not yet merged to the main branch can be found here:

@PoisWu PoisWu added the triage Issue requires triage label Sep 11, 2023
@adisuissa
Copy link
Contributor

I think you are asking which version of protobuf is used.
Envoy currently uses protobuf 23.4 (see here for the bazel repo, and the version at the top of the file).
We attempt to keep the dependencies up to date, though some upgrades are more challenging than others.

RE the proxy-wasm-cpp-sdk repo, IIUC the code itself uses protobuf v3.17.3. It seems that this version is somewhat old (2021), and could probably be updated.

@mpwarres may know more about the versions of proxy-wasm-cpp-sdk

@adisuissa adisuissa added question Questions that are neither investigations, bugs, nor enhancements area/wasm and removed triage Issue requires triage labels Sep 11, 2023
@PoisWu
Copy link
Author

PoisWu commented Sep 11, 2023

Thank you for your reply. It was really clear.
My last question is that, for example:
A program A use protobuf3 v:3.x.y try to communicate with envoy:v1.27 using protobuf3 v23.1, is there any possibility that an error occurs?

@adisuissa
Copy link
Contributor

Thank you for your reply. It was really clear. My last question is that, for example: A program A use protobuf3 v:3.x.y try to communicate with envoy:v1.27 using protobuf3 v23.1, is there any possibility that an error occurs?

Sorry, I may be misunderstanding your qeustion.
proto3 defines the schema syntax. Protobuf implements the tooling to parse these schemas.
2 binaries can use different versions of protobuf, but the schema (proto definitions) will stay the same, and both should be able to understand them independently. Moreover, they will be able to pass the instances (protos) between the binaries and process them (convert them to an object in the appropriate programming language).

@mpwarres
Copy link
Contributor

Thanks, filed proxy-wasm/proxy-wasm-cpp-sdk#159 to address. Even though v3.9.1 is quite old, as @adisuissa mentioned it is wire compatible with other versions. Internal implementation differences with the version used by Envoy, such as google/protobuf/generated_message_table_driven.h, shouldn't pose an issue since proxy-wasm-cpp-sdk and emscripten will compile them to Wasm.

The one case I'm less sure about is if you are using proxy-wasm-cpp-host NullVm as your runtime, in which case I think your plugin code (compiled to a native library, not Wasm) might need to link with the same protobuf library as the rest of Envoy.

@PoisWu
Copy link
Author

PoisWu commented Sep 11, 2023

I see! Thank you for your responses. It’s much appreciated. I understand better now the subtle difference between proto3 and protobuf.

The one case I'm less sure about is if you are using proxy-wasm-cpp-host NullVm as your runtime, in which case I think your plugin code (compiled to a native library, not Wasm) might need to link with the same protobuf library as the rest of Envoy.

You may be right. Since it's my first time using proxy-wasm-cpp-sdk, I'm learning therefore how to read the error message and thank you for the hint.

@PoisWu PoisWu closed this as completed Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/wasm question Questions that are neither investigations, bugs, nor enhancements
Projects
None yet
Development

No branches or pull requests

3 participants