AggregationISM set for rc kathy (#2517)
### Description - Using a separate set of validators for RC deployments and tests - Defining a recursive AggregationISM config which aggregates over two RoutingISMs, one for a set of MerkleRootMultisigISMs and one for a set of MessageIdMultisigISMs for each origin domain. ### Drive-by changes - Dployed MerkleRootMultisigISMFactory and MessageIdMultisigISMFactory for testnet3 in hyperlane context ### Related issues - Fixes #2224 ### Backward compatibility Backward compatible? Yes Any infrastructure implications? HyperlaneRouterChecker will fail silently if you provide an IsmConfig - #2534 ### Testing Manual Testnet --------- Co-authored-by: Yorke Rhodes <email@yorke.dev> Co-authored-by: Yorke Rhodes <yorke@hyperlane.xyz>pull/2536/head
parent
aa92fe37db
commit
e91be529db
@ -0,0 +1,92 @@ |
||||
import { |
||||
AggregationIsmConfig, |
||||
ChainMap, |
||||
ChainName, |
||||
IsmConfig, |
||||
ModuleType, |
||||
MultisigIsmConfig, |
||||
RoutingIsmConfig, |
||||
defaultMultisigIsmConfigs, |
||||
objFilter, |
||||
objMap, |
||||
} from '@hyperlane-xyz/sdk'; |
||||
|
||||
import { Contexts } from '../../contexts'; |
||||
import { rcMultisigIsmConfigs } from '../../multisigIsm'; |
||||
|
||||
import { chainNames } from './chains'; |
||||
import { owners } from './owners'; |
||||
|
||||
export const multisigIsms = ( |
||||
local: ChainName, |
||||
type: MultisigIsmConfig['type'], |
||||
context: Contexts, |
||||
): ChainMap<MultisigIsmConfig> => |
||||
objMap( |
||||
objFilter( |
||||
context === Contexts.ReleaseCandidate |
||||
? rcMultisigIsmConfigs |
||||
: defaultMultisigIsmConfigs, |
||||
(chain, config): config is MultisigIsmConfig => |
||||
chain !== local && chainNames.includes(chain), |
||||
), |
||||
(_, config) => ({ |
||||
...config, |
||||
type, |
||||
}), |
||||
); |
||||
|
||||
/// Routing => Multisig ISM type
|
||||
export const routingIsm = ( |
||||
local: ChainName, |
||||
type: MultisigIsmConfig['type'], |
||||
context: Contexts, |
||||
): RoutingIsmConfig => { |
||||
const defaultMultisigIsmConfigs = multisigIsms(local, type, context); |
||||
return { |
||||
type: ModuleType.ROUTING, |
||||
domains: defaultMultisigIsmConfigs, |
||||
owner: owners[local], |
||||
}; |
||||
}; |
||||
|
||||
/// 1/2 Aggregation => Routing => Multisig ISM
|
||||
export const aggregationIsm = ( |
||||
local: ChainName, |
||||
context: Contexts, |
||||
): AggregationIsmConfig => { |
||||
const config: AggregationIsmConfig = { |
||||
type: ModuleType.AGGREGATION, |
||||
modules: [ |
||||
// ORDERING MATTERS
|
||||
routingIsm(local, ModuleType.MERKLE_ROOT_MULTISIG, context), |
||||
routingIsm(local, ModuleType.MESSAGE_ID_MULTISIG, context), |
||||
], |
||||
threshold: 1, |
||||
}; |
||||
return config; |
||||
}; |
||||
|
||||
const replacerEnum = (key: string, value: any) => { |
||||
if (key === 'type') { |
||||
switch (value) { |
||||
case ModuleType.AGGREGATION: |
||||
return 'AGGREGATION'; |
||||
case ModuleType.ROUTING: |
||||
return 'ROUTING'; |
||||
case ModuleType.MERKLE_ROOT_MULTISIG: |
||||
return 'MERKLE_ROOT_MULTISIG'; |
||||
case ModuleType.LEGACY_MULTISIG: |
||||
return 'LEGACY_MULTISIG'; |
||||
case ModuleType.MESSAGE_ID_MULTISIG: |
||||
return 'MESSAGE_ID_MULTISIG'; |
||||
default: |
||||
return value; |
||||
} |
||||
} |
||||
return value; |
||||
}; |
||||
|
||||
export const printIsmConfig = (ism: IsmConfig): string => { |
||||
return JSON.stringify(ism, replacerEnum, 2); |
||||
}; |
@ -0,0 +1,114 @@ |
||||
import { ChainMap, ModuleType, MultisigIsmConfig } from '@hyperlane-xyz/sdk'; |
||||
|
||||
export const rcMultisigIsmConfigs: ChainMap<MultisigIsmConfig> = { |
||||
// ----------------- Mainnets -----------------
|
||||
celo: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: [ |
||||
'0xe7a82e210f512f8e9900d6bc2acbf7981c63e66e', // abacus
|
||||
], |
||||
}, |
||||
ethereum: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: [ |
||||
'0xaea1adb1c687b061e5b60b9da84cb69e7b5fab44', // abacus
|
||||
], |
||||
}, |
||||
avalanche: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: [ |
||||
'0x706976391e23dea28152e0207936bd942aba01ce', // abacus
|
||||
], |
||||
}, |
||||
polygon: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: [ |
||||
'0xef372f6ff7775989b3ac884506ee31c79638c989', // abacus
|
||||
], |
||||
}, |
||||
bsc: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: [ |
||||
'0x0823081031a4a6f97c6083775c191d17ca96d0ab', // abacus
|
||||
], |
||||
}, |
||||
arbitrum: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: [ |
||||
'0x1a95b35fb809d57faf1117c1cc29a6c5df289df1', // abacus
|
||||
], |
||||
}, |
||||
optimism: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: [ |
||||
'0x60e938bf280bbc21bacfd8bf435459d9003a8f98', // abacus
|
||||
], |
||||
}, |
||||
moonbeam: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: [ |
||||
'0x0df7140811e309dc69638352545151ebb9d5e0fd', // abacus
|
||||
], |
||||
}, |
||||
gnosis: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: [ |
||||
'0x15f48e78092a4f79febface509cfd76467c6cdbb', // abacus
|
||||
], |
||||
}, |
||||
// ----------------- Testnets -----------------
|
||||
alfajores: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: ['0x45e5c228b38e1cf09e9a3423ed0cf4862c4bf3de'], |
||||
}, |
||||
fuji: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: ['0xd81ba169170a9b582812cf0e152d2c168572e21f'], |
||||
}, |
||||
mumbai: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: ['0xb537c4ce34e1cad718be52aa30b095e416eae46a'], |
||||
}, |
||||
bsctestnet: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: ['0x77f80ef5b18977e15d81aea8dd3a88e7df4bc0eb'], |
||||
}, |
||||
goerli: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: ['0x9597ddb4ad2af237665559574b820596bb77ae7a'], |
||||
}, |
||||
sepolia: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: ['0x183f15924f3a464c54c9393e8d268eb44d2b208c'], |
||||
}, |
||||
moonbasealpha: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: ['0xbeaf158f85d7b64ced36b8aea0bbc4cd0f2d1a5d'], |
||||
}, |
||||
optimismgoerli: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: ['0x1d6798671ac532f2bf30c3a5230697a4695705e4'], |
||||
}, |
||||
arbitrumgoerli: { |
||||
type: ModuleType.LEGACY_MULTISIG, |
||||
threshold: 1, |
||||
validators: ['0x6d13367c7cd713a4ea79a2552adf824bf1ecdd5e'], |
||||
}, |
||||
}; |
Loading…
Reference in new issue