GithubHelp home page GithubHelp logo

hyperlane-deploy's People

Contributors

asaj avatar bap2pecs avatar jmrossy avatar megabyte0x avatar nambrot avatar serejke avatar tkporter avatar yiwen-gao avatar yorhodes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hyperlane-deploy's Issues

Add Interchain contracts to deploy script

Currently the following contracts are not included in the deployment script:

  • interchainQueryRouter
  • interchainAccountRouter
  • interchainAccountIsm
  • aggregationIsmFactory
  • routingIsmFactory

Happy submitting a PR if I get the thumbs up?

Deploy hyperlane script fails to complete

I am trying to test and deploy hyperlane on anvil local chain.

The deployment script fails with following error:

duplicate definition - NotCrossChainCall()
  hyperlane Beginning Hyperlane deployment script +0ms
  hyperlane Preparing Hyperlane deployer +1ms
  hyperlane Beginning Hyperlane deployment +101ms
  hyperlane:HyperlanePermissionlessDeployer Deploying ISM factory contracts +0ms
  hyperlane:IsmFactoryDeployer Start deploy to anvil2,anvil1 +0ms
  hyperlane:IsmFactoryDeployer Deploying to anvil2 from 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 +9ms
  hyperlane:IsmFactoryDeployer Recovered merkleRootMultisigIsmFactory on anvil2 0x5FbDB2315678afecb367f032d93F642f64180aa3 +8ms
  hyperlane:IsmFactoryDeployer Recovered messageIdMultisigIsmFactory on anvil2 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 +4ms
  hyperlane:IsmFactoryDeployer Recovered aggregationIsmFactory on anvil2 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 +2ms
  hyperlane:IsmFactoryDeployer Recovered routingIsmFactory on anvil2 0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 +2ms
  hyperlane:IsmFactoryDeployer Deploying to anvil1 from 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 +4ms
  hyperlane:IsmFactoryDeployer Recovered merkleRootMultisigIsmFactory on anvil1 0x5FbDB2315678afecb367f032d93F642f64180aa3 +16ms
  hyperlane:IsmFactoryDeployer Recovered messageIdMultisigIsmFactory on anvil1 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 +3ms
  hyperlane:IsmFactoryDeployer Recovered aggregationIsmFactory on anvil1 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 +2ms
  hyperlane:IsmFactoryDeployer Recovered routingIsmFactory on anvil1 0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9 +1ms
  hyperlane:HyperlanePermissionlessDeployer Writing contract addresses to artifacts/addresses.json +52ms
  hyperlane:HyperlanePermissionlessDeployer ISM factory deployment complete +1ms
  hyperlane:HyperlanePermissionlessDeployer Deploying IGP contracts +0ms
  hyperlane:IgpDeployer Start deploy to anvil2,anvil1 +0ms
  hyperlane:IgpDeployer Deploying to anvil2 from 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 +4ms
  hyperlane:IgpDeployer Recovered proxyAdmin on anvil2 0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9 +5ms
  hyperlane:IgpDeployer Recovered storageGasOracle on anvil2 0x5FC8d32690cc91D4c39d9d3abcBD16989F875707 +2ms
  hyperlane:IgpDeployer Recovered interchainGasPaymaster on anvil2 0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6 +5ms
  hyperlane:ERROR Error running Hyperlane deployment Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="gasOracles(uint32)", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.7.0)
    at Logger.makeError (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
    at Logger.throwError (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
    at Interface.decodeFunctionResult (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/abi/src.ts/interface.ts:427:23)
    at Contract.<anonymous> (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/contracts/src.ts/index.ts:400:44)
    at step (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/contracts/lib/index.js:48:23)
    at Object.next (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/contracts/lib/index.js:29:53)
    at fulfilled (/Users/mac/hyperlane/hyperlane-deploy/node_modules/@ethersproject/contracts/lib/index.js:20:58)
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  reason: null,
  code: 'CALL_EXCEPTION',
  method: 'gasOracles(uint32)',
  data: '0x',
  errorArgs: null,
  errorName: null,
  errorSignature: null,
  address: '0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6',
  args: [ 31337 ],
  transaction: {
    data: '0x1d16c8c80000000000000000000000000000000000000000000000000000000000007a69',
    to: '0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6',
    from: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
  }
} +0ms

Below are my configurations.

Deployment command

DEBUG=hyperlane*  yarn ts-node scripts/deploy-hyperlane.ts --local anvil1 \
  --remotes anvil2 \
  --key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 

config/chains.ts

import { ChainMap, ChainMetadata, ProtocolType } from '@hyperlane-xyz/sdk';

// import { chainMetadata } from '@hyperlane-xyz/sdk';
// A map of chain names to ChainMetadata
export const chains: ChainMap<ChainMetadata> = {
  // ----------- Add your chains here -----------------
  anvil1: {
    name: 'anvil1',
    protocol: ProtocolType.Ethereum,
    // anvil default chain id
    chainId: 31337,
    // Used to configure a Warp Route to bridge anvil1 ETH
    // to anvil2 in CI tests.
    nativeToken: { 
      name: 'ether',
      symbol: 'ETH',
      decimals: 18,
    },
    rpcUrls: [
      {
        http: 'http://127.0.0.1:8545',
      },
    ],
    // You can set overrides for transaction fields here
    // transactionOverrides: {
    //   gasLimit: 1000000
    // },
  },
  anvil2: {
    name: 'anvil2',
    protocol: ProtocolType.Ethereum,
    chainId: 31338,
    nativeToken: { 
      name: 'ether',
      symbol: 'ETH',
      decimals: 18,
    },
    rpcUrls: [
      {
        http: 'http://127.0.0.1:8555',
      },
    ],
  },
  // --------------------------------------------------
  // You can also override the default chain metadata (completely)
  // ethereum: {
  //   ...chainMetadata.ethereum,
  //   publicRpcUrls: [
  //     {
  //       http: 'my.custom.rpc.url',
  //     }
  //   ],
  // }
};


config/multisig_ism.ts

import { ChainMap, ModuleType, MultisigIsmConfig } from '@hyperlane-xyz/sdk';

export const multisigIsmConfig: ChainMap<MultisigIsmConfig> = {
  // ----------- Your chains here -----------------
  anvil1: {
    type: ModuleType.LEGACY_MULTISIG,
    threshold: 1,
    validators: [
      // Last anvil address
      '0xa0ee7a142d267c1f36714e4a8f75612f20a79720',
    ],
  },
  anvil2: {
    type: ModuleType.LEGACY_MULTISIG,
    threshold: 1,
    validators: [
      // Last anvil address
      '0xa0ee7a142d267c1f36714e4a8f75612f20a79720',
    ],
  },
};

Let me know if something is missing from my side.

Error in deploying Hyperlane scripts

chain.ts

import { ChainMap, ChainMetadata, ProtocolType } from '@hyperlane-xyz/sdk';

// import { chainMetadata } from '@hyperlane-xyz/sdk';
// A map of chain names to ChainMetadata
export const chains: ChainMap<ChainMetadata> = {
  // ----------- Add your chains here -----------------
  goerli: {
    name: 'goerli',
    protocol: ProtocolType.Ethereum,
    chainId: 5, // This is the chain ID for Goerli (Matic testnet)
    nativeToken: {
      name: 'GeorliToken',
      symbol: 'GoerliETH',
      decimals: 18,
    },
    rpcUrls: [
      {
        http: `https://eth-goerli.g.alchemy.com/v2/${process.env.API_KEY_GOERLI}`, // Adjust this to the Goerli RPC endpoint you want to use.
      },
    ],
  },
  sepolia: {
    name: 'sepolia',
    protocol: ProtocolType.Ethereum, // Assuming there's a custom protocol type for Sepolia
    chainId: 12345, // Replace with the actual chain ID for Sepolia
    nativeToken: {
      name: 'SepoliaToken', // Replace with the native token name if applicable
      symbol: 'SepoliaETH', // Replace with the native token symbol if applicable
      decimals: 18, // Replace with the number of decimals for the native token if applicable
    },
    rpcUrls: [
      {
        http: `https://eth-sepolia.g.alchemy.com/v2/${process.env.API_KEY_SEPOLIA}`, // Replace with the Sepolia RPC endpoint you want to use.
      },
    ],
  },
  // --------------------------------------------------
  // You can also override the default chain metadata (completely)
  // ethereum: {
  //   ...chainMetadata.ethereum,
  //   publicRpcUrls: [
  //     {
  //       http: 'my.custom.rpc.url',
  //     }
  //   ],
  // }
};

![image](https://github.com/hyperlane-xyz/hyperlane-deploy/assets/75583927/e2608bdc-a62e-4ff6-9f2e-7c25ef23c699)

![image](https://github.com/hyperlane-xyz/hyperlane-deploy/assets/75583927/d6a8a232-d604-47c3-9688-da087b250170)


Unable to deploy on Filecoin testnets due to "implementation isn't a contract" error

Summary

I'm trying to deploy Hyperlane to Filecoin's testnet wallaby by following these docs, but when I run

forge script scripts/DeployCore.s.sol --broadcast --rpc-url $RPC_URL

I get an error that

## Setting up (1) EVMs.

Failed with `ERC1967: new implementation is not a contract`:

I've attached the full output in logs.txt, and it looks like the deployment code was executed but the EVM setup failed.

Env Vars

LOCAL=wallaby
RPC_URL=https://wallaby.node.glif.io/rpc/v0
REMOTES=goerli

Config

I initialized the keys under contracts as "", and the script filled in the addresses.

  "wallaby": {
    "id": 31415,
    "owner": "0xbcb8E197F783E2aE4B3f3b6358B582a9692f9F85",
    "contracts": {
      "interchainGasPaymaster": "0xBb2180ebd78ce97360503434eD37fcf4a1Df61c3",
      "mailbox": "0x416C42991d05b31E9A6dC209e91AD22b79D87Ae6",
      "proxyAdmin": "0x34A1D3fff3958843C43aD80F30b94c510645C316",
      "testRecipient": "0xd21060559c9beb54fC07aFd6151aDf6cFCDDCAeB",
      "create2Factory": "0x0000000000000000000000000000000000000000"
    }
  }

Has anyone encountered this error before? Am I missing a step in the setup? I also tried to deploy to hyperspace, another Filecoin testnet, but saw the same failure message.

Contracts' `owner` is equal to deployer, and cannot be configured (new TS SDK)

It's probably a minor change in the new TypeScript SDK, but previously with Forge scripting it was possible to set a different owner (in config/networks.json) than the deployer key,

now the owner is always the deployer:

const owner = await this.signer.getAddress();

We want to transfer ownership of the deployed contracts to a Safe wallet. So using the new SDK we need to call transferOwnership on all the deployed contracts, which means an additional post-deployment step

MultisigIsm config incorrectly parses the set of validators

I have a config at config/multisig_ism.json as:

"ethereum1": {
    "threshold": 2,
    "validators": [
      {
        "address": "0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec",
        "name": "validator 1"
      },
      {
        "address": "0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097",
        "name": "validator 2"
      },
      {
        "address": "0xcd3B766CCDd6AE721141F452C550Ca635964ce71",
        "name": "validator 3"
      }
    ]
  },

above only 3 validators are specified. But Multisig.validators returns 5 validators:

  0x0000000000000000000000000000000000000020
  0x0000000000000000000000000000000000000003
  0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec
  0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097
  0xcd3B766CCDd6AE721141F452C550Ca635964ce71

This is because the readMultisigIsmDomainConfig uses JSON parseRaw on .validators[*].address that returns ABI-encoded byte array (including the offset specifier and length).

bytes memory validatorBytes = json.parseRaw(

string.concat(".", chainName, ".validators[*].address")

One workaround I applied locally was to read addresses starting from that offset:

        uint256 offset = 64;
        uint256 numValidators = (validatorBytes.length - offset) / 32;
        address[] memory validators = new address[](numValidators);
        for (uint256 i = 0; i < validators.length; i++) {
            validators[i] = abi.decode(
                validatorBytes.slice(offset + i * 32, 32),
                (address)
            );
        }

There must be a better way. I experimented with StdJson.sol's utility function

address[] memory validators = json.readAddressArray(
   string.concat(".", chainName, ".validators[*].address")
);

but it doesn't work with wildcard * selector.

instruction improvements in README

README says I need to add an entry to config/start_blocks.ts if I need to deploy to a new chain. but it seems scripts/deploy-hyperlane.ts runs fine without it. is it b/c it's default to be 0?

the instruction was also not clear which block should be put in that file. should I just pick the latest block number?

Allow a warp route deployment to include multiple native / collateral tokens

Atm, our warp route tooling only supports a single "base" type (i.e. native or collateral token), and many synthetic types.

Advanced use cases involve having multiple collateral or native warp route tokens in a single deployment. E.g. the plan for Nautilus, which will involve 1 collateral on Solana, 1 collateral on BSC, and 1 native on Nautilus

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.