hyperlane-xyz / hyperlane-monorepo

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

[Epic] Add Multi-Chain Support for Dry-Run #3652

Open nbayindirli opened 4 months ago

nbayindirli commented 4 months ago

Previous single-chain impl: https://github.com/hyperlane-xyz/issues/issues/819

High-level steps

  1. Encapsulate sdk's fork.ts util in a class, adding setters to support multiple IPs and Ports
  2. Update CLI dry-run logic to use new fork util, support multi-chain selection, and allow developer to dry-run against 1+ networks
yorhodes commented 4 months ago

adding setters to support multiple IPs and Ports

I think a potential simpler solution here can reuse a single anvil process and the anvil_reset, anvil_dumpState, and anvil_loadState

https://book.getfoundry.sh/reference/anvil/#custom-methods

nbayindirli commented 4 months ago

Agreed– so during a dry-run, we will dump & load state multiple times, to and from the same anvil node. This would occur each time we interact with a different network.

Additionally, the dumped state for each forked network can be stored if we want to run future commands against the same augmented fork