-
Notifications
You must be signed in to change notification settings - Fork 33
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
[IBC] Clone cosmos/ics23
protobuf definitions into IBC repo
#922
Conversation
ibc/types/proto/proofs.proto
Outdated
@@ -0,0 +1,222 @@ | |||
syntax = "proto3"; | |||
|
|||
// This file is a clone from the github.com/cosmos/ics23 repo, it has been |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
I suggest even creating a small bash file that does a
wget
to the files you need (e.g.https://raw.githubusercontent.com/cosmos/ics23/master/proto/cosmos/ics23/v1/proofs.proto
) so we can update it by running one command if it ever changes. -
Make sure to highlight this comment by starting with a
// !! IMPORTANT !! This file is a clone
-
What problems are you encountering or questions do you have? From my point of view, embedding the
.proto
definition instead of the compiled.pb.go
file is the correct way to go about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if you look in #916 I need to embed the ProofSpec
into the PocketClientState
message. This is only possible when 1. we import the proto file and 2. the type is a message.
As the cosmos gogoproto compiler doesnt produce types that satisy the proto.Message
interface we cannot just use the ics23.SmtSpec
type they define we must recompile using normal protoc (so it produces proto.Message
) types and then create the type ourselves. This way we can use the proto file, import it and then use the type. Adding the conversion allows us to still use the cosmos/ics23
library for the methods they define but gives us the ability to use the message aswell
fbc8083
to
345f22d
Compare
f7a6dfe
to
7116016
Compare
56b12ac
to
513005c
Compare
Makefile
Outdated
.PHONY: copy_ics23_proto | ||
copy_ics23_proto: | ||
echo "Downloading cosmos/ics23 proto definitions..." | ||
curl -s -o ./ibc/types/proto/proofs.proto https://raw.githubusercontent.com/cosmos/ics23/master/proto/cosmos/ics23/v1/proofs.proto && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know both curl and wget get the job done, but I've seen wget
used more frequently in these types of contexts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wget is not installed out of the box on most linux distros as such I think it better to use curl which is part of the coreutils.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR copies in the
cosmos/ics23
protobuf definition file into the IBC types directory.Doing so allows the
protoc
compile to compile the protobuf definitions correctly such that they implement theproto.Message
interface, as when compiled using thegogoproto
fork used by cosmos they do not. This is to allow for theProofSpec
to be included in the light clientPocketClientState
message in #916. In this usecase theics23.SmtSpec
cannot be used directly due to the issues mention above.Description
Summary generated by Reviewpad on 24 Jul 23 22:27 UTC
This pull request includes the following changes:
Makefile
, including the detection of the operating system, addition of OS-specific commands, a new target for downloading proto definitions, modification of imported package path, and a comment header indicating the origin of theproofs.proto
file.Please review the entire diff for further details.
Issue
Fixes N/A
Type of change
Please mark the relevant option(s):
List of changes
cosmos/ics23
proto definition into the IBC types directoryTesting
make develop_test
; if any code changes were mademake test_e2e
on k8s LocalNet; if any code changes were madee2e-devnet-test
passes tests on DevNet; if any code was changedRequired Checklist
godoc
format comments on touched members (see: tip.golang.org/doc/comment)If Applicable Checklist
shared/docs/*
if I updatedshared/*
README(s)