-
Notifications
You must be signed in to change notification settings - Fork 9
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
Hyperlane Developer Experience Demo #90
Open
nambrot
wants to merge
3
commits into
ethereum-optimism:main
Choose a base branch
from
hyperlane-xyz:nambrot/hyperlane-devex-demo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Hyperlane DevEx Demo | ||
|
||
This document outlines a demo of what the developer experience could be when using Hyperlane as a wrapper over OP's Native Interop. | ||
|
||
## Context | ||
|
||
OP's Native Interop allows developers to send cross-chain messages and native msg.value without taking on additional trust assumptions (beyond what the rollups themselves take on). However, a challenging aspect of any cross-chain messaging protocol is the need for the 2nd executing transaction. In Hyperlane's experience, exposing that complexity to users is very undesirable, and in practice a dedicated entity has to take on this task (and be paid for it). This demo showcases how a Hyperlane wrapper could allow Hyperlane relayers (which are completely permissionless) to do that work for OP native interop developers. | ||
|
||
This demo demonstrates the basic ergonomics for developers and how a relayer would work. Additional improvements to the demonstration including integrating the actual native interop trust assumptions are marked under [Future Improvements](#future-improvements) | ||
|
||
## Setup | ||
|
||
1. Follow the `supersim` setup guide and run supersim with `./main` | ||
2. Install the hyperlane cli `npm install -g @hyperlane-xyz/[email protected]` | ||
3. Set the private key for usage in subsequent demand in our shell. We are going to use the last default account (since the earlier ones seem to have nonce issues) `export HYP_KEY=0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6` | ||
4. Deploy Hyperlane on OpChainA `hyperlane core deploy --chain opchaina --yes --overrides ./hyperlane-registry` | ||
5. Deploy Hyperlane on OpChainB `hyperlane core deploy --chain opchainb --yes --overrides ./hyperlane-registry` | ||
6. In a separate process (with the key again set as per Step 3.), you can run the relayer with `hyperlane relayer --chains opchaina,opchainb --overrides $(pwd)/hyperlane-registry`. | ||
7. Send a message via Hyperlane with `hyperlane send message --origin opchaina --destination opchainb --body "Hello from OpChainA" --overrides $(pwd)/hyperlane-registry`. This will call the [`Mailbox#dispatch`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/Mailbox.sol#L102) function (think of it similar to CrossDomainMessenger's sendMessage function) with a [`TestRecipient`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/f7333794883759dda9dc45b1ce56ce2452e93785/solidity/contracts/test/TestRecipient.sol#L30) as the receiver of that message. You should observe that the relayer automatically processes the previously dispatched message, without the message sender (i.e. the application), nor the user needing to do anything on the destination chain. | ||
|
||
|
||
|
||
## Future Improvements | ||
|
||
- Actually integrate Native Interop as a Interchain Security Module (ISM) | ||
- Integrate with TicTacToe.sol to show integration | ||
- Deploy Interchain Gas Paymaster to demonstrate seamless relayer payments by the message sender |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
defaultHook: | ||
type: merkleTreeHook | ||
defaultIsm: | ||
relayer: "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720" | ||
type: trustedRelayerIsm | ||
owner: "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720" | ||
requiredHook: | ||
beneficiary: "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720" | ||
maxProtocolFee: "100000000000000000" | ||
owner: "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720" | ||
protocolFee: "0" | ||
type: protocolFee | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# yaml-language-server: $schema=../schema.json | ||
chainId: 900 | ||
displayName: L1 | ||
domainId: 900 | ||
isTestnet: true | ||
name: l1 | ||
nativeToken: | ||
decimals: 18 | ||
name: Ether | ||
symbol: ETH | ||
protocol: ethereum | ||
rpcUrls: | ||
- http: http://localhost:8545 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# yaml-language-server: $schema=../schema.json | ||
chainId: 901 | ||
displayName: Opchaina | ||
domainId: 901 | ||
isTestnet: true | ||
name: opchaina | ||
nativeToken: | ||
decimals: 18 | ||
name: Ether | ||
symbol: ETH | ||
protocol: ethereum | ||
rpcUrls: | ||
- http: http://localhost:9545 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# yaml-language-server: $schema=../schema.json | ||
chainId: 902 | ||
displayName: Opchainb | ||
domainId: 902 | ||
isTestnet: true | ||
name: opchainb | ||
nativeToken: | ||
decimals: 18 | ||
name: Ether | ||
symbol: ETH | ||
protocol: ethereum | ||
rpcUrls: | ||
- http: http://localhost:9546 |
Binary file not shown.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've been spelling it "DevX", can this be changed? I can't rename the Discord channel, I know that's DevEx but its an outlier. 😄