Skip to content

Commit

Permalink
Merge branch 'hyperlane-xyz:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mshojaei-txfusion authored Jan 22, 2025
2 parents 9f42411 + 09e1d5b commit 59165bb
Show file tree
Hide file tree
Showing 23 changed files with 537 additions and 227 deletions.
2 changes: 1 addition & 1 deletion .registryrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9e900994370ccc702b84c332eb4a0479bfeabe07
80023dd9e9fadd4aa9fd868b5e7ad76dc3082494
10 changes: 10 additions & 0 deletions rust/main/agents/relayer/src/msg/metadata/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ impl BaseMetadataBuilder {

pub async fn build_checkpoint_syncer(
&self,
message: &HyperlaneMessage,
validators: &[H256],
app_context: Option<String>,
) -> Result<MultisigCheckpointSyncer> {
Expand All @@ -375,9 +376,18 @@ impl BaseMetadataBuilder {
.get_announced_storage_locations(validators)
.await?;

debug!(
hyp_message=?message,
?validators,
validators_len = ?validators.len(),
?storage_locations,
storage_locations_len = ?storage_locations.len(),
"List of validators and their storage locations for message");

// Only use the most recently announced location for now.
let mut checkpoint_syncers: HashMap<H160, Arc<dyn CheckpointSyncer>> = HashMap::new();
for (&validator, validator_storage_locations) in validators.iter().zip(storage_locations) {
debug!(hyp_message=?message, ?validator, ?validator_storage_locations, "Validator and its storage locations for message");
for storage_location in validator_storage_locations.iter().rev() {
let Ok(config) = CheckpointSyncerConf::from_str(storage_location) else {
debug!(
Expand Down
4 changes: 3 additions & 1 deletion rust/main/agents/relayer/src/msg/metadata/multisig/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ impl<T: MultisigIsmMetadataBuilder> MetadataBuilder for T {
return Ok(None);
}

info!(hyp_message=?message, ?validators, threshold, "List of validators and threshold for message");

let checkpoint_syncer = self
.as_ref()
.build_checkpoint_syncer(&validators, self.as_ref().app_context.clone())
.build_checkpoint_syncer(message, &validators, self.as_ref().app_context.clone())
.await
.context(CTX)?;

Expand Down
8 changes: 7 additions & 1 deletion rust/main/hyperlane-base/src/types/multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::sync::Arc;

use derive_new::new;
use eyre::Result;
use tracing::{debug, instrument};
use tracing::{debug, instrument, warn};

use hyperlane_core::{
HyperlaneDomain, MultisigSignedCheckpoint, SignedCheckpointWithMessageId, H160, H256,
Expand Down Expand Up @@ -40,6 +40,10 @@ impl MultisigCheckpointSyncer {

for validator in validators {
let address = H160::from(*validator);
debug!(
?address,
"Getting latest checkpoint from validator via checkpoint syncer",
);
if let Some(checkpoint_syncer) = self.checkpoint_syncers.get(&address) {
// Gracefully handle errors getting the latest_index
match checkpoint_syncer.latest_index().await {
Expand All @@ -56,6 +60,8 @@ impl MultisigCheckpointSyncer {
latest_indices.insert(H160::from(*validator), None);
}
}
} else {
warn!(?address, "Checkpoint syncer is not provided for validator");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,15 @@
"0x5aed2fd5cc5f9749c455646c86b0db6126cafcbb"
]
},
"trumpchain": {
"type": "messageIdMultisigIsm",
"threshold": 2,
"validators": [
"0x3ada634c8dfa57a67f5f22ca757b35cde6cfab5e",
"0xcf0211fafbb91fd9d06d7e306b30032dc3a1934f",
"0xcF8151b8aEFfF4e22F6B48fe2Ffe2d60F00C890C"
]
},
"unichain": {
"type": "messageIdMultisigIsm",
"threshold": 2,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"form": {
"hex": "0x0000000000000000000000008528baa7d1d386e7967603e480fa2b558a23644c",
"base58": "1111111111112rbf8mSSJDBCxvjCyPAButjBen7u"
},
"worldchain": {
"hex": "0x0000000000000000000000000fc7b3518c03bfa5e01995285b1ef3c4b55c8922",
"base58": "111111111111DkZ1qm7hv57Sa8ZhNG9yo9cp2qP"
"arbitrum": {
"hex": "0x0000000000000000000000005155eb1bcd30189915cf84717550acfa537068bf",
"base58": "11111111111128itaWLcGgPMeaS1ccv916mk2HT4"
},
"avalanche": {
"hex": "0x0000000000000000000000000e2a546a53678ee8f8605748193a8c114fa0317f",
Expand All @@ -15,16 +11,24 @@
"hex": "0x000000000000000000000000d3378b419feae4e3a4bb4f3349dba43a1b511760",
"base58": "1111111111113wfw1fbmfxSpYvFU6NfBtUNJ5q7u"
},
"base": {
"hex": "0x00000000000000000000000053c0499e7e4abd3e7994ca161523fd50a12bb8c8",
"base58": "1111111111112Ag6Vg3QoPPGirwYeTWBQWR9VmcB"
"optimism": {
"hex": "0x000000000000000000000000e36c02471e708a9f16da58168da744b059a1c6fe",
"base58": "1111111111114AmPuC4vLYgpwQK9Z4vycDaDMQWq"
},
"arbitrum": {
"hex": "0x0000000000000000000000005155eb1bcd30189915cf84717550acfa537068bf",
"base58": "11111111111128itaWLcGgPMeaS1ccv916mk2HT4"
"worldchain": {
"hex": "0x0000000000000000000000000fc7b3518c03bfa5e01995285b1ef3c4b55c8922",
"base58": "111111111111DkZ1qm7hv57Sa8ZhNG9yo9cp2qP"
},
"form": {
"hex": "0x0000000000000000000000008528baa7d1d386e7967603e480fa2b558a23644c",
"base58": "1111111111112rbf8mSSJDBCxvjCyPAButjBen7u"
},
"solanamainnet": {
"hex": "0x0f1589e8a3b501fb3eedfddd2eed7a262ef34b2292ae9bb86ab08f372c752a29",
"base58": "21tAY4poz2VXvghqdSQpn9j7gYravQmGpuQi8pHPx9DS"
},
"base": {
"hex": "0x00000000000000000000000053c0499e7e4abd3e7994ca161523fd50a12bb8c8",
"base58": "1111111111112Ag6Vg3QoPPGirwYeTWBQWR9VmcB"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,12 @@
"foreignDeployment": "0x0fC7b3518C03BfA5e01995285b1eF3c4B55c8922",
"name": "OFFICIAL TRUMP",
"symbol": "TRUMP"
},
"optimism": {
"type": "synthetic",
"decimals": 18,
"foreignDeployment": "0xe36c02471e708a9f16da58168da744b059a1c6fe",
"name": "OFFICIAL TRUMP",
"symbol": "TRUMP"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"trumpchain": {
"hex": "0x000000000000000000000000d84981ecd4c411a86e1ccda77f944c8f3d9737ab",
"base58": "11111111111141mYwaip4dprGDBXbJZAr5Bs17qL"
},
"solanamainnet": {
"hex": "0x9425c4caefa3e2a616aac1f4f53a05c34107dd2f28ea028702fe2b2c3877d520",
"base58": "AyJk3V2SjswRv1ppDazVofXnFgjCTeydNEDSyA2UyVNX"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"solanamainnet": {
"type": "collateral",
"decimals": 6,
"remoteDecimals": 18,
"token": "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN",
"interchainGasPaymaster": "AkeHBbE5JkwVppujCQQ6WuxsVsJtruBAjUo6fDCFp6fF",
"splTokenProgram": "token"
},
"trumpchain": {
"type": "native",
"decimals": 18,
"foreignDeployment": "0xD84981Ecd4c411A86E1Ccda77F944c8f3D9737ab",
"name": "OFFICIAL TRUMP",
"symbol": "TRUMP"
}
}
2 changes: 1 addition & 1 deletion typescript/infra/config/environments/mainnet3/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ const hyperlane: RootAgentConfig = {
rpcConsensusType: RpcConsensusType.Fallback,
docker: {
repo,
tag: '95deca3-20250120-103609',
tag: '359ce5d-20250121-133827',
},
resources: scraperResources,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,42 @@ import { RouterConfigWithoutOwner } from '../../../../../src/config/warp.js';
import { DEPLOYER } from '../../owners.js';
import { SEALEVEL_WARP_ROUTE_HANDLER_GAS_AMOUNT } from '../consts.js';

export const getTrumpchainTRUMPWarpConfig = async (
routerConfig: ChainMap<RouterConfigWithoutOwner>,
_abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>,
): Promise<ChainMap<HypTokenRouterConfig>> => {
const name = 'OFFICIAL TRUMP';
const symbol = 'TRUMP';
const totalSupply = 0;
const tokenConfig: ChainMap<HypTokenRouterConfig> = {
solanamainnet: {
...routerConfig.solanamainnet,
type: TokenType.collateral,
name,
symbol,
totalSupply,
token: '6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN',
owner: DEPLOYER,
gas: SEALEVEL_WARP_ROUTE_HANDLER_GAS_AMOUNT,
foreignDeployment: 'AyJk3V2SjswRv1ppDazVofXnFgjCTeydNEDSyA2UyVNX',
},
trumpchain: {
...routerConfig.trumpchain,
type: TokenType.native,
name,
symbol,
decimals: 18,
totalSupply,
owner: DEPLOYER,
proxyAdmin: {
owner: DEPLOYER,
address: '0xC5f2c60073DCAA9D157C45d5B017D639dF9C5CeB',
},
},
};
return tokenConfig;
};

export const getTRUMPWarpConfig = async (
routerConfig: ChainMap<RouterConfigWithoutOwner>,
abacusWorksEnvOwnerConfig: ChainMap<OwnableConfig>,
Expand All @@ -28,7 +64,6 @@ export const getTRUMPWarpConfig = async (
type: TokenType.collateral,
name,
symbol,
decimals: 6,
totalSupply,
token: '6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN',
owner: DEPLOYER,
Expand All @@ -49,52 +84,62 @@ export const getTRUMPWarpConfig = async (
...routerConfig.arbitrum,
...syntheticToken,
type: TokenType.synthetic,
owner: DEPLOYER,
owner: abacusWorksEnvOwnerConfig.arbitrum.owner,
proxyAdmin: {
owner: DEPLOYER,
owner: abacusWorksEnvOwnerConfig.arbitrum.owner,
address: '0x2350389Ea8649Da5dD4Fdd09c414dD8463C2695c',
},
},
avalanche: {
...routerConfig.avalanche,
...syntheticToken,
type: TokenType.synthetic,
owner: DEPLOYER,
owner: abacusWorksEnvOwnerConfig.avalanche.owner,
proxyAdmin: {
owner: DEPLOYER,
owner: abacusWorksEnvOwnerConfig.avalanche.owner,
address: '0x86a2E32BB42584127a24079a4f9113EeFE80db90',
},
},
flowmainnet: {
...routerConfig.flowmainnet,
...syntheticToken,
type: TokenType.synthetic,
owner: DEPLOYER,
owner: abacusWorksEnvOwnerConfig.flowmainnet.owner,
proxyAdmin: {
owner: DEPLOYER,
owner: abacusWorksEnvOwnerConfig.flowmainnet.owner,
address: '0xB504EA900302C7Faf24Cc4F155006d6c0357Dc35',
},
},
form: {
...routerConfig.form,
...syntheticToken,
type: TokenType.synthetic,
owner: DEPLOYER,
owner: abacusWorksEnvOwnerConfig.form.owner,
proxyAdmin: {
owner: DEPLOYER,
owner: abacusWorksEnvOwnerConfig.form.owner,
address: '0x5b3EeADcc0E2d4284eA6816e2E503c24d30a9E54',
},
},
worldchain: {
...routerConfig.worldchain,
...syntheticToken,
type: TokenType.synthetic,
owner: DEPLOYER,
owner: abacusWorksEnvOwnerConfig.worldchain.owner,
proxyAdmin: {
owner: DEPLOYER,
owner: abacusWorksEnvOwnerConfig.worldchain.owner,
address: '0x97e4682dBC4Bfd432F1563a7fa9aC218Bc48c861',
},
},
optimism: {
...routerConfig.optimism,
...syntheticToken,
type: TokenType.synthetic,
owner: abacusWorksEnvOwnerConfig.optimism.owner,
proxyAdmin: {
owner: abacusWorksEnvOwnerConfig.optimism.owner,
address: '0x6Fa52E2Fc86B200e7b80394e226929C1f9Ff2950',
},
},
};
return tokenConfig;
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export enum WarpRouteIds {
ArtelaBaseSolanaART = 'ART/artela-base-solanamainnet',
BscEthereumLumiaPrismPNDR = 'PNDR/bsc-ethereum-lumiaprism',
BaseSolanamainnetTONY = 'TONY/base-solanamainnet',
ArbitrumAvalancheBaseFlowmainnetFormSolanamainnetWorldchainTRUMP = 'TRUMP/arbitrum-avalanche-base-flowmainnet-form-solanamainnet-worldchain',
ArbitrumAvalancheBaseFlowmainnetFormOptimismSolanamainnetWorldchainTRUMP = 'TRUMP/arbitrum-avalanche-base-flowmainnet-form-optimism-solanamainnet-worldchain',
SolanamainnetTrumpchainTRUMP = 'TRUMP/solanamainnet-trumpchain',
EclipseEthereumApxEth = 'APXETH/eclipsemainnet-ethereum',
EclipseEthereumSolanaUSDC = 'USDC/eclipsemainnet-ethereum-solanamainnet',
EclipseEthereumSolanaUSDT = 'USDT/eclipsemainnet-ethereum-solanamainnet',
Expand Down
8 changes: 6 additions & 2 deletions typescript/infra/config/warp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ import { getArtelaBaseUSDCWarpConfig } from './environments/mainnet3/warp/config
import { getArtelaBaseWETHWarpConfig } from './environments/mainnet3/warp/configGetters/getArtelaBaseWETHWarpConfig.js';
import { getBaseFormAIXBTWarpConfig } from './environments/mainnet3/warp/configGetters/getBaseFormAIXBTWarpConfig.js';
import { getBaseFormGAMEWarpConfig } from './environments/mainnet3/warp/configGetters/getBaseFormGAMEWarpConfig.js';
import { getTRUMPWarpConfig } from './environments/mainnet3/warp/configGetters/getBaseSolanaTRUMPWarpConfig.js';
import {
getTRUMPWarpConfig,
getTrumpchainTRUMPWarpConfig,
} from './environments/mainnet3/warp/configGetters/getBaseSolanaTRUMPWarpConfig.js';
import { getBaseSolanamainnetTONYWarpConfig } from './environments/mainnet3/warp/configGetters/getBaseSolanamainnetTONYWarpConfig.js';
import { getBaseZeroNetworkCBBTCWarpConfig } from './environments/mainnet3/warp/configGetters/getBaseZeroNetworkCBBTCWarpConfig.js';
import { getBobaBsquaredSwellUBTCWarpConfig } from './environments/mainnet3/warp/configGetters/getBobaBsquaredSwellUBTCWarpConfig.js';
Expand Down Expand Up @@ -79,8 +82,9 @@ export const warpConfigGetterMap: Record<string, WarpConfigGetter> = {
getRenzoEZETHWarpConfig,
[WarpRouteIds.InevmInjectiveINJ]: getInevmInjectiveINJWarpConfig,
[WarpRouteIds.BaseSolanamainnetTONY]: getBaseSolanamainnetTONYWarpConfig,
[WarpRouteIds.ArbitrumAvalancheBaseFlowmainnetFormSolanamainnetWorldchainTRUMP]:
[WarpRouteIds.ArbitrumAvalancheBaseFlowmainnetFormOptimismSolanamainnetWorldchainTRUMP]:
getTRUMPWarpConfig,
[WarpRouteIds.SolanamainnetTrumpchainTRUMP]: getTrumpchainTRUMPWarpConfig,
[WarpRouteIds.BscEthereumLumiaPrismPNDR]:
getBscEthereumLumiaPrismPNDRWarpConfig,
[WarpRouteIds.EthereumFlowCbBTC]: getEthereumFlowCbBTCWarpConfig,
Expand Down
9 changes: 0 additions & 9 deletions typescript/infra/scripts/agent-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,6 @@ export function withRpcUrls<T>(args: Argv<T>) {
.alias('r', 'rpcUrls');
}

export function withTxHashes<T>(args: Argv<T>) {
return args
.describe('txHashes', 'transaction hash')
.string('txHashes')
.array('txHashes')
.demandOption('txHashes')
.alias('t', 'txHashes');
}

// Interactively gets a single warp route ID
export async function getWarpRouteIdInteractive() {
const choices = Object.values(WarpRouteIds).map((id) => ({
Expand Down
Loading

0 comments on commit 59165bb

Please sign in to comment.