diff --git a/rust/Dockerfile b/rust/Dockerfile index 3ffc062de3..f931c0fa78 100644 --- a/rust/Dockerfile +++ b/rust/Dockerfile @@ -34,7 +34,7 @@ RUN \ cp /usr/src/target/release/scraper /release ## 2: Copy the binaries to release image -FROM ubuntu:20.04 +FROM ubuntu:22.04 RUN apt-get update && \ apt-get install -y \ openssl \ diff --git a/rust/hyperlane-base/Cargo.toml b/rust/hyperlane-base/Cargo.toml index db98e22afd..3d28ab0e05 100644 --- a/rust/hyperlane-base/Cargo.toml +++ b/rust/hyperlane-base/Cargo.toml @@ -41,7 +41,7 @@ backtrace = { workspace = true, optional = true } backtrace-oneline = { path = "../utils/backtrace-oneline", optional = true } ethers-prometheus = { path = "../ethers-prometheus", features = ["serde"] } -hyperlane-core = { path = "../hyperlane-core", features = ["agent"] } +hyperlane-core = { path = "../hyperlane-core", features = ["agent", "float"] } hyperlane-ethereum = { path = "../chains/hyperlane-ethereum" } hyperlane-fuel = { path = "../chains/hyperlane-fuel" } hyperlane-sealevel = { path = "../chains/hyperlane-sealevel" } diff --git a/rust/hyperlane-core/Cargo.toml b/rust/hyperlane-core/Cargo.toml index b5bc50baf7..6489974004 100644 --- a/rust/hyperlane-core/Cargo.toml +++ b/rust/hyperlane-core/Cargo.toml @@ -45,6 +45,7 @@ tokio = { workspace = true, features = ["rt", "time"] } [features] default = [] +float = [] test-utils = ["dep:config"] agent = ["ethers", "strum"] strum = ["dep:strum"] diff --git a/rust/hyperlane-core/src/types/primitive_types.rs b/rust/hyperlane-core/src/types/primitive_types.rs index da2a842e86..58dd9bffab 100644 --- a/rust/hyperlane-core/src/types/primitive_types.rs +++ b/rust/hyperlane-core/src/types/primitive_types.rs @@ -153,6 +153,7 @@ impl_fixed_uint_conversions!(ethers_core::types::U512, U256); #[cfg(feature = "ethers")] impl_fixed_uint_conversions!(ethers_core::types::U512, U128); +#[cfg(feature = "float")] macro_rules! impl_f64_conversions { ($ty:ty) => { impl $ty { @@ -200,8 +201,11 @@ macro_rules! impl_f64_conversions { }; } +#[cfg(feature = "float")] impl_f64_conversions!(U128); +#[cfg(feature = "float")] impl_f64_conversions!(U256); +#[cfg(feature = "float")] impl_f64_conversions!(U512); #[cfg(feature = "ethers")] diff --git a/rust/hyperlane-core/src/utils.rs b/rust/hyperlane-core/src/utils.rs index 4edeffeed6..81ff5fda32 100644 --- a/rust/hyperlane-core/src/utils.rs +++ b/rust/hyperlane-core/src/utils.rs @@ -75,6 +75,7 @@ pub fn fmt_domain(domain: u32) -> String { } /// Formats the duration in the most appropriate time units. +#[cfg(feature = "float")] pub fn fmt_duration(dur: Duration) -> String { const MIN: f64 = 60.; const HOUR: f64 = MIN * 60.; @@ -97,6 +98,7 @@ pub fn fmt_duration(dur: Duration) -> String { /// Formats the duration in the most appropriate time units and says "synced" if /// the duration is 0. +#[cfg(feature = "float")] pub fn fmt_sync_time(dur: Duration) -> String { if dur.as_secs() == 0 { "synced".into() diff --git a/typescript/infra/config/environments/mainnet2/helloworld.ts b/typescript/infra/config/environments/mainnet2/helloworld.ts index b1aebaa592..b6ea232f7a 100644 --- a/typescript/infra/config/environments/mainnet2/helloworld.ts +++ b/typescript/infra/config/environments/mainnet2/helloworld.ts @@ -13,7 +13,7 @@ export const hyperlane: HelloWorldConfig = { kathy: { docker: { repo: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', - tag: '25da8e0-20231004-135818', + tag: '01dcf5d-20231010-145824', }, chainsToSkip: [], runEnv: environment, @@ -34,7 +34,7 @@ export const releaseCandidate: HelloWorldConfig = { kathy: { docker: { repo: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', - tag: '25da8e0-20231004-135818', + tag: '01dcf5d-20231010-145824', }, chainsToSkip: [], runEnv: environment, diff --git a/typescript/infra/config/environments/testnet3/helloworld.ts b/typescript/infra/config/environments/testnet3/helloworld.ts index b5b20c6e7e..bf596cedd6 100644 --- a/typescript/infra/config/environments/testnet3/helloworld.ts +++ b/typescript/infra/config/environments/testnet3/helloworld.ts @@ -13,7 +13,7 @@ export const hyperlaneHelloworld: HelloWorldConfig = { kathy: { docker: { repo: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', - tag: '25da8e0-20231004-135818', + tag: '01dcf5d-20231010-145824', }, chainsToSkip: [], runEnv: environment, @@ -33,7 +33,7 @@ export const releaseCandidateHelloworld: HelloWorldConfig = { kathy: { docker: { repo: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', - tag: '25da8e0-20231004-135818', + tag: '01dcf5d-20231010-145824', }, chainsToSkip: [], runEnv: environment, diff --git a/typescript/infra/scripts/helloworld/kathy.ts b/typescript/infra/scripts/helloworld/kathy.ts index e1db788073..85778d5d34 100644 --- a/typescript/infra/scripts/helloworld/kathy.ts +++ b/typescript/infra/scripts/helloworld/kathy.ts @@ -495,7 +495,8 @@ async function sendMessage( }); await timeout( - core.waitForMessagesProcessed(origin, destination, receipt, 5000, 36), + // Will check for up to 12 minutes + core.waitForMessagesProcessed(origin, destination, receipt, 5000, 144), messageReceiptTimeout, 'Timeout waiting for message to be received', ); diff --git a/typescript/sdk/src/core/MultiProtocolCore.test.ts b/typescript/sdk/src/core/MultiProtocolCore.test.ts index ddb2a07b13..5c21e842d7 100644 --- a/typescript/sdk/src/core/MultiProtocolCore.test.ts +++ b/typescript/sdk/src/core/MultiProtocolCore.test.ts @@ -4,13 +4,14 @@ import { ethers } from 'ethers'; import { ethereum } from '../consts/chainMetadata'; import { Chains } from '../consts/chains'; import { MultiProtocolProvider } from '../providers/MultiProtocolProvider'; +import { ProviderType } from '../providers/ProviderType'; import { MultiProtocolCore } from './MultiProtocolCore'; import { EvmCoreAdapter } from './adapters/EvmCoreAdapter'; describe('MultiProtocolCore', () => { describe('constructs', () => { - it('with constructor', async () => { + it('with constructor', () => { const multiProvider = new MultiProtocolProvider({ ethereum: { ...ethereum, @@ -27,7 +28,7 @@ describe('MultiProtocolCore', () => { const ethAdapter = core.adapter(Chains.ethereum); expect(ethAdapter).to.be.instanceOf(EvmCoreAdapter); }); - it('from environment', async () => { + it('from environment', () => { const multiProvider = new MultiProtocolProvider(); const core = MultiProtocolCore.fromEnvironment('mainnet', multiProvider); expect(core).to.be.instanceOf(MultiProtocolCore); @@ -35,4 +36,58 @@ describe('MultiProtocolCore', () => { expect(ethAdapter).to.be.instanceOf(EvmCoreAdapter); }); }); + + describe('checks delivery', () => { + it('to EVM', async () => { + const multiProvider = new MultiProtocolProvider(); + const core = MultiProtocolCore.fromEnvironment('mainnet', multiProvider); + // https://arbiscan.io//tx/0x9da03376486327fc9b1e8069538e0fef91641055cb3a2ff89460c7955ab68264#eventlog + const receipt = { + transactionHash: + '0x9da03376486327fc9b1e8069538e0fef91641055cb3a2ff89460c7955ab68264', + logs: [ + { + data: '0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000005300000013670000a4b100000000000000000000000096271ca0ab9eefb3ca481749c0ca4c705fd4f523000000890000000000000000000000006c0ac8cea75232aa7bed8cbe9c4f820e7a77a9c348656c6c6f2100000000000000000000000000', + topics: [ + '0x769f711d20c679153d382254f59892613b58a97cc876b249134ac25c80f9c814', + '0x00000000000000000000000096271ca0ab9eefb3ca481749c0ca4c705fd4f523', + '0x0000000000000000000000000000000000000000000000000000000000000089', + '0x0000000000000000000000006c0ac8cea75232aa7bed8cbe9c4f820e7a77a9c3', + ], + }, + ], + } as ethers.providers.TransactionReceipt; + // Should return immediately + await core.waitForMessagesProcessed(Chains.arbitrum, Chains.polygon, { + type: ProviderType.EthersV5, + receipt, + }); + }); + + it('to Sealevel', async () => { + const multiProvider = new MultiProtocolProvider(); + const core = MultiProtocolCore.fromEnvironment('mainnet', multiProvider); + // https://arbiscan.io//tx/0x9da03376486327fc9b1e8069538e0fef91641055cb3a2ff89460c7955ab68264#eventlog + const receipt = { + transactionHash: + '0x9da03376486327fc9b1e8069538e0fef91641055cb3a2ff89460c7955ab68264', + logs: [ + { + data: '0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000053000000136d0000a4b100000000000000000000000096271ca0ab9eefb3ca481749c0ca4c705fd4f523536f6c4d3797d0096b18b5b645c346a66d7f18c6c5738782c6bce24da57a3462bdef82b148656c6c6f2100000000000000000000000000', + topics: [ + '0x769f711d20c679153d382254f59892613b58a97cc876b249134ac25c80f9c814', + '0x00000000000000000000000096271ca0ab9eefb3ca481749c0ca4c705fd4f523', + '0x00000000000000000000000000000000000000000000000000000000536f6c4d', + '0x3797d0096b18b5b645c346a66d7f18c6c5738782c6bce24da57a3462bdef82b1', + ], + }, + ], + } as ethers.providers.TransactionReceipt; + // Should return immediately + await core.waitForMessagesProcessed(Chains.arbitrum, Chains.solana, { + type: ProviderType.EthersV5, + receipt, + }); + }); + }); });