Skip to content

Commit

Permalink
Merge pull request #84 from penumbra-zone/bump_ibc_proto
Browse files Browse the repository at this point in the history
Update ibc-proto dependency to 0.42.0, prepare for 0.13.0 release
  • Loading branch information
zbuc authored Apr 4, 2024
2 parents dac3bbf + 4c94157 commit 1cb04a7
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 60 deletions.
2 changes: 1 addition & 1 deletion ci/no-std-check/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ibc-types = { path = "../../crates/ibc-types", default-features = false, feature
"serde",
"mocks-no-std",
] }
ibc-proto = { version = "0.41.0", default-features = false }
ibc-proto = { version = "0.42.0", default-features = false }
tendermint = { version = "0.34.0", default-features = false }
tendermint-proto = { version = "0.34.0", default-features = false }
tendermint-light-client-verifier = { version = "0.34.0", default-features = false, features = ["rust-crypto"] }
Expand Down
18 changes: 9 additions & 9 deletions crates/ibc-types-core-channel/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ibc-types-core-channel"
version = "0.12.0"
version = "0.13.0"
edition = "2021"
license = "Apache-2.0"
readme = "../../README.md"
Expand Down Expand Up @@ -53,14 +53,14 @@ mocks = ["tendermint-testgen", "tendermint/clock", "cfg-if", "parking_lot"]
mocks-no-std = ["cfg-if"]

[dependencies]
ibc-types-core-client = { version = "0.12.0", path = "../ibc-types-core-client", default-features = false }
ibc-types-core-connection = { version = "0.12.0", path = "../ibc-types-core-connection", default-features = false }
ibc-types-core-commitment = { version = "0.12.0", path = "../ibc-types-core-commitment", default-features = false }
ibc-types-domain-type = { version = "0.12.0", path = "../ibc-types-domain-type", default-features = false }
ibc-types-identifier = { version = "0.12.0", path = "../ibc-types-identifier", default-features = false }
ibc-types-timestamp = { version = "0.12.0", path = "../ibc-types-timestamp", default-features = false }
ibc-types-core-client = { version = "0.13.0", path = "../ibc-types-core-client", default-features = false }
ibc-types-core-connection = { version = "0.13.0", path = "../ibc-types-core-connection", default-features = false }
ibc-types-core-commitment = { version = "0.13.0", path = "../ibc-types-core-commitment", default-features = false }
ibc-types-domain-type = { version = "0.13.0", path = "../ibc-types-domain-type", default-features = false }
ibc-types-identifier = { version = "0.13.0", path = "../ibc-types-identifier", default-features = false }
ibc-types-timestamp = { version = "0.13.0", path = "../ibc-types-timestamp", default-features = false }
# Proto definitions for all IBC-related interfaces, e.g., connections or channels.
ibc-proto = { version = "0.41.0", default-features = false }
ibc-proto = { version = "0.42.0", default-features = false }
## for borsh encode or decode
borsh = {version = "0.10.0", default-features = false, optional = true }
bytes = { version = "1.2.1", default-features = false }
Expand Down Expand Up @@ -102,6 +102,6 @@ default-features = false
[dev-dependencies]
cfg-if = { version = "1.0.0" }
env_logger = "0.10.0"
ibc-types-core-client = { version = "0.12.0", path = "../ibc-types-core-client", features = ["mocks"] }
ibc-types-core-client = { version = "0.13.0", path = "../ibc-types-core-client", features = ["mocks"] }
test-log = { version = "0.2.10", features = ["trace"] }
tracing-subscriber = { version = "0.3.14", features = ["fmt", "env-filter", "json"]}
22 changes: 20 additions & 2 deletions crates/ibc-types-core-channel/src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,21 @@ pub struct IdentifiedChannelEnd {
pub port_id: PortId,
pub channel_id: ChannelId,
pub channel_end: ChannelEnd,
pub upgrade_sequence: u64,
}

