Separate agent chain configurations, re-add some chains to infra, fix eclipsetestnet & solanatestnet configs (#3327)
### Description - solanatestnet and eclipsetestnet were accidentally moved in the agent JSON to not be in the `chains` object. This moves them back to the right place, and adds a test in `infra` to make sure that the agent JSON chains exactly match the environment chain names. There's opportunity for future improvement for exact consistency between TS artifacts / chain metadata and what exists in the agent JSONs, this is tracked here https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/3325 - Adds back eclipsetestnet, solanatestnet, and mumbai to the list of testnet4 chains. These seem to have been accidentally removed - I guess we never deployed to mainnet3 since we started writing to aw-multisig.json. So this writes mainnet chains for the first time - Made some modest fixes to the address persistence logic: - Previously, it didn't handle AWS & GCP keys for the same role well. For non-EVM chains, we have a GCP version of a key for submitting transactions. These exist for relayers, kathy, and validators. This resulted in contention for the relayer key - sometimes the GCP key would get written, sometimes the AWS key. For validators, we'd write both the validator checkpoint signer (AWS) and the chain signer (GCP). Now we just flat out prefer the AWS key. We already only wrote the address persistence with EVM keys in mind, so this isn't a regression - Moves to very explicitly specifying which chains will be ran on the `hyperlane` context agents - Instead of sharing a list of chains for both agents and all contract management, now it's separate. This avoids us making quick fixes and removing e.g. non-EVM chains to make ethereum-specific contract tooling happy, but accidentally removing agent support for these chains - Each chain must be specified for each role in an `AgentChainConfig` indicating whether that chain is enabled. This being consistent with the environment's chain names is enforced at runtime & in a test that's ran in CI. Explicitly indicating whether a chain is supported or not and keeping this consistent will hopefully result in fewer unintentional changes to sets of configured chains - This also allows us during partner integrations to merge a PR with the contract deploy but without necessarily running agents yet. We can just set the chain as disabled to not deploy to it ### Drive-by changes - Removes the `disabled` property for chains in our infra - this is no longer a thing and isn't needed anymore ### Related issues Fixes #3326 Fixes #2572 ### Backward compatibility <!-- Are these changes backward compatible? Are there any infrastructure implications, e.g. changes that would prohibit deploying older commits using this infra tooling? Yes/No --> ### Testing <!-- What kind of testing have these changes undergone? None/Manual/Unit Tests -->pull/3069/merge
parent
e737d998ff
commit
18d1d0d54e
@ -0,0 +1,47 @@ |
||||
import { expect } from 'chai'; |
||||
|
||||
import { hyperlaneContextAgentChainConfig as mainnet3AgentChainConfig } from '../config/environments/mainnet3/agent'; |
||||
import { supportedChainNames as mainnet3SupportedChainNames } from '../config/environments/mainnet3/chains'; |
||||
import { hyperlaneContextAgentChainConfig as testnet4AgentChainConfig } from '../config/environments/testnet4/agent'; |
||||
import { supportedChainNames as testnet4SupportedChainNames } from '../config/environments/testnet4/chains'; |
||||
import { getAgentConfigJsonPath } from '../scripts/agent-utils'; |
||||
import { ensureAgentChainConfigIncludesAllChainNames } from '../src/config'; |
||||
import { readJSONAtPath } from '../src/utils/utils'; |
||||
|
||||
const environmentChainConfigs = { |
||||
mainnet3: { |
||||
agentChainConfig: mainnet3AgentChainConfig, |
||||
// We read the agent config from the file system instead of importing
|
||||
// to get around the agent JSON configs living outside the typescript rootDir
|
||||
agentJsonConfig: readJSONAtPath(getAgentConfigJsonPath('mainnet3')), |
||||
supportedChainNames: mainnet3SupportedChainNames, |
||||
}, |
||||
testnet4: { |
||||
agentChainConfig: testnet4AgentChainConfig, |
||||
agentJsonConfig: readJSONAtPath(getAgentConfigJsonPath('testnet4')), |
||||
supportedChainNames: testnet4SupportedChainNames, |
||||
}, |
||||
}; |
||||
|
||||
describe('Agent configs', () => { |
||||
Object.entries(environmentChainConfigs).forEach(([environment, config]) => { |
||||
describe(`Environment: ${environment}`, () => { |
||||
it('AgentChainConfig specifies all chains for each role in the agent chain config', () => { |
||||
// This will throw if there are any inconsistencies
|
||||
ensureAgentChainConfigIncludesAllChainNames( |
||||
config.agentChainConfig, |
||||
config.supportedChainNames, |
||||
); |
||||
}); |
||||
|
||||
it('Agent JSON config matches environment chains', () => { |
||||
const agentJsonConfigChains = Object.keys( |
||||
config.agentJsonConfig.chains, |
||||
); |
||||
expect(agentJsonConfigChains).to.have.members( |
||||
config.supportedChainNames, |
||||
); |
||||
}); |
||||
}); |
||||
}); |
||||
}); |
Loading…
Reference in new issue