diff --git a/cosmwasm/union-ibc/core/src/contract.rs b/cosmwasm/union-ibc/core/src/contract.rs index 88e04bb912..b5cd7f08f7 100644 --- a/cosmwasm/union-ibc/core/src/contract.rs +++ b/cosmwasm/union-ibc/core/src/contract.rs @@ -44,9 +44,9 @@ type ContractResult = Result; pub mod events { pub mod client { - pub const REGISTER: &str = "client_register"; - pub const CREATE: &str = "client_create"; - pub const UPDATE: &str = "client_update"; + pub const REGISTER: &str = "register_client"; + pub const CREATE: &str = "create_client"; + pub const UPDATE: &str = "update_client"; } pub mod connection { pub const OPEN_INIT: &str = "connection_open_init"; @@ -76,7 +76,7 @@ pub mod events { pub const CONNECTION_ID: &str = "connection_id"; pub const CHANNEL_ID: &str = "channel_id"; pub const COUNTERPARTY_CHANNEL_ID: &str = "counterparty_channel_id"; - pub const HEIGHT: &str = "height"; + pub const COUNTERPARTY_HEIGHT: &str = "counterparty_height"; pub const PACKET: &str = "packet"; pub const PACKETS: &str = "packets"; pub const ACKS: &str = "acks"; @@ -771,7 +771,10 @@ fn update_client( Ok( Response::new().add_event(Event::new(events::client::UPDATE).add_attributes([ (events::attribute::CLIENT_ID, client_id.to_string()), - (events::attribute::HEIGHT, update.height.to_string()), + ( + events::attribute::COUNTERPARTY_HEIGHT, + update.height.to_string(), + ), ])), ) } diff --git a/evm/evm.nix b/evm/evm.nix index b8f9460193..5153705739 100644 --- a/evm/evm.nix +++ b/evm/evm.nix @@ -213,7 +213,8 @@ _: { } { network = "holesky"; - rpc-url = "https://holesky.drpc.org"; + # rpc-url = "https://holesky.drpc.org"; + rpc-url = "https://eth-holesky.g.alchemy.com/v2/MS7UF39itji9IWEiJBISExWgEGtEGbs7"; private-key = ''"$1"''; extra-args = ''--verify --verifier etherscan --etherscan-api-key "$2"''; } diff --git a/voyager/plugins/event-source/cosmos-sdk/src/ibc_events.rs b/voyager/plugins/event-source/cosmos-sdk/src/ibc_events.rs index d663e9940f..8d29eb67f6 100644 --- a/voyager/plugins/event-source/cosmos-sdk/src/ibc_events.rs +++ b/voyager/plugins/event-source/cosmos-sdk/src/ibc_events.rs @@ -266,7 +266,7 @@ event! { // events for the union IBC specification, emitted by the cosmwasm contract implementation. - #[event(tag = "wasm-client_create")] + #[event(tag = "wasm-create_client")] UnionCreateClient { #[parse(u32::from_str)] client_id: u32, @@ -276,12 +276,12 @@ event! { // height: u64, }, - #[event(tag = "wasm-client_update")] + #[event(tag = "wasm-update_client")] UnionUpdateClient { #[parse(u32::from_str)] client_id: u32, #[parse(u64::from_str)] - height: u64, + counterparty_height: u64, }, #[event(tag = "wasm-connection_open_init")] diff --git a/voyager/plugins/event-source/cosmos-sdk/src/main.rs b/voyager/plugins/event-source/cosmos-sdk/src/main.rs index 987f18925e..878ea5ed4f 100644 --- a/voyager/plugins/event-source/cosmos-sdk/src/main.rs +++ b/voyager/plugins/event-source/cosmos-sdk/src/main.rs @@ -1091,7 +1091,7 @@ impl PluginServer for Module { ibc_union_spec::UpdateClient { client_id: update_client.client_id, client_type: client_info.client_type, - height: update_client.height, + height: update_client.counterparty_height, } .into(), ), diff --git a/voyager/plugins/transaction/ethereum/src/main.rs b/voyager/plugins/transaction/ethereum/src/main.rs index 19f677d236..bccb8ba7dd 100644 --- a/voyager/plugins/transaction/ethereum/src/main.rs +++ b/voyager/plugins/transaction/ethereum/src/main.rs @@ -182,6 +182,8 @@ impl Module { pub enum TxSubmitError { #[error(transparent)] Error(#[from] Error), + #[error("error estimating gas")] + Estimate(#[source] Error), #[error("error waiting for transaction")] PendingTransactionError(#[from] PendingTransactionError), #[error("out of gas")] @@ -382,7 +384,19 @@ impl Module { info!("submitting evm tx"); - match call.send().await { + let gas_estimate = call.estimate_gas().await.map_err(TxSubmitError::Estimate)?; + // .map_err(|e| { + // ErrorObject::owned( + // -1, + // format!("error estimating gas: {}", ErrorReporter(e), None::<()>), + // ) + // })?; + + let gas_to_use = gas_estimate + (gas_estimate / 2); + + info!(gas_estimate, gas_to_use, "gas estimatation successful"); + + match call.gas(gas_to_use).send().await { Ok(ok) => { let tx_hash = ::from(*ok.tx_hash()); async move {