impl IdentifiedChannelEnd {
pub fn new(port_id: PortId, channel_id: ChannelId, channel_end: ChannelEnd) -> Self {
pub fn new(
port_id: PortId,
channel_id: ChannelId,
channel_end: ChannelEnd,
upgrade_sequence: u64,
) -> Self {
IdentifiedChannelEnd {
port_id,
channel_id,
channel_end,
upgrade_sequence,
}
}
}
Expand All @@ -47,12 +54,14 @@ impl TryFrom<RawIdentifiedChannel> for IdentifiedChannelEnd {
counterparty: value.counterparty,
connection_hops: value.connection_hops,
version: value.version,
upgrade_sequence: value.upgrade_sequence,
};

Ok(IdentifiedChannelEnd {
port_id: value.port_id.parse().map_err(ChannelError::Identifier)?,
channel_id: value.channel_id.parse().map_err(ChannelError::Identifier)?,
channel_end: raw_channel_end.try_into()?,
upgrade_sequence: value.upgrade_sequence,
})
}
}
Expand All @@ -72,6 +81,7 @@ impl From<IdentifiedChannelEnd> for RawIdentifiedChannel {
version: value.channel_end.version.to_string(),
port_id: value.port_id.to_string(),
channel_id: value.channel_id.to_string(),
upgrade_sequence: value.upgrade_sequence,
}
}
}
Expand All @@ -88,6 +98,7 @@ pub struct ChannelEnd {
pub remote: Counterparty,
pub connection_hops: Vec<ConnectionId>,
pub version: Version,
pub upgrade_sequence: u64,
}

impl Default for ChannelEnd {
Expand All @@ -98,6 +109,7 @@ impl Default for ChannelEnd {
remote: Counterparty::default(),
connection_hops: Vec::new(),
version: Version::default(),
upgrade_sequence: 0,
}
}
}
Expand Down Expand Up @@ -131,13 +143,15 @@ impl TryFrom<RawChannel> for ChannelEnd {
.map_err(ChannelError::Identifier)?;

let version = value.version.into();
let upgrade_sequence = value.upgrade_sequence;

Ok(ChannelEnd::new(
chan_state,
chan_ordering,
remote,
connection_hops,
version,
upgrade_sequence,
))
}
}
Expand All @@ -154,6 +168,7 @@ impl From<ChannelEnd> for RawChannel {
.map(|v| v.as_str().to_string())
.collect(),
version: value.version.to_string(),
upgrade_sequence: value.upgrade_sequence,
}
}
}
Expand All @@ -166,13 +181,15 @@ impl ChannelEnd {
remote: Counterparty,
connection_hops: Vec<ConnectionId>,
version: Version,
upgrade_sequence: u64,
) -> Self {
Self {
state,
ordering,
remote,
connection_hops,
version,
upgrade_sequence,
}
}

