hyperlane-xyz / hyperlane-monorepo

The home for Hyperlane core contracts, sdk packages, and other infrastructure
https://hyperlane.xyz
Other
306 stars 338 forks source link

Validator does not index custom deployment of Hyperlane #4322

Open ameten opened 1 month ago

ameten commented 1 month ago

Problem

Observed behaviour

When Hyperlane is deployed to a chain which contains a standard official deployment of Hyperlane already, validator will use the MerkleTreeHook contact from the official deployment.

Expected behaviour

When Hyperlane is deployed to a chain which contains a standard official deployment of Hyperlane already, validator should use MerkleTreeHook contact from the custom deployment of Hyperlane.

Root cause

Hyperlane CLI does not populate MerkleTreeHook contract address into addresses.json file when it deployed core contracts to a change. Hence, CLI uses official MerkleTreeHook contract address in agent-config.json. Therefore, Validator reads the official MerkleTreeHook and indexes it instead of the one deployed by a developer.

Solution

ltyu commented 1 month ago

Initial investigation tells me that we just need to add merkleTree to the Warp core artifacts. The addresses.yaml will then be created with this registry fn: https://github.com/hyperlane-xyz/hyperlane-registry/blob/8b5b0a4618dd824c4765ce9dac08eaca9bda6e07/src/registry/FileSystemRegistry.ts#L97-L106