Skip to content

Commit

Permalink
Merge pull request #3573 from anoma/yuji/ibc-client-upgrade-test
Browse files Browse the repository at this point in the history
Add IBC client upgrade test
  • Loading branch information
mergify[bot] authored Aug 14, 2024
2 parents 4cd4356 + 5136a3b commit 9fb1037
Show file tree
Hide file tree
Showing 43 changed files with 501 additions and 133 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/testing/3535-ibc-client-upgrade-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Add IBC client upgrade test
([\#3535](https://github.com/anoma/namada/issues/3535))
3 changes: 2 additions & 1 deletion .github/workflows/scripts/e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"e2e::ibc_tests::proposal_ibc_token_inflation": 1100,
"e2e::ibc_tests::ibc_rate_limit": 430,
"e2e::ibc_tests::ibc_namada_gaia": 180,
"e2e::ibc_tests::ibc_upgrade_client": 550,
"e2e::eth_bridge_tests::test_add_to_bridge_pool": 10,
"e2e::ledger_tests::double_signing_gets_slashed": 12,
"e2e::ledger_tests::ledger_many_txs_in_a_block": 55,
Expand All @@ -30,4 +31,4 @@
"e2e::wallet_tests::wallet_encrypted_key_cmds_env_var": 1,
"e2e::wallet_tests::wallet_unencrypted_key_cmds": 1,
"e2e::ledger_tests::masp_txs_and_queries": 82
}
}
2 changes: 1 addition & 1 deletion .github/workflows/scripts/hermes.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.0-namada-beta14-rc
1.10.0-namada-beta15-rc
71 changes: 37 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ flate2 = "1.0.22"
fs_extra = "1.2.0"
futures = "0.3"
git2 = { version = "0.18.1", default-features = false }
ibc = { git = "https://github.com/heliaxdev/cosmos-ibc-rs", rev = "9f2df8a03d75558b3a8571b855b6ce5cea3b5f3d", features = ["serde"] }
ibc-derive = { git = "https://github.com/heliaxdev/cosmos-ibc-rs", rev = "9f2df8a03d75558b3a8571b855b6ce5cea3b5f3d" }
ibc-testkit = { git = "https://github.com/heliaxdev/cosmos-ibc-rs", rev = "9f2df8a03d75558b3a8571b855b6ce5cea3b5f3d", default-features = false }
ibc = { git = "https://github.com/heliaxdev/cosmos-ibc-rs", rev = "1dd9be8c1cdc773e6b5b0b3609f3390a9a69eb9b", features = ["serde"] }
ibc-derive = { git = "https://github.com/heliaxdev/cosmos-ibc-rs", rev = "1dd9be8c1cdc773e6b5b0b3609f3390a9a69eb9b" }
ibc-testkit = { git = "https://github.com/heliaxdev/cosmos-ibc-rs", rev = "1dd9be8c1cdc773e6b5b0b3609f3390a9a69eb9b", default-features = false }
ics23 = "0.11.0"
index-set = { git = "https://github.com/heliaxdev/index-set", tag = "v0.8.1", features = ["serialize-borsh", "serialize-serde"] }
indexmap = { git = "https://github.com/heliaxdev/indexmap", tag = "2.2.4-heliax-1", features = ["borsh-schema", "serde"] }
Expand Down
8 changes: 6 additions & 2 deletions crates/benches/native_vps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ use namada_apps_lib::ibc::core::host::types::identifiers::{
ClientId, ConnectionId, PortId,
};
use namada_apps_lib::ibc::primitives::ToProto;
use namada_apps_lib::ibc::{IbcActions, NftTransferModule, TransferModule};
use namada_apps_lib::ibc::{
IbcActions, NftTransferModule, TransferModule, COMMITMENT_PREFIX,
};
use namada_apps_lib::masp::{
partial_deauthorize, preload_verifying_keys, PVKs, TransferSource,
TransferTarget,
Expand Down Expand Up @@ -328,7 +330,9 @@ fn prepare_ibc_tx_and_ctx(bench_name: &str) -> (BenchShieldedCtx, BatchedTx) {
counterparty: Counterparty::new(
ClientId::from_str("07-tendermint-1").unwrap(),
None,
CommitmentPrefix::try_from(b"ibc".to_vec()).unwrap(),
CommitmentPrefix::from(
COMMITMENT_PREFIX.as_bytes().to_vec(),
),
),
version: Some(Version::compatibles().first().unwrap().clone()),
delay_period: std::time::Duration::new(100, 0),
Expand Down
5 changes: 1 addition & 4 deletions crates/ibc/src/context/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ use super::common::IbcCommonContext;
use super::IbcContext;
use crate::storage;

const COMMITMENT_PREFIX: &[u8] = b"ibc";

impl<C, Params> ExtClientValidationContext for IbcContext<C, Params>
where
C: IbcCommonContext,
Expand Down Expand Up @@ -193,8 +191,7 @@ where
}

fn commitment_prefix(&self) -> CommitmentPrefix {
CommitmentPrefix::try_from(COMMITMENT_PREFIX.to_vec())
.expect("the prefix should be parsable")
CommitmentPrefix::from(crate::COMMITMENT_PREFIX.as_bytes().to_vec())
}

fn connection_counter(&self) -> Result<u64, ContextError> {
Expand Down
2 changes: 2 additions & 0 deletions crates/ibc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ pub const EVENT_TYPE_PACKET: &str = "fungible_token_packet";
pub const EVENT_TYPE_NFT_PACKET: &str = "non_fungible_token_packet";
/// The escrow address for IBC transfer
pub const IBC_ESCROW_ADDRESS: Address = address::IBC;
/// The commitment prefix for the ICS23 commitment proof
pub const COMMITMENT_PREFIX: &str = "ibc";

#[allow(missing_docs)]
#[derive(Error, Debug)]
Expand Down
Loading

0 comments on commit 9fb1037

Please sign in to comment.