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

Python #119

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Python #119

wants to merge 2 commits into from

Conversation

thecardcheat
Copy link

Commit message has details of protobuf changes. I am unsure of the consequence for existing clients but the name change to avoid the namespace conflict seems breaking.

Without package defined in all .proto files, output generation fails, e.g.

  joshua@cryptodevs[proto] protoc -I src --cpp_out=cpp src/*.proto
  blockchain_block_v1.proto:20:12: "blockchain_txn" is not defined.
  blockchain_block.proto: Import "blockchain_block_v1.proto" was not
  found or had errors.
  blockchain_block.proto:6:17: "blockchain_block_v1" is not defined.

- With package defined, resolve conflict between enum and package namespace

  radio.proto:3:9: "helium.radio" is already defined
  (as something other than a package) in file
  "blockchain_txn_poc_receipts_v1.proto".

- In src/service/gateway.proto, resolve warning on unused import
@@ -2,8 +2,8 @@ syntax = "proto3";
package helium;

enum origin {
p2p = 0;
radio = 1;
Copy link
Member

Choose a reason for hiding this comment

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

Please don’t rename fields

Copy link
Author

Choose a reason for hiding this comment

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

This was done due to the following error:

radio.proto:3:9: "helium.radio" is already defined (as something other than a package) in file "blockchain_txn_poc_receipts_v1.proto".

This appears to be an issue with protobuf namespacing, I'm not sure why things that aren't protoc didn't care and I made this change based on a recommendation in an SO answer from one of protobuf's original authors about how to handle these conflicts. If there is an alternate method that wouldn't break the naming that'd be preferable, but I am unaware of what that would be.

Copy link
Member

@madninja madninja Feb 18, 2022

Choose a reason for hiding this comment

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

The problem is that it'll break existing erlang and rust users of this message. Perhaps we're missing a protoc option here since Prost (rust) uses protoc under the hood and does not appear to have this issue

Copy link
Author

Choose a reason for hiding this comment

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

Will try to dig into those a little bit more to compare, thanks for the tip.

@madninja
Copy link
Member

@thecardcheat Are you still interested in this PR? if so we need to get that comment addressed. If not, can this PER get closed?

@ccall48
Copy link

ccall48 commented Jul 1, 2023

I would be very interested in a working python version, as compiling the project threw the same errors on me on trying to run it (also a given i am very green with grpc atm). However with Openlns now a thing it will let me integrate backend changes to route ids directly through python instead of another language i do not know.

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.

3 participants