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

Mess around with proto files in a probably doomed attempt to resolve relayer issues #2020

Merged
merged 2 commits into from
Feb 22, 2023

Conversation

hdevalence
Copy link
Member

When running the relayer, we get an error that

panic: proto: file "cosmos_proto/cosmos.proto" is already registered
	previously from: "github.com/cosmos/cosmos-proto"
	currently from:  "buf.build/gen/go/penumbra-zone/ibc-go-vendor/protocolbuffers/go/cosmos_proto"
See https://developers.google.com/protocol-buffers/docs/reference/go/faq#namespace-conflict

This is an entirely self-inflicted issue; there's no actual problem here, other than the totally unreasonable requirement that every .proto file across all source code in the dependency tree has a unique filename.

To paraphrase Werner Herzog,

It's like a curse weighing on an entire [ecosystem]. And whoever... goes too deep into this has his share of this curse. So we are cursed with what we are doing here. It's a [language] that God, if he exists has - has created in anger.

As we have chosen to use the Go relayer, we have our share of this curse. Let us examine it.

~/c/p/relayer (pprovider-new|✔) $ go mod why -m buf.build/gen/go/penumbra-zone/ibc-go-vendor/protocolbuffers/go
github.com/cosmos/relayer/v2/relayer/chains/penumbra
buf.build/gen/go/penumbra-zone/penumbra/protocolbuffers/go/penumbra/core/ibc/v1alpha1
buf.build/gen/go/penumbra-zone/ibc-go-vendor/protocolbuffers/go/ibc/core/client/v1

suggesting that the IBC package depends on ibc-go-vendor, even though the penumbra module's buf.yaml specifies

deps:
- buf.build/cosmos/ibc

This is weird. In an attempt to figure out what's going on, try removing the
ibc-go-vendor package entirely, to see what's happening.

In the future, we should move all of the Rust imports to use the proto files pulled from Buf, but this requires either (a) telling prost/tonic about where to find the proto files in the Buf module cache or (b) telling Buf how to drive prost and tonic. (a) seems easier but for now, we can just accept a
little bit of divergence.

When running the relayer, we see
```
~/c/p/relayer (pprovider-new|✔) $ go mod why -m buf.build/gen/go/penumbra-zone/ibc-go-vendor/protocolbuffers/go
github.com/cosmos/relayer/v2/relayer/chains/penumbra
buf.build/gen/go/penumbra-zone/penumbra/protocolbuffers/go/penumbra/core/ibc/v1alpha1
buf.build/gen/go/penumbra-zone/ibc-go-vendor/protocolbuffers/go/ibc/core/client/v1
```
suggesting that the IBC package depends on ibc-go-vendor, even though the `penumbra` module's `buf.yaml` specifies
```
deps:
  - buf.build/cosmos/ibc
```
This is weird. In an attempt to figure out what's going on, try removing the
`ibc-go-vendor` package entirely, to see what's happening.

In the future, we should move all of the Rust imports to use the proto files
pulled from Buf, but this requires either (a) telling `prost`/`tonic` about
where to find the proto files in the Buf module cache or (b) telling Buf how to
drive prost and tonic. (a) seems easier but for now, we can just accept a
little bit of divergence.
@hdevalence hdevalence temporarily deployed to smoke-test February 22, 2023 22:56 — with GitHub Actions Inactive
@hdevalence hdevalence merged commit 99fa99b into main Feb 22, 2023
@hdevalence hdevalence deleted the devendor-ibc_r2 branch February 22, 2023 23:12
@cratelyn cratelyn added the protobuf-changes Makes changes to the protobuf definitions. label Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
protobuf-changes Makes changes to the protobuf definitions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants