Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update tangletestnet addresses and add WETH warp route #236

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

devpavan04
Copy link
Contributor

Description

  • Updates tangletestnet addresses and metadata.
  • Adds a new warp route - WETH from holeksy to tangletestnet.

Copy link

changeset-bot bot commented Sep 30, 2024

🦋 Changeset detected

Latest commit: 1fdb549

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hyperlane-xyz/registry Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@devpavan04
Copy link
Contributor Author

@paulbalaji Below is the core config for new tangletestnet deployments:

CleanShot 2024-09-30 at 11 18 11

I have also updated the warp route to include the correct relayer address:

CleanShot 2024-09-30 at 11 20 49

Since we're using trustedRelayerISM here, I am trying to run just one relayer.

CleanShot 2024-09-30 at 11 25 11

I have few questions:

  1. I want to transfer WETH from holesky to tangletestnet. Do I need to include both the chains when generating the agent config? or just the destination chain? The docs specify --chains chain1 which is confusing.

CleanShot 2024-09-30 at 11 27 26

2 .When trying to generate agent config for --chains tangletestnet I see these warnings:

CleanShot 2024-09-30 at 11 32 11

Could you please tell me how to get this working and if I am missing something here. I am following Deploy Hyperlane with Local Agents from the docs.

@paulbalaji
Copy link
Contributor

paulbalaji commented Sep 30, 2024

overall LGTM, please run yarn changeset add to add a minor changeset

will also get more eyes on your Qs

@paulbalaji
Copy link
Contributor

I want to transfer WETH from holesky to tangletestnet. Do I need to include both the chains when generating the agent config? or just the destination chain?

The relayer needs to have metadata on the chains that it should watch/deliver to, so if you want the relayer to go between chain1/chain2 it should have both in the config

When trying to generate agent config for --chains tangletestnet I see these warnings:

When you deployed the core contracts there should be a merkleTreeHook that was also deployed. There's currently a bug where this doesn't get correctly to the artifacts in some cases. If you add that merkleTreeHook address, it should be able to generate the agent config

I believe this is the one you deployed https://testnet-explorer.tangle.tools/address/0x1d7A5b6e18c16103c365e975B258Cb5039971E9b

@devpavan04
Copy link
Contributor Author

I believe this is the one you deployed https://testnet-explorer.tangle.tools/address/0x1d7A5b6e18c16103c365e975B258Cb5039971E9b

Yes that seems correct.

@paulbalaji Thanks for the response here! One more question.

For the transfer to work, does the tangletestnet related config should be in core config of holesky?

hyperlane core read --chain holesky does not include tangletestnet in it's defaultHook, defaultISM domains.

@paulbalaji
Copy link
Contributor

For the transfer to work, does the tangletestnet related config should be in core config of holesky?

Yup that's right, if you want to use the existing mailbox we have there we'd have to enroll tangletestnet into the default chains there.

You can also deploy your own mailbox/contracts on holesky, and the trusted relayer could relay between your two mailboxes

@devpavan04
Copy link
Contributor Author

Yup that's right, if you want to use the existing mailbox we have there we'd have to enroll tangletestnet into the default chains there.

You can also deploy your own mailbox/contracts on holesky, and the trusted relayer could relay between your two mailboxes

Okay. So deploy to mailbox and other contracts on holesky, it's the same process right.

hyperlane registry init and hyperlane core init and hyperlane core deploy.

Also when deploying on holesky, can I just do hyperlane core init to keep core config to default or hyperlane core init --advanced ?

I believe after deploying the contracts on holesky, when I generate agent config:

hyperlane registry agent-config --chains holesky,tangletest

I need to make sure the core contracts on holesky points to the addresses I just deployed.

Also, hyperlane core deploy does not deploy interchainGasPaymaster contract. So this will not work right? How will the sender on holesky send the gas fee to paymaster so that relayer can use it on tangletestnet? Is this a bug as well - not able to deploy interchainGasPaymaster with hyperlane core deploy?

Also the docs mention, there needs to be 1 paymaster contracts for 1 relayer. Not sure how to do this.

@paulbalaji paulbalaji changed the title Update tangletestnet addresses and add WETH warp route feat: update tangletestnet addresses and add WETH warp route Oct 2, 2024
@paulbalaji
Copy link
Contributor

It should be the same process yes

I need to make sure the core contracts on holesky points to the addresses I just deployed.

