Skip to content

Commit

Permalink
Merge branch 'main' of github.com:abacus-network/abacus-monorepo into…
Browse files Browse the repository at this point in the history
… trevor/addtl-igp-cmds
  • Loading branch information
tkporter committed Oct 11, 2023
2 parents c4387cf + 825ce29 commit c0de676
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 9 deletions.
2 changes: 1 addition & 1 deletion rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion rust/hyperlane-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
1 change: 1 addition & 0 deletions rust/hyperlane-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ tokio = { workspace = true, features = ["rt", "time"] }

[features]
default = []
float = []
test-utils = ["dep:config"]
agent = ["ethers", "strum"]
strum = ["dep:strum"]
Expand Down
4 changes: 4 additions & 0 deletions rust/hyperlane-core/src/types/primitive_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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")]
Expand Down
2 changes: 2 additions & 0 deletions rust/hyperlane-core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.;
Expand All @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions typescript/infra/config/environments/mainnet2/helloworld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions typescript/infra/config/environments/testnet3/helloworld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion typescript/infra/scripts/helloworld/kathy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
);
Expand Down
59 changes: 57 additions & 2 deletions typescript/sdk/src/core/MultiProtocolCore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -27,12 +28,66 @@ 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);
const ethAdapter = core.adapter(Chains.ethereum);
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,
});
});
});
});

0 comments on commit c0de676

Please sign in to comment.