Skip to content

Latest commit

 

History

History
77 lines (62 loc) · 3.46 KB

README.md

File metadata and controls

77 lines (62 loc) · 3.46 KB

Overview

This repository contains scripts and documentation on deploying Hyperlane core contracts to the Khalani chain, and MultisigIsm to remote chains that need to be connected. Originally, this is a fork of hyperlane-xyz/hyperlane-deploy.

khalani-deployment.png

Current deployment

  • Khalani chain is called khalanitestnet and has chainId = 10012
  • we deploy to Ethereum Goerli testnet (chainId = 5) and Avalanche Fuji testnet (chainId = 43113)
  • 1 relayer from Khalani to Goerli and Fuji
  • 1 validator (TODO: will be more) for outgoing messages from Khalani to the end-chains
  • the only validator stores checkpoints in S3: khala-testnet-validator-signatures-1/us-east-1
  • deployed MultisigIsm on Goerli and Fuji with the only registered validator of the Khalani chain
  • we do not have any gas policies set up, meanining that our relayers do not charge gas

Quickstart

1. Install foundry

2. Install dependencies

yarn install
git submodule init && git submodule update --remote

3. Deploy Hyperlane core contracts to the Axon chain

  • Configure the owner (admin) in networks.json (<ADDRESS>)
  • Deploy the core contracts (MultisigIsm, Mailbox, InterchainGasPaymaster, ValidatorAnnounce).
./deploy-khalanitestnet.sh

4. For each chain that needs to receive messages FROM Khalani

./deploy-multisig.sh

5. When Hyperlane validators are started and announcement.json are generated, run ./announce-validator.sh for all validators

  • Each validator saves announcement.json file to the checkpoint S3 bucket. This file contains the signed path of the storage checkpoints.
  • For each validator ValidatorAnnounce.announce must be called with the signature, location and address of the validator
  • Just replace the content of announcement.json with the new one and run ./announce-validator.sh:
    • specify private key of the gas payer on Khalani chain — any wallet can be used

How it works

Wallets

  • deployer is the wallet that deploys the contracts, calls configuration functions, and pays for the gas
  • owner is the admin wallet having configuration control on the deployed contracts

On deploy-khalanitestnet.sh

  • Deploy ProxyAdmin
    • Transfers ownership to the owner
  • Deploy MultisigIsm
    • For each remote chain (originChain) that wants to pass messages TO Khalani:
      • call enrollValidators for each originChain -> [0xVal1dator, 0xVal2dator, ...]
      • call setThreashold set threshold required for the originChain
    • Transfers ownership to the owner
  • Deploy Mailbox
    • deploy implementation
      • contructor(originChainID)
      • initialize (owner, _defaultIsm)
    • wrap with TransparentUpgradeableProxy
      • constructor(ProxyAdmin, Mailbox)
  • Deploy ValidatorAnnounce
    • constructor(Mailbox-address)

On deploy-multisig.sh

  • Deploy MultisigIsm to the external chain (Goerli, Fuji...)
  • Enroll Khalani validators to make MultisigIsm receive messages FROM Khalani
  • Transfers ownership to the owner