Skip to content

Commit

Permalink
Update Gaia version running in CI to v18 (#4113)
Browse files Browse the repository at this point in the history
* Update Nix flake and add Gaia v18

* Add new Cosmos chain type which enables dynamic fees during bootstrap

* Update Gaia version running in CI to v18

* Use dynamic fee for misbehaviour test scripts

* Fix chain CLIs which require fees

* Add changelog entry

* Increase gas_multiplier for misbehaviour test config

* Fix fees for Provenance chain

* Improve logs related to failed simulated gas
  • Loading branch information
ljoss17 authored Aug 6, 2024
1 parent e837cec commit bd75055
Show file tree
Hide file tree
Showing 25 changed files with 188 additions and 52 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Update the version of Gaia running the integration tests in the CI from `v17.2.1`
to `v18.1.0`([\#4114](https://github.com/informalsystems/hermes/issues/4114))
10 changes: 5 additions & 5 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
fail-fast: false
matrix:
chain:
- package: gaia17
- package: gaia18
command: gaiad
account_prefix: cosmos
native_token: stake
Expand Down Expand Up @@ -171,10 +171,10 @@ jobs:
fail-fast: false
matrix:
chain:
- package: .#gaia17 .#stride
- package: .#gaia18 .#stride
command: gaiad,strided
account_prefix: cosmos,stride
- package: .#gaia17 .#neutron
- package: .#gaia18 .#neutron
command: gaiad,neutrond
account_prefix: cosmos,neutron
steps:
Expand Down Expand Up @@ -216,7 +216,7 @@ jobs:
fail-fast: false
matrix:
chain:
- package: .#gaia17 .#stride-no-admin
- package: .#gaia18 .#stride-no-admin
command: gaiad,strided
account_prefix: cosmos,stride
steps:
Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:
fail-fast: false
matrix:
chain:
- package: .#celestia .#gaia17
- package: .#celestia .#gaia18
command: celestia-appd,gaiad
account_prefix: celestia,cosmos
native_token: utia,stake
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/misbehaviour.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
fail-fast: false
matrix:
chain:
- package: gaia17
- package: gaia18
command: gaiad
account_prefix: cosmos
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/multi-chains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
fail-fast: false
matrix:
first-package:
- package: gaia17
- package: gaia18
command: gaiad
account_prefix: cosmos
- package: ibc-go-v7-simapp
Expand Down
14 changes: 14 additions & 0 deletions ci/misbehaviour/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,19 @@ gas_price = { price = 0.001, denom = 'stake' }
# Minimum value: 1.0
gas_multiplier = 1.3

# Query the current gas price from the chain instead of using the static `gas_price` from the config.
# Useful for chains which have [EIP-1559][eip]-like dynamic gas price.
#
# At the moment, only chains which support the `osmosis.txfees.v1beta1.Query/GetEipBaseFee`
# query or have enabled Skip's `x/feemarket` module https://github.com/skip-mev/feemarket
# can be used with dynamic gas price enabled.
#
# See this page in the Hermes guide for more information:
# https://hermes.informal.systems/documentation/configuration/dynamic-gas-fees.html
#
# Default: { enabled = false, multiplier = 1.1, max = 0.6 }
dynamic_gas_price = { enabled = true, multiplier = 1.3, max = 5.0 }

# Specify how many IBC messages at most to include in a single transaction.
# Default: 30
max_msg_num = 30
Expand Down Expand Up @@ -314,6 +327,7 @@ default_gas = 100000
max_gas = 400000
gas_price = { price = 0.001, denom = 'stake' }
gas_multiplier = 1.3
dynamic_gas_price = { enabled = true, multiplier = 1.3, max = 5.0 }
max_msg_num = 30
max_tx_size = 2097152
clock_drift = '5s'
Expand Down
18 changes: 16 additions & 2 deletions ci/misbehaviour/config_fork.toml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,20 @@ gas_price = { price = 0.001, denom = 'stake' }
#
# Default: 1.1, ie. the gas is increased by 10%
# Minimum value: 1.0
gas_multiplier = 1.1
gas_multiplier = 1.3

# Query the current gas price from the chain instead of using the static `gas_price` from the config.
# Useful for chains which have [EIP-1559][eip]-like dynamic gas price.
#
# At the moment, only chains which support the `osmosis.txfees.v1beta1.Query/GetEipBaseFee`
# query or have enabled Skip's `x/feemarket` module https://github.com/skip-mev/feemarket
# can be used with dynamic gas price enabled.
#
# See this page in the Hermes guide for more information:
# https://hermes.informal.systems/documentation/configuration/dynamic-gas-fees.html
#
# Default: { enabled = false, multiplier = 1.1, max = 0.6 }
dynamic_gas_price = { enabled = true, multiplier = 1.3, max = 5.0 }

# Specify how many IBC messages at most to include in a single transaction.
# Default: 30
Expand Down Expand Up @@ -312,7 +325,8 @@ store_prefix = 'ibc'
default_gas = 100000
max_gas = 400000
gas_price = { price = 0.001, denom = 'stake' }
gas_multiplier = 1.1
gas_multiplier = 1.3
dynamic_gas_price = { enabled = true, multiplier = 1.3, max = 5.0 }
max_msg_num = 30
max_tx_size = 2097152
clock_drift = '5s'
Expand Down
2 changes: 1 addition & 1 deletion crates/relayer/src/sdk_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ define_error! {

OutOfGasSimulated
{ code: u32, amount: u64 }
|e| { format_args!("the issue might have been caused by the configured max gas which binds the gas used. Please check the Hermes config.toml and increase the configured `max_gas`. Curerent value is `{}`", e.amount) },
|e| { format_args!("the issue might have been caused by a misconfiguration of Hermes. Please check the Hermes config.toml and increase either the `max_gas` or `gas_multiplier` settings. Simulated gas was: {}", e.amount) },

InsufficientFee
{ code: u32 }
Expand Down
30 changes: 24 additions & 6 deletions flake.lock

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

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
cometbft
evmos
gaia6-ordered
gaia17
gaia18
ibc-go-v2-simapp
ibc-go-v3-simapp
ibc-go-v4-simapp
Expand Down
2 changes: 1 addition & 1 deletion tools/integration-test/src/mbt/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl BinaryChannelTest for IbcTransferMBT {
*target,
*denom,
*amount,
&fee_denom_a.with_amount(1200u64).as_ref(),
&fee_denom_a.with_amount(381000000u64).as_ref(),
)?;
info!("[LocalTransfer] Done");
}
Expand Down
4 changes: 2 additions & 2 deletions tools/integration-test/src/tests/channel_upgrade/ica.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ impl BinaryConnectionTest for ChannelUpgradeICACloseChannel {
&chains.node_b.wallets().user1(),
&ica_address.as_ref(),
&stake_denom.with_amount(ica_fund).as_ref(),
&fee_denom_host.with_amount(1200u64).as_ref(),
&fee_denom_host.with_amount(381000000u64).as_ref(),
)?;

chains.node_b.chain_driver().assert_eventual_wallet_amount(
Expand Down Expand Up @@ -382,7 +382,7 @@ impl BinaryConnectionTest for ChannelUpgradeICAUnordered {
&chains.node_b.wallets().user1(),
&ica_address.as_ref(),
&stake_denom.with_amount(ica_fund).as_ref(),
&fee_denom_host.with_amount(1200u64).as_ref(),
&fee_denom_host.with_amount(381000000u64).as_ref(),
)?;

chains.node_b.chain_driver().assert_eventual_wallet_amount(
Expand Down
2 changes: 1 addition & 1 deletion tools/integration-test/src/tests/clear_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl BinaryChannelTest for ClearPacketRecoveryTest {
&relayer_wallet_b.as_ref(),
&wallet_b.address(),
&denom_b1.with_amount(100u64).as_ref(),
&fee_denom_b.with_amount(1200u64).as_ref(),
&fee_denom_b.with_amount(381000000u64).as_ref(),
)?;

let amount1 = random_u128_range(1000, 5000);
Expand Down
4 changes: 2 additions & 2 deletions tools/integration-test/src/tests/ica.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl BinaryConnectionTest for IcaFilterTestAllow {
&chains.node_b.wallets().user1(),
&ica_address.as_ref(),
&stake_denom.with_amount(ica_fund).as_ref(),
&fee_denom_host.with_amount(1200u64).as_ref(),
&fee_denom_host.with_amount(381000000u64).as_ref(),
)?;

chains.node_b.chain_driver().assert_eventual_wallet_amount(
Expand Down Expand Up @@ -299,7 +299,7 @@ impl BinaryConnectionTest for ICACloseChannelTest {
&chains.node_b.wallets().user1(),
&ica_address.as_ref(),
&stake_denom.with_amount(ica_fund).as_ref(),
&fee_denom_host.with_amount(1200u64).as_ref(),
&fee_denom_host.with_amount(381000000u64).as_ref(),
)?;

chains.node_b.chain_driver().assert_eventual_wallet_amount(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl BinaryChannelTest for IcaOrderedChannelTest {
&chains.node_a.wallets().user1(),
&ica_address.as_ref(),
&stake_denom.with_amount(ica_fund).as_ref(),
&fee_denom_a.with_amount(1200u64).as_ref(),
&fee_denom_a.with_amount(381000000u64).as_ref(),
)?;

chains.node_a.chain_driver().assert_eventual_wallet_amount(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl BinaryChannelTest for InterchainSecurityIcaTransferTest {
&chains.node_a.wallets().user1(),
&ica_address.as_ref(),
&stake_denom.with_amount(ica_fund).as_ref(),
&fee_denom_a.with_amount(1200u64).as_ref(),
&fee_denom_a.with_amount(381000000u64).as_ref(),
)?;

chains.node_a.chain_driver().assert_eventual_wallet_amount(
Expand Down
6 changes: 3 additions & 3 deletions tools/integration-test/src/tests/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use ibc_test_framework::relayer::connection::{
};

#[test]
fn test_supervisor() -> Result<(), Error> {
fn test_supervisor1() -> Result<(), Error> {
run_binary_chain_test(&SupervisorTest)
}

Expand Down Expand Up @@ -116,14 +116,14 @@ impl BinaryChainTest for SupervisorTest {
&chains.node_a.wallets().relayer(),
&chains.node_a.wallets().user2().address(),
&denom_a.with_amount(1000u64).as_ref(),
&fee_denom_a.with_amount(1200u64).as_ref(),
&fee_denom_a.with_amount(381000000u64).as_ref(),
)?;

chains.node_b.chain_driver().local_transfer_token(
&chains.node_b.wallets().relayer(),
&chains.node_b.wallets().user2().address(),
&chains.node_b.denom().with_amount(1000u64).as_ref(),
&fee_denom_b.with_amount(1200u64).as_ref(),
&fee_denom_b.with_amount(381000000u64).as_ref(),
)?;

info!(
Expand Down
21 changes: 14 additions & 7 deletions tools/test-framework/src/chain/chain_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const PROVENANCE_HD_PATH: &str = "m/44'/505'/0'/0/0";

#[derive(Clone, Debug)]
pub enum ChainType {
Cosmos,
Cosmos { dynamic_fee: bool },
Osmosis,
Evmos,
Provenance,
Expand All @@ -21,15 +21,15 @@ pub enum ChainType {
impl ChainType {
pub fn hd_path(&self) -> &str {
match self {
Self::Cosmos | Self::Osmosis => COSMOS_HD_PATH,
Self::Cosmos { dynamic_fee: _ } | Self::Osmosis => COSMOS_HD_PATH,
Self::Evmos | Self::Injective => EVMOS_HD_PATH,
Self::Provenance => PROVENANCE_HD_PATH,
}
}

pub fn chain_id(&self, prefix: &str, use_random_id: bool) -> ChainId {
match self {
Self::Cosmos => {
Self::Cosmos { dynamic_fee: _ } => {
if use_random_id {
ChainId::from_string(&format!("ibc-{}-{:x}", prefix, random_u32()))
} else {
Expand All @@ -54,7 +54,7 @@ impl ChainType {
let mut res = vec![];
let json_rpc_port = random_unused_tcp_port();
match self {
Self::Cosmos | Self::Injective | Self::Provenance => {}
Self::Cosmos { dynamic_fee: _ } | Self::Injective | Self::Provenance => {}
Self::Osmosis => {
res.push("--reject-config-defaults".to_owned());
}
Expand All @@ -70,7 +70,7 @@ impl ChainType {
pub fn extra_add_genesis_account_args(&self, chain_id: &ChainId) -> Vec<String> {
let mut res = vec![];
match self {
Self::Cosmos | Self::Osmosis | Self::Evmos | Self::Provenance => {}
Self::Cosmos { dynamic_fee: _ } | Self::Osmosis | Self::Evmos | Self::Provenance => {}
Self::Injective => {
res.push("--chain-id".to_owned());
res.push(format!("{chain_id}"));
Expand All @@ -81,7 +81,9 @@ impl ChainType {

pub fn address_type(&self) -> AddressType {
match self {
Self::Cosmos | Self::Osmosis | Self::Provenance => AddressType::default(),
Self::Cosmos { dynamic_fee: _ } | Self::Osmosis | Self::Provenance => {
AddressType::default()
}
Self::Evmos => AddressType::Ethermint {
pk_type: "/ethermint.crypto.v1.ethsecp256k1.PubKey".to_string(),
},
Expand All @@ -90,18 +92,23 @@ impl ChainType {
},
}
}

pub fn enable_dynamic_fee(&self) -> bool {
matches!(self, Self::Cosmos { dynamic_fee } if *dynamic_fee)
}
}

impl FromStr for ChainType {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
name if name.contains("gaiad") => Ok(ChainType::Cosmos { dynamic_fee: true }),
name if name.contains("evmosd") => Ok(ChainType::Evmos),
name if name.contains("injectived") => Ok(ChainType::Injective),
name if name.contains("provenanced") => Ok(ChainType::Provenance),
name if name.contains("osmosisd") => Ok(ChainType::Osmosis),
_ => Ok(ChainType::Cosmos),
_ => Ok(ChainType::Cosmos { dynamic_fee: false }),
}
}
}
Loading

0 comments on commit bd75055

Please sign in to comment.