diff --git a/Cargo.lock b/Cargo.lock index 73f7e41440..4959404ac6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4001,8 +4001,8 @@ checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" [[package]] name = "namada_account" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "borsh 1.5.0", "linkme", @@ -4015,8 +4015,8 @@ dependencies = [ [[package]] name = "namada_controller" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "namada_core", "smooth-operator", @@ -4025,8 +4025,8 @@ dependencies = [ [[package]] name = "namada_core" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "bech32 0.8.1", "borsh 1.5.0", @@ -4073,8 +4073,8 @@ dependencies = [ [[package]] name = "namada_ethereum_bridge" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "borsh 1.5.0", "ethers", @@ -4100,8 +4100,8 @@ dependencies = [ [[package]] name = "namada_events" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "borsh 1.5.0", "linkme", @@ -4116,8 +4116,8 @@ dependencies = [ [[package]] name = "namada_gas" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "borsh 1.5.0", "linkme", @@ -4131,8 +4131,8 @@ dependencies = [ [[package]] name = "namada_governance" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "borsh 1.5.0", "itertools 0.12.1", @@ -4154,8 +4154,8 @@ dependencies = [ [[package]] name = "namada_ibc" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "borsh 1.5.0", "data-encoding", @@ -4184,8 +4184,8 @@ dependencies = [ [[package]] name = "namada_macros" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "data-encoding", "proc-macro2", @@ -4196,8 +4196,8 @@ dependencies = [ [[package]] name = "namada_merkle_tree" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "borsh 1.5.0", "eyre", @@ -4211,8 +4211,8 @@ dependencies = [ [[package]] name = "namada_migrations" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "lazy_static", "linkme", @@ -4221,8 +4221,8 @@ dependencies = [ [[package]] name = "namada_parameters" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "namada_core", "namada_macros", @@ -4233,8 +4233,8 @@ dependencies = [ [[package]] name = "namada_proof_of_stake" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "borsh 1.5.0", "konst", @@ -4258,16 +4258,16 @@ dependencies = [ [[package]] name = "namada_replay_protection" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "namada_core", ] [[package]] name = "namada_sdk" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "async-trait", "bimap", @@ -4333,8 +4333,8 @@ dependencies = [ [[package]] name = "namada_shielded_token" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "borsh 1.5.0", "lazy_static", @@ -4354,8 +4354,8 @@ dependencies = [ [[package]] name = "namada_state" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "borsh 1.5.0", "itertools 0.12.1", @@ -4378,8 +4378,8 @@ dependencies = [ [[package]] name = "namada_storage" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "borsh 1.5.0", "itertools 0.12.1", @@ -4398,8 +4398,8 @@ dependencies = [ [[package]] name = "namada_token" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "borsh 1.5.0", "namada_core", @@ -4413,8 +4413,8 @@ dependencies = [ [[package]] name = "namada_trans_token" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "konst", "namada_core", @@ -4424,8 +4424,8 @@ dependencies = [ [[package]] name = "namada_tx" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "ark-bls12-381", "bitflags 2.5.0", @@ -4454,8 +4454,8 @@ dependencies = [ [[package]] name = "namada_vote_ext" -version = "0.39.0" -source = "git+https://github.com/anoma/namada?rev=59332a22943e47c74cfcec4a2d08281822ba75f9#59332a22943e47c74cfcec4a2d08281822ba75f9" +version = "0.40.0" +source = "git+https://github.com/anoma/namada?rev=4f0b027da53c10e600e61c54a6900b4fba485726#4f0b027da53c10e600e61c54a6900b4fba485726" dependencies = [ "borsh 1.5.0", "linkme", diff --git a/Cargo.toml b/Cargo.toml index 28477e9639..8427184cd9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,10 +39,10 @@ tendermint-rpc = { version = "=0.36.0" } tendermint-testgen = { version = "=0.36.0" } # Namada dependencies -namada_ibc = { git = "https://github.com/anoma/namada", rev = "59332a22943e47c74cfcec4a2d08281822ba75f9" } -namada_parameters = { git = "https://github.com/anoma/namada", rev = "59332a22943e47c74cfcec4a2d08281822ba75f9" } -namada_sdk = { git = "https://github.com/anoma/namada", rev = "59332a22943e47c74cfcec4a2d08281822ba75f9" } -namada_token = { git = "https://github.com/anoma/namada", rev = "59332a22943e47c74cfcec4a2d08281822ba75f9" } +namada_ibc = { git = "https://github.com/anoma/namada", rev = "4f0b027da53c10e600e61c54a6900b4fba485726" } +namada_parameters = { git = "https://github.com/anoma/namada", rev = "4f0b027da53c10e600e61c54a6900b4fba485726" } +namada_sdk = { git = "https://github.com/anoma/namada", rev = "4f0b027da53c10e600e61c54a6900b4fba485726" } +namada_token = { git = "https://github.com/anoma/namada", rev = "4f0b027da53c10e600e61c54a6900b4fba485726" } # Other dependencies abscissa_core = "=0.6.0" diff --git a/crates/relayer/src/chain/namada/error.rs b/crates/relayer/src/chain/namada/error.rs index 252599309f..7296ddfcab 100644 --- a/crates/relayer/src/chain/namada/error.rs +++ b/crates/relayer/src/chain/namada/error.rs @@ -23,8 +23,8 @@ define_error! { |_| { "borsh decoding failed" }, DryRun - { tx_results: namada_sdk::tx::data::BatchResults } - |e| { format!("Dry run to simulate a transaction failed: {:?}", e.tx_results) }, + { tx_result: namada_sdk::tx::data::TxResult } + |e| { format!("Dry run to simulate a transaction failed: {:?}", e.tx_result) }, } } diff --git a/crates/relayer/src/chain/namada/query.rs b/crates/relayer/src/chain/namada/query.rs index b5760a51f8..893a0b6685 100644 --- a/crates/relayer/src/chain/namada/query.rs +++ b/crates/relayer/src/chain/namada/query.rs @@ -136,7 +136,7 @@ impl NamadaChain { height, )]); } - let events = tx_result.batch_results.iter().filter_map(|(_, r)| { + let events = tx_result.iter().filter_map(|(_, r)| { r.as_ref().map(|batched_tx_result| { // Get IBC events when the transaction was accepted if batched_tx_result.is_accepted() { diff --git a/crates/relayer/src/chain/namada/tx.rs b/crates/relayer/src/chain/namada/tx.rs index 7de5c43f6a..c123cfa1e9 100644 --- a/crates/relayer/src/chain/namada/tx.rs +++ b/crates/relayer/src/chain/namada/tx.rs @@ -6,11 +6,9 @@ use std::time::Instant; use ibc_proto::google::protobuf::Any; use itertools::Itertools; -use namada_parameters::storage as param_storage; use namada_sdk::address::{Address, ImplicitAddress}; use namada_sdk::args::TxBuilder; use namada_sdk::args::{Tx as TxArgs, TxCustom}; -use namada_sdk::borsh::BorshDeserialize; use namada_sdk::chain::ChainId; use namada_sdk::tx::{prepare_tx, ProcessTxResponse}; use namada_sdk::{signing, tx, Namada}; @@ -22,7 +20,6 @@ use crate::chain::cosmos::types::gas::max_gas_from_config; use crate::chain::cosmos::types::tx::{TxStatus, TxSyncResult}; use crate::chain::cosmos::wait::all_tx_results_found; use crate::chain::endpoint::ChainEndpoint; -use crate::chain::requests::{IncludeProof, QueryHeight}; use crate::error::{Error, ErrorDetail}; use super::error::{Error as NamadaError, ErrorDetail as NamadaErrorDetail}; @@ -170,10 +167,6 @@ impl NamadaChain { let max_gas = max_gas_from_config(self.config()); let gas_price = self.config().gas_price.price; - let gas_scale_key = param_storage::get_gas_scale_key(); - let (value, _) = self.query(gas_scale_key, QueryHeight::Latest, IncludeProof::No)?; - let gas_scale = u64::try_from_slice(&value[..]).map_err(NamadaError::borsh_decode)?; - let args = args.clone().dry_run_wrapper(true); // Set the max gas to the gas limit for the simulation self.prepare_tx_with_gas(&mut tx, &args, &fee_token, max_gas, gas_price)?; @@ -201,14 +194,14 @@ impl NamadaChain { let estimated_gas = match response { ProcessTxResponse::DryRun(result) => { if result - .batch_results + .0 .iter() .all(|(_, r)| matches!(&r, Ok(result) if result.is_accepted())) { - result.gas_used.get_whole_gas_units(gas_scale) + result.1.into() } else { // All or some of requests will fail - return Err(NamadaError::dry_run(result.batch_results).into()); + return Err(NamadaError::dry_run(result.0).into()); } } _ => unreachable!("Unexpected response"), diff --git a/e2e/namada-gaia-simple-transfers b/e2e/namada-gaia-simple-transfers index 95b2b447ed..c15ff7e5f8 100755 --- a/e2e/namada-gaia-simple-transfers +++ b/e2e/namada-gaia-simple-transfers @@ -157,6 +157,7 @@ ${NAMADAC} --base-dir ${base_dir} ibc-transfer \ --amount 50 \ --signing-keys relayer \ --channel-id channel-0 \ + --gas-limit 150000 \ --node ${NAMADA_LEDGER_ADDR} # packet-recv @@ -207,6 +208,7 @@ ${NAMADAC} --base-dir ${base_dir} ibc-transfer \ --amount 200 \ --signing-keys relayer \ --channel-id channel-0 \ + --gas-limit 150000 \ --node ${NAMADA_LEDGER_ADDR} # wait for relaying @@ -324,6 +326,7 @@ ${NAMADAC} --base-dir ${base_dir} ibc-transfer \ --amount 5 \ --signing-keys relayer \ --channel-id channel-0 \ + --gas-limit 150000 \ --node ${NAMADA_LEDGER_ADDR} # wait for relaying diff --git a/e2e/namada-simple-transfers b/e2e/namada-simple-transfers index 84e8964367..3997d0d871 100755 --- a/e2e/namada-simple-transfers +++ b/e2e/namada-simple-transfers @@ -150,6 +150,7 @@ ${NAMADAC} --base-dir ${base_dir_a} ibc-transfer \ --amount 100 \ --signing-keys relayer \ --channel-id channel-0 \ + --gas-limit 150000 \ --node ${LEDGER_ADDR_A} # packet-recv @@ -198,6 +199,7 @@ ${NAMADAC} --base-dir ${base_dir_b} ibc-transfer \ --amount 50000000 \ --signing-keys relayer \ --channel-id channel-0 \ + --gas-limit 150000 \ --node ${LEDGER_ADDR_B} # packet-recv @@ -250,6 +252,7 @@ ${NAMADAC} --base-dir ${base_dir_a} ibc-transfer \ --amount 200 \ --signing-keys relayer \ --channel-id channel-0 \ + --gas-limit 150000 \ --node ${LEDGER_ADDR_A} echo "~~ Transfer 300 apfel from chain B to chain A ~~" @@ -260,6 +263,7 @@ ${NAMADAC} --base-dir ${base_dir_b} ibc-transfer \ --amount 300 \ --signing-keys relayer \ --channel-id channel-0 \ + --gas-limit 150000 \ --node ${LEDGER_ADDR_B} wait_for_relaying ${chain_a} @@ -329,6 +333,7 @@ ${NAMADAC} --base-dir ${base_dir_a} ibc-transfer \ --channel-id channel-0 \ --memo-path ${memo_path} \ --gas-payer relayer \ + --gas-limit 150000 \ --node ${LEDGER_ADDR_A} wait_for_relaying ${chain_a} @@ -419,6 +424,7 @@ ${NAMADAC} --base-dir ${base_dir_b} ibc-transfer \ --signing-keys relayer \ --channel-id channel-0 \ --memo-path ${memo_path} \ + --gas-limit 150000 \ --node ${LEDGER_ADDR_B} wait_for_relaying ${chain_a} diff --git a/e2e/namada-stargaze-transfer b/e2e/namada-stargaze-transfer index ce96af7b3d..380ce2ae54 100755 --- a/e2e/namada-stargaze-transfer +++ b/e2e/namada-stargaze-transfer @@ -113,6 +113,7 @@ ${NAMADAC} --base-dir ${NAMADA_BASE} ibc-transfer \ --signing-keys relayer \ --channel-id ${namada_channel} \ --port-id nft-transfer \ + --gas-limit 150000 \ --node ${NAMADA_LEDGER_ADDR} sleep 5 @@ -220,6 +221,7 @@ ${NAMADAC} --base-dir ${NAMADA_BASE} ibc-transfer \ --signing-keys relayer \ --channel-id ${namada_channel} \ --port-id nft-transfer \ + --gas-limit 150000 \ --node ${NAMADA_LEDGER_ADDR} sleep 5