Git Product home page Git Product logo

Comments (5)

tony-iqlusion avatar tony-iqlusion commented on May 27, 2024

Confirm that I was able to reproduce this problem.

Here's a more nicely formatted version of the protoc errors:

protoc failed: /Users/bascule/src/cosmos-rust/proto-build/../proto: warning: directory does not exist.
ibc/core/client/v1/tx.proto:8:1: warning: Import ibc/core/client/v1/client.proto is unused.
cosmos/tx/v1beta1/service.proto:7:1: warning: Import gogoproto/gogo.proto is unused.
cosmos/base/tendermint/v1beta1/query.proto:87:3: "tendermint.types.BlockID" is resolved to "cosmos.base.tendermint.types.BlockID", which is not defined. The innermost scope is searched first in name resolution. Consider using a leading '.'(i.e., ".tendermint.types.BlockID") to start from the outermost scope.
cosmos/base/tendermint/v1beta1/query.proto:88:3: "tendermint.types.Block" is resolved to "cosmos.base.tendermint.types.Block", which is not defined. The innermost scope is searched first in name resolution. Consider using a leading '.'(i.e., ".tendermint.types.Block") to start from the outermost scope.
cosmos/base/tendermint/v1beta1/query.proto:96:3: "tendermint.types.BlockID" is resolved to "cosmos.base.tendermint.types.BlockID", which is not defined. The innermost scope is searched first in name resolution. Consider using a leading '.'(i.e., ".tendermint.types.BlockID") to start from the outermost scope.
cosmos/base/tendermint/v1beta1/query.proto:97:3: "tendermint.types.Block" is resolved to "cosmos.base.tendermint.types.Block", which is not defined. The innermost scope is searched first in name resolution. Consider using a leading '.'(i.e., ".tendermint.types.Block") to start from the outermost scope.
cosmos/base/tendermint/v1beta1/query.proto:113:3: "tendermint.p2p.DefaultNodeInfo" is resolved to "cosmos.base.tendermint.p2p.DefaultNodeInfo", which is not defined. The innermost scope is searched first in name resolution. Consider using a leading '.'(i.e., ".tendermint.p2p.DefaultNodeInfo") to start from the outermost scope.
cosmos/base/tendermint/v1beta1/query.proto:4:1: warning: Import gogoproto/gogo.proto is unused.
cosmos/base/tendermint/v1beta1/query.proto:6:1: warning: Import google/api/annotations.proto is unused.
cosmos/base/tendermint/v1beta1/query.proto:8:1: warning: Import tendermint/types/block.proto is unused.
cosmos/base/tendermint/v1beta1/query.proto:9:1: warning: Import tendermint/types/types.proto is unused.
cosmos/base/tendermint/v1beta1/query.proto:7:1: warning: Import tendermint/p2p/types.proto is unused.

Between the warnings that "Import tendermint/..." are unused and the scope errors regarding the tendermint types, it would appear something has changed with either the type names or the scopes.

from cosmos-rust.

jkilpatr avatar jkilpatr commented on May 27, 2024

So the problem here is that in order to pass through some ABCI stuff for RC5 tindermint proto types where pulled into Cosmos-sdk proto definitions, the proto compiler is looking for one of these files

https://github.com/tendermint/tendermint/tree/master/proto/tendermint

and cant' find it, our compiler needs to be updated to keep them in scope (note that this may remove our dependency on tendermint-proto the crate, since we need to compile those protos ourselves anyways.

from cosmos-rust.

tony-iqlusion avatar tony-iqlusion commented on May 27, 2024

I think this is actually an issue with the upstream proto definitions coming from cosmos/cosmos-sdk. You can (inadvertently) see the same error in this (otherwise unrelated) issue:

cosmos/cosmos-sdk#8171

Adding a submodule for tendermint/tendermint doesn't help: as you can see in the protoc output from above, these definitions are already available, and unused:

cosmos/base/tendermint/v1beta1/query.proto:8:1: warning: Import tendermint/types/block.proto is unused.
cosmos/base/tendermint/v1beta1/query.proto:9:1: warning: Import tendermint/types/types.proto is unused.

The real problem appears to be an upstream scoping issue. You can see the error here:

"tendermint.types.BlockID" is resolved to "cosmos.base.tendermint.types.BlockID", which is not defined. The innermost scope is searched first in name resolution. Consider using a leading '.'(i.e., ".tendermint.types.BlockID") to start from the outermost scope.

There are two proto packages named tendermint, the toplevel .tendermint package and cosmos.base.tendermint. The protos where this error is occurring is inside of the cosmos.base.tendermint.v1beta1 package, and so "tendermint" is resolving to cosmos.base.tendermint instead of .tendermint.

Not sure why this isn't breaking the upstream build as per the linked issue this does still seem to be causing (potentially ignored) upstream errors. That said...

Adding a leading . to the type names as suggested by protoc corrects the issue, but requires an upstream change. I can attempt a PR.

from cosmos-rust.

tony-iqlusion avatar tony-iqlusion commented on May 27, 2024

Opened a PR to fix the scoping here: cosmos/cosmos-sdk#8236

from cosmos-rust.

tony-iqlusion avatar tony-iqlusion commented on May 27, 2024

cosmos/cosmos-sdk#8236 has been merged! 🎉

I can also confirm that if I bump COSMOS_REV to the latest commit locally, everything is working again:

[info] Updating cosmos/cosmos-sdk submodule...
HEAD is now at cfeb5eb4d Fix tendermint query proto scoping (#8236)
[info] Compiling .proto files to Rust into '/tmp/tmp-protobuf/'...
[info ] Compiling proto clients for GRPC services!
[info ] => Done!
[info ] Copying generated files into '../cosmos-sdk-proto/src/prost/'...

Will go ahead and close this issue out as it appears we're free to bump COSMOS_REV as soon as e.g. v0.40.0-rc6 gets tagged.

from cosmos-rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.