Expand Down Expand Up @@ -478,7 +495,8 @@ pub mod test_util {
ordering: 2,
counterparty: Some(get_dummy_raw_counterparty(channel_id)),
connection_hops: vec![ConnectionId::default().to_string()],
version: "".to_string(), // The version is not validated.
version: "".to_string(),
upgrade_sequence: 0,
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions crates/ibc-types-core-channel/src/msgs/chan_close_confirm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub struct MsgChannelCloseConfirm {
pub proof_chan_end_on_a: MerkleProof,
pub proof_height_on_a: Height,
pub signer: String,
pub counterparty_upgrade_sequence: u64,
}

impl DomainType for MsgChannelCloseConfirm {
Expand All @@ -42,6 +43,7 @@ impl TryFrom<RawMsgChannelCloseConfirm> for MsgChannelCloseConfirm {
.and_then(|raw_height| raw_height.try_into().ok())
.ok_or(ChannelError::MissingHeight)?,
signer: raw_msg.signer,
counterparty_upgrade_sequence: raw_msg.counterparty_upgrade_sequence,
})
}
}
Expand All @@ -54,6 +56,7 @@ impl From<MsgChannelCloseConfirm> for RawMsgChannelCloseConfirm {
proof_init: domain_msg.proof_chan_end_on_a.clone().encode_to_vec(),
proof_height: Some(domain_msg.proof_height_on_a.into()),
signer: domain_msg.signer,
counterparty_upgrade_sequence: domain_msg.counterparty_upgrade_sequence,
}
}
}
Expand All @@ -78,6 +81,7 @@ pub mod test_util {
revision_height: proof_height,
}),
signer: get_dummy_bech32_account(),
counterparty_upgrade_sequence: 0,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions crates/ibc-types-core-channel/src/msgs/chan_open_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ impl From<MsgChannelOpenInit> for RawMsgChannelOpenInit {
Counterparty::new(domain_msg.port_id_on_b, None),
domain_msg.connection_hops_on_a,
domain_msg.version_proposal,
// Initial upgrade sequence for a newly initialized channel is 0
0,
);
RawMsgChannelOpenInit {
port_id: domain_msg.port_id_on_a.to_string(),
Expand Down
2 changes: 2 additions & 0 deletions crates/ibc-types-core-channel/src/msgs/chan_open_try.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ impl From<MsgChannelOpenTry> for RawMsgChannelOpenTry {
Counterparty::new(domain_msg.port_id_on_a, Some(domain_msg.chan_id_on_a)),
domain_msg.connection_hops_on_b,
Version::empty(), // Excessive field to satisfy the type conversion
// Initial upgrade sequence for a newly initialized channel is 0
0,
);
#[allow(deprecated)]
RawMsgChannelOpenTry {
Expand Down
4 changes: 4 additions & 0 deletions crates/ibc-types-core-channel/src/msgs/timeout_on_close.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub struct MsgTimeoutOnClose {
pub proof_close_on_b: MerkleProof,
pub proof_height_on_b: Height,
pub signer: String,
pub counterparty_upgrade_sequence: u64,
}

impl DomainType for MsgTimeoutOnClose {
Expand Down Expand Up @@ -51,6 +52,7 @@ impl TryFrom<RawMsgTimeoutOnClose> for MsgTimeoutOnClose {
.and_then(|raw_height| raw_height.try_into().ok())
.ok_or(PacketError::MissingHeight)?,
signer: raw_msg.signer,
counterparty_upgrade_sequence: raw_msg.counterparty_upgrade_sequence,
})
}
}
Expand All @@ -64,6 +66,7 @@ impl From<MsgTimeoutOnClose> for RawMsgTimeoutOnClose {
proof_height: Some(domain_msg.proof_height_on_b.into()),
next_sequence_recv: domain_msg.next_seq_recv_on_b.into(),
signer: domain_msg.signer,
counterparty_upgrade_sequence: domain_msg.counterparty_upgrade_sequence,
}
}
}
Expand Down Expand Up @@ -179,6 +182,7 @@ pub mod test_util {
}),
next_sequence_recv: 1,
signer: get_dummy_bech32_account(),
counterparty_upgrade_sequence: 0,
}
}
}
10 changes: 5 additions & 5 deletions crates/ibc-types-core-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ibc-types-core-client"
version = "0.12.0"
version = "0.13.0"
edition = "2021"
license = "Apache-2.0"
readme = "../../README.md"
Expand Down Expand Up @@ -54,10 +54,10 @@ bytes = { version = "1.2.1", default-features = false }
cfg-if = { version = "1.0.0", optional = true }
derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display"] }
displaydoc = { version = "0.2", default-features = false }
ibc-proto = { version = "0.41.0", default-features = false }
ibc-types-domain-type = { version = "0.12.0", path = "../ibc-types-domain-type", default-features = false }
ibc-types-identifier = { version = "0.12.0", path = "../ibc-types-identifier", default-features = false }
ibc-types-timestamp = { version = "0.12.0", path = "../ibc-types-timestamp", default-features = false }
ibc-proto = { version = "0.42.0", default-features = false }
ibc-types-domain-type = { version = "0.13.0", path = "../ibc-types-domain-type", default-features = false }
ibc-types-identifier = { version = "0.13.0", path = "../ibc-types-identifier", default-features = false }
ibc-types-timestamp = { version = "0.13.0", path = "../ibc-types-timestamp", default-features = false }
ics23 = { version = "0.11.0", default-features = false, features = ["host-functions"] }
num-traits = { version = "0.2.15", default-features = false }
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["full"], optional = true }
Expand Down
4 changes: 4 additions & 0 deletions crates/ibc-types-core-client/src/mock/client_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ pub fn client_type() -> ClientType {
pub struct MockClientState {
pub header: MockHeader,
pub frozen_height: Option<Height>,
pub trusting_period: Duration,
}

impl MockClientState {
pub fn new(header: MockHeader) -> Self {
Self {
header,
frozen_height: None,
trusting_period: Duration::from_secs(64000),
}
}

Expand Down Expand Up @@ -71,6 +73,8 @@ impl From<MockClientState> for RawMockClientState {
height: Some(value.header.height().into()),
timestamp: value.header.timestamp.nanoseconds(),
}),
trusting_period: value.trusting_period.as_secs(),
frozen: value.frozen_height.is_some(),
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions crates/ibc-types-core-commitment/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ibc-types-core-commitment"
version = "0.12.0"
version = "0.13.0"
edition = "2021"
license = "Apache-2.0"
readme = "../../README.md"
Expand Down Expand Up @@ -55,11 +55,11 @@ mocks = ["tendermint-testgen", "tendermint/clock", "cfg-if", "parking_lot"]
mocks-no-std = ["cfg-if"]

[dependencies]
ibc-types-timestamp = { version = "0.12.0", path = "../ibc-types-timestamp", default-features = false }
ibc-types-identifier = { version = "0.12.0", path = "../ibc-types-identifier", default-features = false }
ibc-types-domain-type = { version = "0.12.0", path = "../ibc-types-domain-type", default-features = false }
ibc-types-timestamp = { version = "0.13.0", path = "../ibc-types-timestamp", default-features = false }
ibc-types-identifier = { version = "0.13.0", path = "../ibc-types-identifier", default-features = false }
ibc-types-domain-type = { version = "0.13.0", path = "../ibc-types-domain-type", default-features = false }
# Proto definitions for all IBC-related interfaces, e.g., connections or channels.
ibc-proto = { version = "0.41.0", default-features = false }
ibc-proto = { version = "0.42.0", default-features = false }
ics23 = { version = "0.11.0", default-features = false, features = ["host-functions"] }
time = { version = "0.3", default-features = false }
serde_derive = { version = "1.0.104", default-features = false, optional = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/ibc-types-core-commitment/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ impl MerkleProof {
// verify the absence of key in lowest subtree
let proof = self
.proofs
.get(0)
.first()
.ok_or(anyhow::anyhow!("invalid merkle proof"))?;
let spec = ics23_specs
.get(0)
.first()
.ok_or(anyhow::anyhow!("invalid merkle proof"))?;
// keys are represented from root-to-leaf
let key = keys
Expand Down
16 changes: 8 additions & 8 deletions crates/ibc-types-core-connection/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ibc-types-core-connection"
version = "0.12.0"
version = "0.13.0"
edition = "2021"
license = "Apache-2.0"
readme = "../../README.md"
Expand Down Expand Up @@ -51,17 +51,17 @@ mocks = ["tendermint-testgen", "tendermint/clock", "cfg-if", "parking_lot"]
mocks-no-std = ["cfg-if"]

[dependencies]
ibc-types-timestamp = { version = "0.12.0", path = "../ibc-types-timestamp", default-features = false }
ibc-types-core-commitment = { version = "0.12.0", path = "../ibc-types-core-commitment", default-features = false }
ibc-types-identifier = { version = "0.12.0", path = "../ibc-types-identifier", default-features = false }
ibc-types-domain-type = { version = "0.12.0", path = "../ibc-types-domain-type", default-features = false }
ibc-types-core-client = { version = "0.12.0", path = "../ibc-types-core-client", default-features = false }
ibc-types-timestamp = { version = "0.13.0", path = "../ibc-types-timestamp", default-features = false }
ibc-types-core-commitment = { version = "0.13.0", path = "../ibc-types-core-commitment", default-features = false }
ibc-types-identifier = { version = "0.13.0", path = "../ibc-types-identifier", default-features = false }
ibc-types-domain-type = { version = "0.13.0", path = "../ibc-types-domain-type", default-features = false }
ibc-types-core-client = { version = "0.13.0", path = "../ibc-types-core-client", default-features = false }
borsh = {version = "0.10.0", default-features = false, optional = true }
bytes = { version = "1.2.1", default-features = false }
cfg-if = { version = "1.0.0", optional = true }
derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display"] }
displaydoc = { version = "0.2", default-features = false }
ibc-proto = { version = "0.41.0", default-features = false }
ibc-proto = { version = "0.42.0", default-features = false }
ics23 = { version = "0.11.0", default-features = false, features = ["host-functions"] }
num-traits = { version = "0.2.15", default-features = false }
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["full"], optional = true }
Expand Down Expand Up @@ -95,5 +95,5 @@ env_logger = "0.10.0"
tracing-subscriber = { version = "0.3.14", features = ["fmt", "env-filter", "json"]}
test-log = { version = "0.2.10", features = ["trace"] }
cfg-if = { version = "1.0.0" }
ibc-types-core-client = { version = "0.12.0", path = "../ibc-types-core-client", features = ["mocks"] }
ibc-types-core-client = { version = "0.13.0", path = "../ibc-types-core-client", features = ["mocks"] }
tracing = { version = "0.1.36", default-features = false }
2 changes: 1 addition & 1 deletion crates/ibc-types-domain-type/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ibc-types-domain-type"
version = "0.12.0"
version = "0.13.0"
edition = "2021"
license = "Apache-2.0"
publish = true
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc-types-identifier/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ibc-types-identifier"
version = "0.12.0"
version = "0.13.0"
edition = "2021"
license = "Apache-2.0"
readme = "../../README.md"
Expand Down
Loading

0 comments on commit 1cb04a7

Please sign in to comment.