yup, if you have your local registry you can use --overrides <pathtoregistry> with the cli to override the default addresses

Also, hyperlane core deploy does not deploy interchainGasPaymaster contract. So this will not work right? How will the sender on holesky send the gas fee to paymaster so that relayer can use it on tangletestnet? Is this a bug as well - not able to deploy interchainGasPaymaster with hyperlane core deploy?
Also the docs mention, there needs to be 1 paymaster contracts for 1 relayer. Not sure how to do this.

Yeah I'm looking into the IGP cli situation at the moment. To unblock you running in the interim, worth trying to set interchainGasPaymaster to the zero address

@devpavan04 devpavan04 marked this pull request as draft October 3, 2024 00:06
github-merge-queue bot pushed a commit to hyperlane-xyz/hyperlane-monorepo that referenced this pull request Oct 4, 2024
### Description

original:
there was a series of related problems that people are encountering with
cli deploys where the merkleTreeHook is deployed but its address is not
included in the artifacts. this PR was intended to bring parity with how
infra does it, we can also update for now to only add the merkleTreeHook
to the output to unblock the base problem people are having

update:
restricted to just `merkleTreeHook` and `interchainGasPaymaster` to
provide MVP fix


![image](https://github.com/user-attachments/assets/9f38c3a8-5240-4cbe-a224-161a7a4da8af)

### Related issues


hyperlane-xyz/hyperlane-registry#240 (comment)

hyperlane-xyz/hyperlane-registry#236 (comment)

hyperlane-xyz/hyperlane-registry#237 (comment)

### Backward compatibility

yes

### Testing

manual

---------

Signed-off-by: pbio <[email protected]>
paulbalaji added a commit to hyperlane-xyz/hyperlane-monorepo that referenced this pull request Oct 4, 2024
### Description

original:
there was a series of related problems that people are encountering with
cli deploys where the merkleTreeHook is deployed but its address is not
included in the artifacts. this PR was intended to bring parity with how
infra does it, we can also update for now to only add the merkleTreeHook
to the output to unblock the base problem people are having

update:
restricted to just `merkleTreeHook` and `interchainGasPaymaster` to
provide MVP fix


![image](https://github.com/user-attachments/assets/9f38c3a8-5240-4cbe-a224-161a7a4da8af)

### Related issues


hyperlane-xyz/hyperlane-registry#240 (comment)

hyperlane-xyz/hyperlane-registry#236 (comment)

hyperlane-xyz/hyperlane-registry#237 (comment)

### Backward compatibility

yes

### Testing

manual

---------

Signed-off-by: pbio <[email protected]>
github-merge-queue bot pushed a commit to hyperlane-xyz/hyperlane-monorepo that referenced this pull request Oct 28, 2024
### Description

Re-adding the ability to generate IGP hook configs using the CLI, but
repurposing logic found in infra to make the configuration experience
more ergonomic. Logic still behind the `--advanced` flag.

> Enabling this allows IGP configuration in any place that supports hook
config e.g. `core`/`warp`/`hook` init with `--advanced`.

We will use metadata in registry to:
1. fetch price from Coingecko (prompt user if unable to find)
1. fetch current gas prices via the default RPCs
1. request user to enter an IGP margin in %
1. Calculate the `gasPrice` + `tokenExchangeRate` for you

Note that it still sets `overhead` to some preexisting default. 

```sh
? Select hook type interchainGasPaymaster
Creating interchainGasPaymaster...
? Detected owner address as 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 from signer, is this
correct? yes
? Use this same address for the beneficiary? yes
? Select network type Mainnet
? Select local chain for IGP hook bitlayer
? Select remote destination chains for IGP hook alephzero, ancient8
? Enter overhead for alephzero (e.g., 75000) for IGP hook 75000
? Enter overhead for ancient8 (e.g., 75000) for IGP hook 75000
Getting gas token prices for all chains from Coingecko...
Gas price for alephzero is 40.0
Gas token price for alephzero is $0.393347
Gas price for ancient8 is 0.001000252
Gas token price for ancient8 is $2356.71
Gas price for bitlayer is 0.050000007
Gas token price for bitlayer is $60576
? Enter IGP margin percentage (e.g. 10 for 10%) 100
Created interchainGasPaymaster!
```
```sh
Core config is valid, writing to file ./configs/core-config.yaml:

    owner: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
    defaultIsm:
      type: trustedRelayerIsm
      relayer: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
    defaultHook:
      type: aggregationHook
      hooks:
        - type: merkleTreeHook
        - owner: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
          type: interchainGasPaymaster
          beneficiary: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
          oracleKey: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
          overhead:
            alephzero: 75000
            ancient8: 75000
          oracleConfig:
            alephzero:
              gasPrice: "40000000000"
              tokenExchangeRate: "129868"
            ancient8:
              gasPrice: "1000253"
              tokenExchangeRate: "778100236"
    requiredHook:
      owner: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
      type: protocolFee
      beneficiary: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
      maxProtocolFee: "1000000000000000000"
      protocolFee: "0"

✅ Successfully created new core deployment config.
```

### Drive-by changes

Moving reusable infra logic into the SDK, and refactoring CLI+Infra to
reuse the underlying logic. For example:
- fetching token prices from coingecko
- fetching gas prices using a chain's RPC

### Related issues

Most recently,
hyperlane-xyz/hyperlane-registry#236 (comment).
But there have been numerous occasions where it would be nice for users
to be self-sufficient in configuring and deploying an IGP hook for their
PI deployments/relayer.

### Backward compatibility

yes

### Testing

- creating igp config with `hyperlane core init --advanced`
- making sure infra print-token-prices.ts still works
- making sure infra print-gas-prices.ts still works
paulbalaji added a commit to hyperlane-xyz/hyperlane-monorepo that referenced this pull request Oct 29, 2024
### Description

Re-adding the ability to generate IGP hook configs using the CLI, but
repurposing logic found in infra to make the configuration experience
more ergonomic. Logic still behind the `--advanced` flag.

> Enabling this allows IGP configuration in any place that supports hook
config e.g. `core`/`warp`/`hook` init with `--advanced`.

We will use metadata in registry to:
1. fetch price from Coingecko (prompt user if unable to find)
1. fetch current gas prices via the default RPCs
1. request user to enter an IGP margin in %
1. Calculate the `gasPrice` + `tokenExchangeRate` for you

Note that it still sets `overhead` to some preexisting default. 

```sh
? Select hook type interchainGasPaymaster
Creating interchainGasPaymaster...
? Detected owner address as 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 from signer, is this
correct? yes
? Use this same address for the beneficiary? yes
? Select network type Mainnet
? Select local chain for IGP hook bitlayer
? Select remote destination chains for IGP hook alephzero, ancient8
? Enter overhead for alephzero (e.g., 75000) for IGP hook 75000
? Enter overhead for ancient8 (e.g., 75000) for IGP hook 75000
Getting gas token prices for all chains from Coingecko...
Gas price for alephzero is 40.0
Gas token price for alephzero is $0.393347
Gas price for ancient8 is 0.001000252
Gas token price for ancient8 is $2356.71
Gas price for bitlayer is 0.050000007
Gas token price for bitlayer is $60576
? Enter IGP margin percentage (e.g. 10 for 10%) 100
Created interchainGasPaymaster!
```
```sh
Core config is valid, writing to file ./configs/core-config.yaml:

    owner: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
    defaultIsm:
      type: trustedRelayerIsm
      relayer: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
    defaultHook:
      type: aggregationHook
      hooks:
        - type: merkleTreeHook
        - owner: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
          type: interchainGasPaymaster
          beneficiary: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
          oracleKey: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
          overhead:
            alephzero: 75000
            ancient8: 75000
          oracleConfig:
            alephzero:
              gasPrice: "40000000000"
              tokenExchangeRate: "129868"
            ancient8:
              gasPrice: "1000253"
              tokenExchangeRate: "778100236"
    requiredHook:
      owner: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
      type: protocolFee
      beneficiary: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
      maxProtocolFee: "1000000000000000000"
      protocolFee: "0"

✅ Successfully created new core deployment config.
```

### Drive-by changes

Moving reusable infra logic into the SDK, and refactoring CLI+Infra to
reuse the underlying logic. For example:
- fetching token prices from coingecko
- fetching gas prices using a chain's RPC

### Related issues

Most recently,
hyperlane-xyz/hyperlane-registry#236 (comment).
But there have been numerous occasions where it would be nice for users
to be self-sufficient in configuring and deploying an IGP hook for their
PI deployments/relayer.

### Backward compatibility

yes

### Testing

- creating igp config with `hyperlane core init --advanced`
- making sure infra print-token-prices.ts still works
- making sure infra print-gas-prices.ts still works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants