Skip to content

Commit

Permalink
Merge branch 'main' into rossy/logo-svg-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrossy authored Feb 13, 2024
2 parents 3e69be0 + 93f864f commit ffcc39b
Show file tree
Hide file tree
Showing 40 changed files with 350 additions and 661 deletions.
16 changes: 9 additions & 7 deletions rust/agents/relayer/src/msg/metadata/ccip_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,18 @@ impl MetadataBuilder for CcipReadIsmMetadataBuilder {
};

for url in info.urls.iter() {
// Need to explicitly convert the sender H160 the hex because the `ToString` implementation
// for `H160` truncates the output. (e.g. `0xc66a…7b6f` instead of returning
// the full address)
let sender_as_bytes = &bytes_to_hex(info.sender.as_bytes());
let data_as_bytes = &info.call_data.to_string();
let interpolated_url = url
// Need to explicitly convert the sender H160 the hex because the `ToString` implementation
// for `H160` truncates the output. (e.g. `0xc66a…7b6f` instead of returning
// the full address)
.replace("{sender}", &bytes_to_hex(info.sender.as_bytes()))
.replace("{data}", &info.call_data.to_string());
.replace("{sender}", sender_as_bytes)
.replace("{data}", data_as_bytes);
let res = if !url.contains("{data}") {
let body = json!({
"data": info.call_data.to_string(),
"sender": info.sender.to_string(),
"sender": sender_as_bytes,
"data": data_as_bytes
});
Client::new()
.post(interpolated_url)
Expand Down
2 changes: 1 addition & 1 deletion typescript/infra/config/environments/mainnet3/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const ethereumMainnetConfigs: ChainMap<ChainMetadata> = {
export const nonEthereumMainnetConfigs: ChainMap<ChainMetadata> = {
// solana: chainMetadata.solana,
// neutron: chainMetadata.neutron,
injective: chainMetadata.injective,
// injective: chainMetadata.injective,
};

export const mainnetConfigs: ChainMap<ChainMetadata> = {
Expand Down
2 changes: 1 addition & 1 deletion typescript/infra/config/environments/mainnet3/funding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { environment } from './chains';
export const keyFunderConfig: KeyFunderConfig = {
docker: {
repo: 'gcr.io/abacus-labs-dev/hyperlane-monorepo',
tag: '0e3f73f-20240206-160718',
tag: 'af21f03-20240212-175700',
},
// We're currently using the same deployer key as mainnet.
// To minimize nonce clobbering we offset the key funder cron
Expand Down
46 changes: 23 additions & 23 deletions typescript/infra/config/environments/mainnet3/gas-oracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,51 +55,51 @@ const gasPrices: ChainMap<BigNumber> = {
viction: ethers.utils.parseUnits('0.25', 'gwei'),
};

// Accurate from coingecko as of Mar 9, 2023.
// Accurate from coingecko as of Feb 9, 2024.
// These aren't overestimates because the exchange rates between
// tokens are what matters. These generally have high beta
const tokenUsdPrices: ChainMap<BigNumber> = {
// https://www.coingecko.com/en/coins/bnb
bsc: ethers.utils.parseUnits('230.55', TOKEN_EXCHANGE_RATE_DECIMALS),
bsc: ethers.utils.parseUnits('323.61', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/avalanche
avalanche: ethers.utils.parseUnits('20.25', TOKEN_EXCHANGE_RATE_DECIMALS),
avalanche: ethers.utils.parseUnits('38.27', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/polygon
polygon: ethers.utils.parseUnits('0.75', TOKEN_EXCHANGE_RATE_DECIMALS),
polygon: ethers.utils.parseUnits('0.85', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/celo
celo: ethers.utils.parseUnits('0.52', TOKEN_EXCHANGE_RATE_DECIMALS),
celo: ethers.utils.parseUnits('0.73', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/ethereum
arbitrum: ethers.utils.parseUnits('2000.00', TOKEN_EXCHANGE_RATE_DECIMALS),
arbitrum: ethers.utils.parseUnits('2495.00', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/ethereum
optimism: ethers.utils.parseUnits('2000.00', TOKEN_EXCHANGE_RATE_DECIMALS),
optimism: ethers.utils.parseUnits('2495.00', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/ethereum
ethereum: ethers.utils.parseUnits('2000.00', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/moonbeam
moonbeam: ethers.utils.parseUnits('0.266', TOKEN_EXCHANGE_RATE_DECIMALS),
// xDAI
gnosis: ethers.utils.parseUnits('1.00', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/solana
solana: ethers.utils.parseUnits('58.85', TOKEN_EXCHANGE_RATE_DECIMALS),
ethereum: ethers.utils.parseUnits('2495.00', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/ethereum
base: ethers.utils.parseUnits('2000.00', TOKEN_EXCHANGE_RATE_DECIMALS),
base: ethers.utils.parseUnits('2495.00', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/ethereum
scroll: ethers.utils.parseUnits('2000.00', TOKEN_EXCHANGE_RATE_DECIMALS),
scroll: ethers.utils.parseUnits('2495.00', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/ethereum
polygonzkevm: ethers.utils.parseUnits(
'2000.00',
'2495.00',
TOKEN_EXCHANGE_RATE_DECIMALS,
),
// https://www.coingecko.com/en/coins/neutron
neutron: ethers.utils.parseUnits('0.304396', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/ethereum
mantapacific: ethers.utils.parseUnits(
'1619.00',
'2495.00',
TOKEN_EXCHANGE_RATE_DECIMALS,
),
// https://www.coingecko.com/en/coins/moonbeam
moonbeam: ethers.utils.parseUnits('0.387', TOKEN_EXCHANGE_RATE_DECIMALS),
// xDAI
gnosis: ethers.utils.parseUnits('1.00', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/solana
solana: ethers.utils.parseUnits('108.01', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/neutron
neutron: ethers.utils.parseUnits('1.14', TOKEN_EXCHANGE_RATE_DECIMALS),
// https://www.coingecko.com/en/coins/injective
injective: ethers.utils.parseUnits('32.78', TOKEN_EXCHANGE_RATE_DECIMALS),
inevm: ethers.utils.parseUnits('32.78', TOKEN_EXCHANGE_RATE_DECIMALS), // 1:1 injective
injective: ethers.utils.parseUnits('35.07', TOKEN_EXCHANGE_RATE_DECIMALS),
inevm: ethers.utils.parseUnits('35.07', TOKEN_EXCHANGE_RATE_DECIMALS), // 1:1 injective
// https://www.coingecko.com/en/coins/viction
viction: ethers.utils.parseUnits('0.881', TOKEN_EXCHANGE_RATE_DECIMALS),
viction: ethers.utils.parseUnits('0.726', TOKEN_EXCHANGE_RATE_DECIMALS),
};

// Gets the exchange rate of the remote quoted in local tokens
Expand Down
13 changes: 2 additions & 11 deletions typescript/infra/config/environments/mainnet3/igp.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
ChainMap,
GasOracleContractType,
IgpConfig,
defaultMultisigConfigs,
multisigIsmVerificationCost,
Expand All @@ -12,6 +11,7 @@ import {
ethereumChainNames,
supportedChainNames,
} from './chains';
import { storageGasOracleConfig } from './gas-oracle';
import { owners } from './owners';

// TODO: make this generic
Expand All @@ -20,15 +20,6 @@ const DEPLOYER_ADDRESS = '0xa7ECcdb9Be08178f896c26b7BbD8C3D4E844d9Ba';

const FOREIGN_DEFAULT_OVERHEAD = 600_000; // cosmwasm warp route somewhat arbitrarily chosen

function getGasOracles(local: MainnetChains) {
return Object.fromEntries(
exclude(local, supportedChainNames).map((name) => [
name,
GasOracleContractType.StorageGasOracle,
]),
);
}

const remoteOverhead = (remote: MainnetChains) =>
ethereumChainNames.includes(remote)
? multisigIsmVerificationCost(
Expand All @@ -41,11 +32,11 @@ export const igp: ChainMap<IgpConfig> = objMap(owners, (local, owner) => ({
...owner,
oracleKey: DEPLOYER_ADDRESS,
beneficiary: KEY_FUNDER_ADDRESS,
gasOracleType: getGasOracles(local),
overhead: Object.fromEntries(
exclude(local, supportedChainNames).map((remote) => [
remote,
remoteOverhead(remote),
]),
),
oracleConfig: storageGasOracleConfig[local],
}));
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
2 changes: 0 additions & 2 deletions typescript/infra/config/environments/mainnet3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { agents } from './agent';
import { environment as environmentName, mainnetConfigs } from './chains';
import { core } from './core';
import { keyFunderConfig } from './funding';
import { storageGasOracleConfig } from './gas-oracle';
import { helloWorld } from './helloworld';
import { igp } from './igp';
import { infrastructure } from './infrastructure';
Expand Down Expand Up @@ -54,7 +53,6 @@ export const environment: EnvironmentConfig = {
infra: infrastructure,
helloWorld,
keyFunderConfig,
storageGasOracleConfig,
liquidityLayerConfig: {
bridgeAdapters: bridgeAdapterConfigs,
relayer: relayerConfig,
Expand Down
1 change: 1 addition & 0 deletions typescript/infra/config/environments/mainnet3/owners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const timelocks: ChainMap<Address | undefined> = {
};

export const safes: ChainMap<Address | undefined> = {
mantapacific: '0x03ed2D65f2742193CeD99D48EbF1F1D6F12345B6', // does not have a UI
celo: '0x1DE69322B55AC7E0999F8e7738a1428C8b130E4d',
ethereum: '0x12C5AB61Fe17dF9c65739DBa73dF294708f78d23',
avalanche: '0xDF9B28B76877f1b1B4B8a11526Eb7D8D7C49f4f3',
Expand Down
2 changes: 0 additions & 2 deletions typescript/infra/config/environments/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { EnvironmentConfig } from '../../../src/config';
import { agents } from './agent';
import { testConfigs } from './chains';
import { core } from './core';
import { storageGasOracleConfig } from './gas-oracle';
import { igp } from './igp';
import { infra } from './infra';
import { owners } from './owners';
Expand All @@ -31,5 +30,4 @@ export const environment: EnvironmentConfig = {
getKeys: async () => {
throw new Error('Not implemented');
},
storageGasOracleConfig,
};
2 changes: 1 addition & 1 deletion typescript/infra/config/environments/testnet4/funding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { environment } from './chains';
export const keyFunderConfig: KeyFunderConfig = {
docker: {
repo: 'gcr.io/abacus-labs-dev/hyperlane-monorepo',
tag: '3a165e4-20240131-141310',
tag: 'b09cc90-20240208-194409',
},
// We're currently using the same deployer key as testnet2.
// To minimize nonce clobbering we offset the key funder cron
Expand Down
14 changes: 2 additions & 12 deletions typescript/infra/config/environments/testnet4/igp.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
import {
ChainMap,
ChainName,
GasOracleContractType,
IgpConfig,
defaultMultisigConfigs,
multisigIsmVerificationCost,
} from '@hyperlane-xyz/sdk';
import { exclude, objMap } from '@hyperlane-xyz/utils';

import { supportedChainNames } from './chains';
import { storageGasOracleConfig } from './gas-oracle';
import { owners } from './owners';

function getGasOracles(local: ChainName) {
return Object.fromEntries(
exclude(local, supportedChainNames).map((name) => [
name,
GasOracleContractType.StorageGasOracle,
]),
);
}

export const igp: ChainMap<IgpConfig> = objMap(owners, (chain, ownerConfig) => {
return {
...ownerConfig,
oracleKey: ownerConfig.owner,
beneficiary: ownerConfig.owner,
gasOracleType: getGasOracles(chain),
oracleConfig: storageGasOracleConfig[chain],
overhead: Object.fromEntries(
exclude(chain, supportedChainNames).map((remote) => [
remote,
Expand Down
2 changes: 0 additions & 2 deletions typescript/infra/config/environments/testnet4/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { agents } from './agent';
import { environment as environmentName, testnetConfigs } from './chains';
import { core } from './core';
import { keyFunderConfig } from './funding';
import { storageGasOracleConfig } from './gas-oracle';
import { helloWorld } from './helloworld';
import { igp } from './igp';
import { infrastructure } from './infrastructure';
Expand Down Expand Up @@ -51,5 +50,4 @@ export const environment: EnvironmentConfig = {
bridgeAdapters: bridgeAdapterConfigs,
relayer: liquidityLayerRelayerConfig,
},
storageGasOracleConfig,
};
2 changes: 1 addition & 1 deletion typescript/infra/config/kathy.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"mainnet3": {
"hyperlane": "0x5fb02f40f56d15f0442a39d11a23f73747095b20",
"neutron": "",
"rc": ""
"rc": "0x7691f88dccc1554788ba8f226a4a31e5f3ead7c3"
},
"testnet4": {
"hyperlane": "0x1e8834ff0669b13cf5d37685c5327b82dbae1144",
Expand Down
4 changes: 1 addition & 3 deletions typescript/infra/helm/key-funder/templates/cron-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ spec:
{{- range $context, $roles := .Values.hyperlane.contextsAndRolesToFund }}
- --contexts-and-roles
- {{ $context }}={{ join "," $roles }}
- -f
- /addresses-secret/{{ $context }}-addresses.json
{{- end }}
{{- if .Values.hyperlane.connectionType }}
- --connection-type
Expand All @@ -48,4 +46,4 @@ spec:
- name: key-funder-addresses-secret
secret:
secretName: key-funder-addresses-secret
defaultMode: 0400
defaultMode: 0400
5 changes: 1 addition & 4 deletions typescript/infra/scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ async function main() {
} else if (module === Modules.WARP) {
throw new Error('Warp is not supported. Use CLI instead.');
} else if (module === Modules.INTERCHAIN_GAS_PAYMASTER) {
config = {
...envConfig.igp,
oracleConfig: envConfig.storageGasOracleConfig,
};
config = envConfig.igp;
deployer = new HyperlaneIgpDeployer(multiProvider);
} else if (module === Modules.INTERCHAIN_ACCOUNTS) {
const core = HyperlaneCore.fromEnvironment(env, multiProvider);
Expand Down
Loading

0 comments on commit ffcc39b

Please sign in to comment.