feat: implement reorg audit remediations (#4682)

### Description

Bump up .registryrc and update agent configs with updated chain metadata
including:
- reorg periods
- technical stack

Updates originally made in
https://github.com/hyperlane-xyz/hyperlane-registry/pull/276

Relies on `objMerge` to be fixed
https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/4678

### Drive-by changes

- remove extraneous overrides + bring exiting relayer env vars into
config
- so it's in the image build directly, and we minimise
break-glass-in-case-of-emergency overrides to the stateful set
- ensure txOverrides are only included if defined in infra or registry	
- ensure we delete txo verrides from the read-in config, before merging
with the generated config

### Related issues

na

### Backward compatibility

yes

### Testing

na
pull/4688/head
Paul Balaji 1 month ago committed by GitHub
parent 110d9d8877
commit c08d842adf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      .registryrc
  2. 342
      rust/main/config/mainnet_config.json
  3. 8
      rust/main/config/testnet_config.json
  4. 23
      typescript/infra/config/environments/mainnet3/chains.ts
  5. 24
      typescript/infra/scripts/agents/update-agent-config.ts

@ -1 +1 @@
3cd5d816549b1ae391e6a3c68acc07d439175888
8583d0841615313c8c880e765eba760378e061cd

File diff suppressed because it is too large Load Diff

@ -264,13 +264,13 @@
"testRecipient": "0xfbcD1c00a3d809f36cC1A15918694B17B32c0b6c",
"testTokenRecipient": "0x260f6024119549a40595d0937471e607411E8ea5",
"timelockController": "0x0000000000000000000000000000000000000000",
"transactionOverrides": {
"gasPrice": 8000000000
},
"validatorAnnounce": "0xf09701B0a93210113D175461b6135a96773B5465",
"staticMerkleRootWeightedMultisigIsmFactory": "0xCa152b249791Adf7A09C6c1bdbAb05e4A594966e",
"staticMessageIdWeightedMultisigIsmFactory": "0xaa80d23299861b7D7ab1bE665579029Ed9137BD1",
"gasCurrencyCoinGeckoId": "binancecoin"
"gasCurrencyCoinGeckoId": "binancecoin",
"transactionOverrides": {
"gasPrice": 8000000000
}
},
"connextsepolia": {
"aggregationHook": "0x331eb40963dc11F5BB271308c42d97ac6e41F124",

@ -19,13 +19,10 @@ export const chainMetadataOverrides: ChainMap<Partial<ChainMetadata>> = {
},
},
polygon: {
blocks: {
confirmations: 3,
},
transactionOverrides: {
// A very high max fee per gas is used as Polygon is susceptible
// to large swings in gas prices.
maxFeePerGas: 550 * 10 ** 9, // 550 gwei
maxFeePerGas: 800 * 10 ** 9, // 800 gwei
maxPriorityFeePerGas: 50 * 10 ** 9, // 50 gwei
},
},
@ -34,23 +31,6 @@ export const chainMetadataOverrides: ChainMap<Partial<ChainMetadata>> = {
gasPrice: 1 * 10 ** 9, // 1 gwei
},
},
ethereum: {
blocks: {
confirmations: 3,
},
transactionOverrides: {
maxFeePerGas: 150 * 10 ** 9, // gwei
maxPriorityFeePerGas: 5 * 10 ** 9, // gwei
},
},
scroll: {
transactionOverrides: {
// Scroll doesn't use EIP 1559 and the gas price that's returned is sometimes
// too low for the transaction to be included in a reasonable amount of time -
// this often leads to transaction underpriced issues.
gasPrice: 2 * 10 ** 9, // 2 gwei
},
},
sei: {
// Sei's `eth_feeHistory` is not to spec and incompatible with ethers-rs,
// so we force legacy transactions by setting a gas price.
@ -75,7 +55,6 @@ export const chainMetadataOverrides: ChainMap<Partial<ChainMetadata>> = {
// chiliz: {
// transactionOverrides: {
// maxFeePerGas: 100000 * 10 ** 9, // 100,000 gwei
// maxPriorityFeePerGas: 1 * 10 ** 9, // 1 gwei
// },
// },
};

@ -1,5 +1,9 @@
// eslint-disable-next-line
import fs from 'fs';
import { ChainAddresses } from '@hyperlane-xyz/registry';
import {
AgentConfig,
ChainMap,
ChainTechnicalStack,
CoreFactories,
@ -13,6 +17,7 @@ import {
ProtocolType,
objFilter,
objMap,
objMerge,
promiseObjAll,
} from '@hyperlane-xyz/utils';
@ -26,7 +31,8 @@ import {
chainIsProtocol,
filterRemoteDomainMetadata,
isEthereumProtocolChain,
writeMergedJSONAtPath,
readJSONAtPath,
writeJsonAtPath,
} from '../../src/utils/utils.js';
import {
Modules,
@ -138,10 +144,18 @@ export async function writeAgentConfig(
additionalConfig,
);
writeMergedJSONAtPath(
getAgentConfigJsonPath(envNameToAgentEnv[environment]),
agentConfig,
);
const filepath = getAgentConfigJsonPath(envNameToAgentEnv[environment]);
if (fs.existsSync(filepath)) {
const currentAgentConfig: AgentConfig = readJSONAtPath(filepath);
// Remove transactionOverrides from each chain in the agent config
// To ensure all overrides are configured in infra code or the registry, and not in JSON
for (const chainConfig of Object.values(currentAgentConfig.chains)) {
delete chainConfig.transactionOverrides;
}
writeJsonAtPath(filepath, objMerge(currentAgentConfig, agentConfig));
} else {
writeJsonAtPath(filepath, agentConfig);
}
}
main()

Loading…
Cancel
Save