fix:remove `agentStartBlock` and use `mailbox.deployedBlock()` instead (#3005)
### Description - CLI was using a static start block numbers for core chains or getting the latest block number from a PI chain for agent config which is redundant and dangerous. Instead, I updated to using the `mailbox.deployedBlock()` which should precede all other indexable contract deployment and is hence safer. ### Drive-by changes - filtering the agent configs in CLI is redundant since the `HyperlaneDeploymentArtifactsSchema` requires all the specified entries and if `writeAgentConfig` gets an artifacts which doesn't contain these, we should throw an error and not filter them. ### Related issues - related to https://github.com/hyperlane-xyz/issues/issues/736 ### Backward compatibility Yes ### Testing Manual b/w anvil1 and anvil2pull/3007/head
parent
3501755816
commit
9f2c7ce7c4
@ -0,0 +1,7 @@ |
||||
--- |
||||
'@hyperlane-xyz/infra': patch |
||||
'@hyperlane-xyz/cli': patch |
||||
'@hyperlane-xyz/sdk': patch |
||||
--- |
||||
|
||||
Removing agentStartBlocks and using mailbox.deployedBlock() instead |
@ -1,26 +0,0 @@ |
||||
import { ChainMap } from '../types'; |
||||
|
||||
// TODO this was previously in hyp-deploy, but ideally should be integrated
|
||||
// into the ChainMetadata type and de-duped with agent consts
|
||||
export const agentStartBlocks: ChainMap<number> = { |
||||
// --------------- Mainnets ---------------------
|
||||
celo: 16884144, |
||||
ethereum: 16271503, |
||||
avalanche: 24145479, |
||||
polygon: 37313389, |
||||
bsc: 25063295, |
||||
arbitrum: 49073182, |
||||
optimism: 55698988, |
||||
moonbeam: 2595747, |
||||
gnosis: 25900000, |
||||
// --------------- Testnets ---------------------
|
||||
alfajores: 14863532, |
||||
fuji: 16330615, |
||||
mumbai: 29390033, |
||||
bsctestnet: 25001629, |
||||
goerli: 8039005, |
||||
sepolia: 3082913, |
||||
moonbasealpha: 3310405, |
||||
optimismgoerli: 3055263, |
||||
arbitrumgoerli: 1941997, |
||||
}; |
Loading…
Reference in new issue