Skip to content

Commit

Permalink
Merge tag 'v0.37.0' into romac/channel-upgrade-only
Browse files Browse the repository at this point in the history
ibc-proto-rs v0.37.0

*October 4th, 2023*

This release updates `prost` to v0.12 and `tonic` to v0.10,
and makes `serde` an optional dependency, now only enabled with the `serde` feature.

FEATURES:

- Update `prost` to v0.12 and `tonic` to v0.10
  (#145)

IMPROVEMENTS:

- Make `serde` an optional dependency, now only enabled with the `serde` feature
  (#152)
  • Loading branch information
ljoss17 committed Oct 10, 2023
2 parents a3cad91 + e1838a4 commit 2c8cf0e
Show file tree
Hide file tree
Showing 79 changed files with 4,476 additions and 2,951 deletions.
2 changes: 2 additions & 0 deletions .changelog/v0.34.0/bug-fixes/98-restore-no-std-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Restore `no_std` support for JSON serialization
([\#98](https://github.com/cosmos/ibc-proto-rs/issues/98))
2 changes: 2 additions & 0 deletions .changelog/v0.34.0/features/129-update-protos-7.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Update Cosmos SDK protos to v0.47.3 and IBC-Go protos to v7.2.0
([\#129](https://github.com/cosmos/ibc-proto-rs/issues/129))
8 changes: 8 additions & 0 deletions .changelog/v0.34.0/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This release updates the Cosmos SDK protos to v0.47.3 and IBC-Go protos to v7.2.0.

Additionally, it restore `no_std` support for JSON serialization via `serde`.
Previously, `Serialize` and `Deserialize` instances were only derived when
the `std` feature was enabled, but that is no longer required.

As such, they now require the `serde` feature to be enabled, independently of
whether or not the `std` feature is enabled.
1 change: 1 addition & 0 deletions .changelog/v0.34.1/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This release updates the `borsh` dependency to v0.10.
2 changes: 2 additions & 0 deletions .changelog/v0.35.0/features/140-130-ibc-go-v730.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Bump ibc-go to v7.3.0, Cosmos SDK to 0.47.5 and Interchain Security to v3.1.0
([\#140](https://github.com/cosmos/ibc-proto-rs/pull/140))
2 changes: 2 additions & 0 deletions .changelog/v0.35.0/features/143-localhost-v1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Add proto definition for `ibc.lightclients.localhost.v1`
([\#143](https://github.com/cosmos/ibc-proto-rs/pull/143))
5 changes: 5 additions & 0 deletions .changelog/v0.35.0/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This release updates the IBC-Go protos to v7.3.0, the Cosmos SDK protos to v0.47.5,
and the Interchain Security protos to v3.1.0.

It also adds back the `ibc.lightclients.localhost.v1` proto definition that was
removed in IBC-Go v7.0.0, for users which may need to interact with v1 localhost clients.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- Since ibc-proto v0.34.0, the script in charge of generating the Rust proto definitions
has been mistakenly checking out their latest version instead of the one
specified in the corresponding `src/*_COMMIT` file. This has now been fixed
and the protos have therefore been downgraded to their proper versions:
* IBC-Go: v7.3.0,
* Cosmos SDK: v0.47.5
* Interchain Security: v3.1.0
([\#147](https://github.com/cosmos/ibc-proto-rs/pull/147))
3 changes: 3 additions & 0 deletions .changelog/v0.36.0/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*September 28th, 2023*

Warning: This release downgrades the Protobuf definitions for IBC-Go, Cosmos SDK, and Interchain Security.
2 changes: 2 additions & 0 deletions .changelog/v0.36.1/features/149-crypto.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Add Protobuf definitions from `cosmos.crypto.*`
([\#149](https://github.com/cosmos/ibc-proto-rs/pull/149))
3 changes: 3 additions & 0 deletions .changelog/v0.36.1/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*September 28th, 2023*

This release adds Protobuf definitions from the `cosmos.crypto.*` package.
2 changes: 2 additions & 0 deletions .changelog/v0.37.0/features/145-prost-0.12.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Update `prost` to v0.12 and `tonic` to v0.10
([\#145](https://github.com/cosmos/ibc-proto-rs/issues/145))
2 changes: 2 additions & 0 deletions .changelog/v0.37.0/improvements/152-serde-optional.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Make `serde` an optional dependency, now only enabled with the `serde` feature
([\#152](https://github.com/cosmos/ibc-proto-rs/pull/152))
4 changes: 4 additions & 0 deletions .changelog/v0.37.0/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*October 4th, 2023*

This release updates `prost` to v0.12 and `tonic` to v0.10,
and makes `serde` an optional dependency, now only enabled with the `serde` feature.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ on:

jobs:
create-release:
name: Create GitHub release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: taiki-e/create-gh-release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
override: true
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v1
- run: cargo hack clippy --feature-powerset --no-dev-deps
- run: cargo hack check --feature-powerset --no-dev-deps

test-stable:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -123,6 +123,22 @@ jobs:
with:
command: build

doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
env:
RUSTDOCFLAGS: "-D warnings"
with:
command: doc
args: --all-features

publish-dry-run:
runs-on: ubuntu-latest
steps:
Expand Down
92 changes: 91 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,98 @@
# CHANGELOG

## v0.37.0

*October 4th, 2023*

This release updates `prost` to v0.12 and `tonic` to v0.10,
and makes `serde` an optional dependency, now only enabled with the `serde` feature.

### FEATURES

- Update `prost` to v0.12 and `tonic` to v0.10
([\#145](https://github.com/cosmos/ibc-proto-rs/issues/145))

### IMPROVEMENTS

- Make `serde` an optional dependency, now only enabled with the `serde` feature
([\#152](https://github.com/cosmos/ibc-proto-rs/pull/152))

## v0.36.1

*September 28th, 2023*

This release adds Protobuf definitions from the `cosmos.crypto.*` package.

### FEATURES

- Add Protobuf definitions from `cosmos.crypto.*` ([\#149](https://github.com/cosmos/ibc-proto-rs/pull/149))

## v0.36.0

*September 28th, 2023*

Warning: This release downgrades the Protobuf definitions for IBC-Go, Cosmos SDK, and Interchain Security.

### BREAKING CHANGES

- Since ibc-proto v0.34.0, the script in charge of generating the Rust proto definitions
has been mistakenly checking out their latest version instead of the one
specified in the corresponding `src/*_COMMIT` file. This has now been fixed
and the protos have therefore been downgraded to their proper versions:
* IBC-Go: v7.3.0,
* Cosmos SDK: v0.47.5
* Interchain Security: v3.1.0
([\#147](https://github.com/cosmos/ibc-proto-rs/pull/147))

## v0.35.0

*September 14th, 2023*

This release updates the IBC-Go protos to v7.3.0, the Cosmos SDK protos to v0.47.5,
and the Interchain Security protos to v3.1.0.

It also adds back the `ibc.lightclients.localhost.v1` proto definition that was
removed in IBC-Go v7.0.0, for users which may need to interact with v1 localhost clients.

### FEATURES

- Bump ibc-go to v7.3.0, Cosmos SDK to 0.47.5 and Interchain Security to v3.1.0
([\#140](https://github.com/cosmos/ibc-proto-rs/pull/140))
- Add proto definition for `ibc.lightclients.localhost.v1`
([\#143](https://github.com/cosmos/ibc-proto-rs/pull/143))

## v0.34.1

*August 29th, 2023*

This release updates the `borsh` dependency to v0.10.

## v0.34.0

*August 17th, 2023*

This release updates the Cosmos SDK protos to v0.47.3 and IBC-Go protos to v7.2.0.

Additionally, it restore `no_std` support for JSON serialization via `serde`.
Previously, `Serialize` and `Deserialize` instances were only derived when
the `std` feature was enabled, but that is no longer required.

As such, they now require the `serde` feature to be enabled, independently of
whether or not the `std` feature is enabled.

### BUG FIXES

- Restore `no_std` support for JSON serialization
([\#98](https://github.com/cosmos/ibc-proto-rs/issues/98))

### FEATURES

- Update Cosmos SDK protos to v0.47.3 and IBC-Go protos to v7.2.0
([\#129](https://github.com/cosmos/ibc-proto-rs/issues/129))

## v0.33.0

*Aug 14th, 2023*
*Aug 16th, 2023*

This release bumps `tendermint-rs` to `0.33.0`.

Expand Down
34 changes: 16 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "ibc-proto"
version = "0.33.0"
version = "0.37.0"
authors = ["Informal Systems <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/cosmos/ibc-proto-rs"
readme = "README.md"
categories = ["cryptography::cryptocurrencies", "encoding", "no-std"]
keywords = ["blockchain", "cosmos", "tendermint", "ibc", "proto"]
exclude = ["definitions", "tools"]
exclude = ["definitions", "tools", ".changelog", ".github"]
description = """
ibc-proto provides Cosmos SDK & IBC Protocol Buffers definitions
"""
Expand All @@ -28,37 +28,35 @@ doctest = false
all-features = true

[dependencies]
prost = { version = "0.11", default-features = false }
prost = { version = "0.12", default-features = false, features = ["prost-derive"] }
bytes = { version = "1.2", default-features = false }
tonic = { version = "0.9", default-features = false, optional = true }
serde = { version = "1.0", 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 }

## for codec encode or decode
## Optional: enabled by the `parity-scale-codec` feature
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["full"], optional = true }
scale-info = { version = "2.1.2", default-features = false, features = ["derive"], optional = true }

## for borsh encode or decode
## need tracking anchor-lang and near-sdk-rs borsh version
borsh = { version = "0.9", default-features = false, optional = true }

[dependencies.ics23]
version = "0.10.1"
default-features = false
## Optional: enabled by the `borsh` feature
## For borsh encode or decode, needs to track `anchor-lang` and `near-sdk-rs` borsh version
borsh = { version = "0.10", default-features = false, optional = true }

[dependencies.tendermint-proto]
version = "0.33"
version = "0.34"
default-features = false

[features]
default = ["std", "client"]
std = ["prost/std", "bytes/std", "subtle-encoding/std", "base64/std", "flex-error/std", "ics23/std", "ics23/serde"]
client = ["std", "tonic", "tonic/codegen", "tonic/transport", "tonic/prost"]
json-schema = ["std", "schemars"]
server = ["std", "tonic", "tonic/codegen", "tonic/transport", "tonic/prost"]
std = ["prost/std", "bytes/std", "subtle-encoding/std", "base64/std", "flex-error/std", "ics23/std"]
serde = ["dep:serde", "ics23/serde"]
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"]
parity-scale-codec = ["dep:parity-scale-codec", "dep:scale-info"]
borsh = ["dep:borsh"]
proto-descriptor = []
18 changes: 18 additions & 0 deletions definitions/ibc/lightclients/localhost/v1/localhost.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
syntax = "proto3";

package ibc.lightclients.localhost.v1;

option go_package = "github.com/cosmos/ibc-go/v6/modules/light-clients/09-localhost/types";

import "gogoproto/gogo.proto";
import "ibc/core/client/v1/client.proto";

// ClientState defines a loopback (localhost) client. It requires (read-only)
// access to keys outside the client prefix.
message ClientState {
option (gogoproto.goproto_getters) = false;
// self chain ID
string chain_id = 1 [(gogoproto.moretags) = "yaml:\"chain_id\""];
// self latest block height
ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false];
}
33 changes: 12 additions & 21 deletions scripts/sync-protobuf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,7 @@ COSMOS_ICS_DIR=$(mktemp -d /tmp/interchain-security-XXXXXXXX)

pushd "$COSMOS_ICS_DIR"
git clone "$COSMOS_ICS_GIT" .
git checkout "$COSMOS_ICS_COMMIT"

# We have to name the commit as a branch because
# proto-compiler uses the branch name as the commit
# output. Otherwise it will just output HEAD
git checkout -b "$COSMOS_ICS_COMMIT"
git checkout -b "$COSMOS_ICS_COMMIT" "$COSMOS_ICS_COMMIT"

cd proto
buf mod update
Expand All @@ -127,12 +122,7 @@ COSMOS_SDK_DIR=$(mktemp -d /tmp/cosmos-sdk-XXXXXXXX)

pushd "$COSMOS_SDK_DIR"
git clone "$COSMOS_SDK_GIT" .
git checkout "$COSMOS_SDK_COMMIT"

# We have to name the commit as a branch because
# proto-compiler uses the branch name as the commit
# output. Otherwise it will just output HEAD
git checkout -b "$COSMOS_SDK_COMMIT"
git checkout -b "$COSMOS_SDK_COMMIT" "$COSMOS_SDK_COMMIT"

cd proto
buf mod update
Expand All @@ -141,8 +131,6 @@ popd

cat << "EOF" >> "$COSMOS_SDK_DIR/proto-include/cosmos/staking/v1beta1/staking.proto"
import "tendermint/abci/types.proto";
// InfractionType indicates the infraction type a validator commited.
enum InfractionType {
option (gogoproto.goproto_enum_prefix) = false;
Expand All @@ -154,19 +142,13 @@ enum InfractionType {
// DOWNTIME defines a validator that missed signing too many blocks.
INFRACTION_TYPE_DOWNTIME = 2 [(gogoproto.enumvalue_customname) = "Downtime"];
}
// ValidatorUpdates defines an array of abci.ValidatorUpdate objects.
message ValidatorUpdates {
repeated tendermint.abci.ValidatorUpdate updates = 1 [(gogoproto.nullable) = false];
}
EOF

IBC_GO_DIR=$(mktemp -d /tmp/ibc-go-XXXXXXXX)

pushd "$IBC_GO_DIR"
git clone "$IBC_GO_GIT" .
git checkout "$IBC_GO_COMMIT"
git checkout -b "$IBC_GO_COMMIT"
git checkout -b "$IBC_GO_COMMIT" "$IBC_GO_COMMIT"

cd proto
buf export -v -o ../proto-include
Expand All @@ -193,6 +175,15 @@ cargo run --locked -- compile \
--ibc "$IBC_GO_DIR/proto-include" \
--out ../../src/prost

cd ../..

# Remove generated ICS23 code because it is not used,
# we instead re-exports the `ics23` crate type definitions.
rm -f src/prost/cosmos.ics23.v1.rs

# The Tendermint ABCI protos are unused from within ibc-proto
rm -f src/prost/tendermint.abci.rs

# Remove the temporary checkouts of the repositories
rm -rf "$COSMOS_ICS_DIR"
rm -rf "$COSMOS_SDK_DIR"
Expand Down
2 changes: 1 addition & 1 deletion src/COSMOS_ICS_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1afe31f573c8dcde08a572572565d43a35eab642
512753529b7fea6f825c1bfdb1242dd4207b2366
2 changes: 1 addition & 1 deletion src/COSMOS_SDK_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eb1e3ebf6fcfd56e1f1d8f4c0a6192740bd8a6c1
2e9e5d6eea24d6c11eddc9c002c66e89ae036187
6 changes: 4 additions & 2 deletions src/google.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,10 @@ pub mod protobuf {

#[cfg(feature = "borsh")]
impl borsh::BorshDeserialize for Any {
fn deserialize(reader: &mut &[u8]) -> borsh::maybestd::io::Result<Self> {
let inner_any = InnerAny::deserialize(reader)?;
fn deserialize_reader<R: borsh::maybestd::io::Read>(
reader: &mut R,
) -> borsh::maybestd::io::Result<Self> {
let inner_any = InnerAny::deserialize_reader(reader)?;

Ok(Any {
type_url: inner_any.type_url,
Expand Down
Loading

0 comments on commit 2c8cf0e

Please sign in to comment.