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

rebase romac/channel-upgrade-only with main #177

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix `#[no_std]` attribute removal and add `informalsystems-pbjson/std` dependency
for `std` feature ([#171](https://github.com/cosmos/ibc-proto-rs/issues/171)).
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/167-ics721-impl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Add ICS-721 proto: ([\#167](https://github.com/cosmos/ibc-proto-
rs/issues/167))
3 changes: 3 additions & 0 deletions .changelog/unreleased/features/168-add-wasm-client-protos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Integrate Wasm light client proto types by updating `IBC_GO_COMMIT` to the
hash associated with the ibc-go `wasm-v8.0.0` tag
([#168](https://github.com/cosmos/ibc-proto-rs/issues/168)).
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Sync ibc-go at `e1df7a6` to add `counterparty_upgrade_sequence` to
`MsgTimeoutOnClose` and `MsgChannelCloseConfirm` for Hermes support
([#172](https://github.com/cosmos/ibc-proto-rs/issues/172)).
2 changes: 2 additions & 0 deletions .changelog/v0.39.1/features/163-prost-name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Derive the `prost::Name` trait for all Protobuf messages
([\#163](https://github.com/cosmos/ibc-proto-rs/pull/163))
1 change: 1 addition & 0 deletions .changelog/v0.39.1/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*November 22nd, 2023*
4 changes: 4 additions & 0 deletions .changelog/v0.40.0/breaking-changes/166-protojson-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Added ProtoJSON support.
The `serde` feature flag now abides by [Protobuf JSON rules](https://protobuf.dev/programming-guides/proto3/#json)
when it comes to JSON serialization/deserialization.
([#166](https://github.com/cosmos/ibc-proto-rs/pull/166))
1 change: 1 addition & 0 deletions .changelog/v0.40.0/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*December 29th, 2023*
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# CHANGELOG

## v0.40.0

*December 29th, 2023*

### BREAKING CHANGES

- Added ProtoJSON support.
The `serde` feature flag now abides by [Protobuf JSON rules](https://protobuf.dev/programming-guides/proto3/#json)
when it comes to JSON serialization/deserialization.
([#166](https://github.com/cosmos/ibc-proto-rs/pull/166))

## v0.39.1

*November 22nd, 2023*

### FEATURES

- Derive the `prost::Name` trait for all Protobuf messages
([\#163](https://github.com/cosmos/ibc-proto-rs/pull/163))

## v0.39.0

*November 15th, 2023*
Expand Down
28 changes: 16 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ibc-proto"
version = "0.39.0"
version = "0.40.0"
authors = ["Informal Systems <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down Expand Up @@ -28,15 +28,16 @@ doctest = false
all-features = true

[dependencies]
prost = { version = "0.12", default-features = false, features = ["prost-derive"] }
bytes = { version = "1.2", default-features = false }
tonic = { version = "0.10", default-features = false, optional = true }
serde = { version = "1.0", default-features = false, optional = true }
schemars = { version = "0.8", optional = true }
subtle-encoding = { version = "0.5", default-features = false }
base64 = { version = "0.21", default-features = false, features = ["alloc"] }
flex-error = { version = "0.4", default-features = false }
ics23 = { version = "0.11.0", default-features = false }
prost = { version = "0.12.3", default-features = false, features = ["prost-derive"] }
bytes = { version = "1.2", default-features = false }
tonic = { version = "0.10", default-features = false, optional = true }
serde = { version = "1.0", default-features = false, optional = true }
schemars = { version = "0.8", optional = true }
subtle-encoding = { version = "0.5", default-features = false }
base64 = { version = "0.21", default-features = false, features = ["alloc"] }
flex-error = { version = "0.4", default-features = false }
ics23 = { version = "0.11.0", default-features = false }
informalsystems-pbjson = { version = "0.7.0", optional = true, default-features = false }

## Optional: enabled by the `parity-scale-codec` feature
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["full"], optional = true }
Expand All @@ -50,10 +51,13 @@ borsh = { version = "0.10", default-features = false, optional = true }
version = "0.34"
default-features = false

[dev-dependencies]
serde_json = "1.0.107"

[features]
default = ["std", "client"]
std = ["prost/std", "bytes/std", "subtle-encoding/std", "base64/std", "flex-error/std", "ics23/std"]
serde = ["dep:serde", "ics23/serde"]
std = ["prost/std", "bytes/std", "subtle-encoding/std", "base64/std", "flex-error/std", "ics23/std", "informalsystems-pbjson/std"]
serde = ["dep:serde", "ics23/serde", "informalsystems-pbjson"]
client = ["std", "dep:tonic", "tonic/codegen", "tonic/transport", "tonic/prost"]
json-schema = ["std", "serde", "dep:schemars"]
server = ["std", "dep:tonic", "tonic/codegen", "tonic/transport", "tonic/prost"]
Expand Down
29 changes: 29 additions & 0 deletions scripts/sync-protobuf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ CACHE_PATH="${XDG_CACHE_HOME:-$HOME/.cache}"
COSMOS_SDK_GIT="${COSMOS_SDK_GIT:-$CACHE_PATH/cosmos/cosmos-sdk.git}"
IBC_GO_GIT="${IBC_GO_GIT:-$CACHE_PATH/ibc-go.git}"
COSMOS_ICS_GIT="${COSMOS_ICS_GIT:-$CACHE_PATH/cosmos/interchain-security.git}"
NFT_TRANSFER_GIT="${NFT_TRANSFER_GIT:-$CACHE_PATH/bianjieai/nft-transfer.git}"

COSMOS_SDK_COMMIT="$(cat src/COSMOS_SDK_COMMIT)"
IBC_GO_COMMIT="$(cat src/IBC_GO_COMMIT)"
INTERCHAIN_SECURITY_COMMIT="$(cat src/INTERCHAIN_SECURITY_COMMIT)"
NFT_TRANSFER_COMMIT="$(cat src/NFT_TRANSFER_COMMIT)"

echo "COSMOS_SDK_COMMIT: $COSMOS_SDK_COMMIT"
echo "IBC_GO_COMMIT: $IBC_GO_COMMIT"
echo "INTERCHAIN_SECURITY_COMMIT: $INTERCHAIN_SECURITY_COMMIT"
echo "NFT_TRANSFER_COMMIT: $NFT_TRANSFER_COMMIT"

# Use either --ics-commit flag for commit ID,
# or --ics-tag for git tag. Because we can't modify
Expand Down Expand Up @@ -89,6 +92,15 @@ else
echo "Using existing ibc-go bare git repository at $IBC_GO_GIT"
fi

if [[ ! -e "$NFT_TRANSFER_GIT" ]]
then
echo "Cloning nft-transfer source code to as bare git repository to $NFT_TRANSFER_GIT"
git clone --mirror https://github.com/bianjieai/nft-transfer.git "$NFT_TRANSFER_GIT"
else
echo "Using existing nft-transfer bare git repository at $NFT_TRANSFER_GIT"
fi


# Update the repositories using git fetch. This is so that
# we keep local copies of the repositories up to sync first.
pushd "$COSMOS_ICS_GIT"
Expand All @@ -103,6 +115,10 @@ pushd "$IBC_GO_GIT"
git fetch
popd

pushd "$NFT_TRANSFER_GIT"
git fetch
popd

# Create a new temporary directory to check out the
# actual source files from the bare git repositories.
# This is so that we do not accidentally use an unclean
Expand Down Expand Up @@ -154,6 +170,17 @@ cd proto
buf export -v -o ../proto-include
popd

NFT_TRANSFER_DIR=$(mktemp -d /tmp/nft-transfer-XXXXXXXX)

pushd "$NFT_TRANSFER_DIR"
git clone "$NFT_TRANSFER_GIT" .
git checkout -b "$NFT_TRANSFER_COMMIT" "$NFT_TRANSFER_COMMIT"

cd proto
buf export -v -o ../proto-include
rm ../proto-include/ibc/core/client/v1/client.proto
popd

# Remove the existing generated protobuf files
# so that the newly generated code does not
# contain removed files.
Expand All @@ -173,6 +200,7 @@ cargo run -- compile \
--ics "$COSMOS_ICS_DIR/proto-include" \
--sdk "$COSMOS_SDK_DIR/proto-include" \
--ibc "$IBC_GO_DIR/proto-include" \
--nft "$NFT_TRANSFER_DIR/proto-include" \
--out ../../src/prost

cd ../..
Expand All @@ -192,3 +220,4 @@ rm -f src/prost/tendermint.abci.rs
rm -rf "$COSMOS_ICS_DIR"
rm -rf "$COSMOS_SDK_DIR"
rm -rf "$IBC_GO_DIR"
rm -rf "$NFT_TRANSFER_DIR"
2 changes: 1 addition & 1 deletion src/IBC_GO_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2551dea41cd3c512845007ca895c8402afa9b79f
e1df7a6948d1dd94b7d2dadd226bee23d3e1e667
1 change: 1 addition & 0 deletions src/NFT_TRANSFER_COMMIT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
986de3bb91434c9efc49a82544e3ba0b208e19a7
2 changes: 2 additions & 0 deletions src/google.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
pub mod protobuf {
use crate::include_proto;
include_proto!("google.protobuf.rs");
#[cfg(feature = "serde")]
include_proto!("google.protobuf.serde.rs");

// source: https://github.com/tokio-rs/prost/blob/master/prost-types/src/lib.rs
use core::convert::TryFrom;
Expand Down
Loading
Loading