Skip to content

Commit

Permalink
Merge branch 'main' into kunal/config-fallback-hook
Browse files Browse the repository at this point in the history
  • Loading branch information
aroralanuk authored Jan 29, 2024
2 parents dceb654 + 3bb4d87 commit 2e0c51e
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 13 deletions.
16 changes: 11 additions & 5 deletions rust/chains/hyperlane-cosmos/src/aggregation_ism.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
use async_trait::async_trait;
use hyperlane_core::{
AggregationIsm, ChainResult, ContractLocator, HyperlaneChain, HyperlaneContract,
HyperlaneDomain, HyperlaneMessage, HyperlaneProvider, RawHyperlaneMessage, H256,
HyperlaneDomain, HyperlaneMessage, HyperlaneProvider, RawHyperlaneMessage, H160, H256,
};
use tracing::instrument;

Expand Down Expand Up @@ -85,10 +85,16 @@ impl AggregationIsm for CosmosAggregationIsm {
let modules: ChainResult<Vec<H256>> = response
.validators
.iter()
// The returned values are Bech32-decoded Cosmos addresses.
// Since they are not EOAs but rather contracts, they are 32 bytes long and
// need to be parsed directly as an `H256`.
.map(|module| H256::from_str(module).map_err(Into::into))
.map(|module| {
// The returned values are Bech32-decoded Cosmos addresses.
// Since they are not EOAs but rather contracts, they can be 32 bytes long and
// need to be parsed directly as an `H256`.
if let Ok(res) = H256::from_str(module) {
return Ok(res);
}
// If the address is not 32 bytes long, it is a 20-byte address
H160::from_str(module).map(H256::from).map_err(Into::into)
})
.collect();

Ok((modules?, response.threshold))
Expand Down
80 changes: 80 additions & 0 deletions rust/config/mainnet3_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,37 @@
"from": 437300
}
},
"injective": {
"name": "injective",
"domainId": "6909546",
"chainId": "injective-1",
"mailbox": "0x0f7fb53961d70687e352aa55cb329ca76edc0c19",
"interchainGasPaymaster": "0x27ae52298e5b53b34b7ae0ca63e05845c31e1f59",
"validatorAnnounce": "0x1fb225b2fcfbe75e614a1d627de97ff372242eed",
"merkleTreeHook": "0x568ad3638447f07def384969f4ea39fae3802962",
"protocol": "cosmos",
"finalityBlocks": 1,
"rpcUrls": [
{
"http": "https://rpc-injective.goldenratiostaking.net:443"
}
],
"grpcUrl": "https://injective-grpc.publicnode.com/",
"canonicalAsset": "inj",
"bech32Prefix": "inj",
"gasPrice": {
"amount": "700000000",
"denom": "inj"
},
"contractAddressBytes": 20,
"index": {
"from": 58419500,
"chunk": 100000
},
"blocks": {
"reorgPeriod": 1
}
},
"moonbeam": {
"blockExplorers": [
{
Expand Down Expand Up @@ -517,6 +548,55 @@
"from": 4719713
}
},
"inevm": {
"blockExplorers": [
{
"apiUrl": "https://inevm.calderaexplorer.xyz/api",
"family": "blockscout",
"name": "Caldera inEVM Explorer",
"url": "https://inevm.calderaexplorer.xyz/"
}
],
"blocks": {
"confirmations": 1,
"estimateBlockTime": 3,
"reorgPeriod": 0
},
"chainId": 2525,
"domainId": 2525,
"displayName": "Injective EVM",
"displayNameShort": "inEVM",
"name": "inevm",
"nativeToken": {
"decimals": 18,
"name": "Injective",
"symbol": "INJ"
},
"protocol": "ethereum",
"rpcUrls": [
{
"http": "https://inevm.calderachain.xyz/http"
}
],
"merkleRootMultisigIsmFactory": "0x2C1FAbEcd7bFBdEBF27CcdB67baADB38b6Df90fC",
"messageIdMultisigIsmFactory": "0x8b83fefd896fAa52057798f6426E9f0B080FCCcE",
"aggregationIsmFactory": "0x8F7454AC98228f3504Bb91eA3D8Adafe6406110A",
"aggregationHookFactory": "0xEb9FcFDC9EfDC17c1EC5E1dc085B98485da213D6",
"routingIsmFactory": "0x1052eF3419f26Bec74Ed7CEf4a4FA6812Bc09908",
"domainRoutingIsm": "0xBD70Ea9D599a0FC8158B026797177773C3445730",
"proxyAdmin": "0x0761b0827849abbf7b0cC09CE14e1C93D87f5004",
"storageGasOracle": "0x6119E37Bd66406A1Db74920aC79C15fB8411Ba76",
"interchainGasPaymaster": "0x19dc38aeae620380430C200a6E990D5Af5480117",
"merkleTreeHook": "0x0972954923a1e2b2aAb04Fa0c4a0797e5989Cd65",
"aggregationHook": "0xe0dDb5dE7D52918237cC1Ae131F29dcAbcb0F62B",
"protocolFee": "0x0D63128D887159d63De29497dfa45AFc7C699AE4",
"mailbox": "0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7",
"validatorAnnounce": "0x15ab173bDB6832f9b64276bA128659b0eD77730B",
"interchainSecurityModule": "0xBD70Ea9D599a0FC8158B026797177773C3445730",
"index": {
"from": 18972465
}
},
"optimism": {
"blockExplorers": [
{
Expand Down
8 changes: 4 additions & 4 deletions rust/hyperlane-core/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub use routing_ism::*;
pub use signing::*;
pub use validator_announce::*;

use crate::{FixedPointNumber, U256};
use crate::{FixedPointNumber, H512, U256};

mod aggregation_ism;
mod ccip_read_ism;
Expand All @@ -38,11 +38,11 @@ mod validator_announce;
#[derive(Debug, Clone)]
pub struct TxOutcome {
/// The transaction identifier/hash
pub transaction_id: crate::H512,
pub transaction_id: H512,
/// True if executed, false otherwise (reverted, etc.)
pub executed: bool,
/// Amount of gas used on this transaction.
pub gas_used: crate::U256,
pub gas_used: U256,
/// Price paid for the gas
pub gas_price: FixedPointNumber,
// TODO: more? What can be abstracted across all chains?
Expand All @@ -54,7 +54,7 @@ impl From<ethers_core::types::TransactionReceipt> for TxOutcome {
Self {
transaction_id: t.transaction_hash.into(),
executed: t.status.unwrap().low_u32() == 1,
gas_used: t.gas_used.map(Into::into).unwrap_or(crate::U256::zero()),
gas_used: t.gas_used.map(Into::into).unwrap_or(U256::zero()),
gas_price: t
.effective_gas_price
.and_then(|price| U256::from(price).try_into().ok())
Expand Down
27 changes: 23 additions & 4 deletions typescript/infra/config/environments/testnet4/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
GasPaymentEnforcementPolicyType,
RpcConsensusType,
chainMetadata,
getDomainId,
} from '@hyperlane-xyz/sdk';

import {
Expand Down Expand Up @@ -50,7 +51,7 @@ const hyperlane: RootAgentConfig = {
rpcConsensusType: RpcConsensusType.Fallback,
docker: {
repo,
tag: '6360cc8-20240122-140607',
tag: 'c9ef41c-20240126-172723',
},
blacklist: [
...releaseCandidateHelloworldMatchingList,
Expand All @@ -60,6 +61,24 @@ const hyperlane: RootAgentConfig = {
// gas, we blacklist the old TestRecipient address.
recipientAddress: '0xBC3cFeca7Df5A45d61BC60E7898E63670e1654aE',
},
// OptimismGoerli griefers:
{
destinationDomain: getDomainId(chainMetadata.optimismgoerli),
recipientAddress: [
'0xed4de02c6f4cb1161bdfefdb2fcdeef4546fa36c',
'0x723192fc414fe536b414117a4b2c5a7b71f912e3',
'0x5a48723d80a7ee3be6855ca293059b5287ee6689',
],
},
// Goerli griefers:
{
destinationDomain: getDomainId(chainMetadata.goerli),
recipientAddress: [
'0x0461c69ff7f29cfb5efd36b9d377fdfc95418c2b',
'0xe747c82ed8560ba137b24a3a97ff7504b50c3e91',
'0x6ad92511ee4a3835bde9b1bfd7063023b56a8c56',
],
},
],
gasPaymentEnforcement,
metricAppContexts: [
Expand All @@ -75,7 +94,7 @@ const hyperlane: RootAgentConfig = {
rpcConsensusType: RpcConsensusType.Fallback,
docker: {
repo,
tag: '6360cc8-20240122-140607',
tag: 'c9ef41c-20240126-172723',
},
chains: validatorChainConfig(Contexts.Hyperlane),
},
Expand All @@ -96,7 +115,7 @@ const releaseCandidate: RootAgentConfig = {
rpcConsensusType: RpcConsensusType.Fallback,
docker: {
repo,
tag: '6360cc8-20240122-140607',
tag: 'c9ef41c-20240126-172723',
},
whitelist: [...releaseCandidateHelloworldMatchingList],
gasPaymentEnforcement,
Expand All @@ -109,7 +128,7 @@ const releaseCandidate: RootAgentConfig = {
rpcConsensusType: RpcConsensusType.Fallback,
docker: {
repo,
tag: '6360cc8-20240122-140607',
tag: 'c9ef41c-20240126-172723',
},
chains: validatorChainConfig(Contexts.ReleaseCandidate),
},
Expand Down

0 comments on commit 2e0c51e

Please sign in to comment.