hyperlane-xyz / hyperlane-monorepo

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

Scope: deploy Warp Routes without interacting with contracts #1870

Open nambrot opened 1 year ago

nambrot commented 1 year ago

Context

Router Pattern

Solution

From Nam: "We probably should continue the convo on one of those tickets, but IMO there are multiple paths open with different tradeoffs to make the creation of warp routes more accessible:

1) Create a warp route factory contract + UI https://github.com/hyperlane-xyz/issues/issues/1005 Notion spec 2) Make the existing CLI command more accessible 3) Improve our internal posture to deploying warp routes 4) Deputize somebody like hyperlane-india

These options have drastically different scope and it's critical for us to understand the longer-range implications of the paths we want to go down. I would suspect that we all share the same end goal of having one-click interop, but how to get there is just as important if not more"

from Nam in Discord: "i was thinking that that an intermediate step could be to have the relayer pass msg.value and then use it as a cross-chain faucet effectively"

### Related issues
- [ ] https://github.com/hyperlane-xyz/issues/issues/1005
- [ ] https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/1879
- [ ] https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/3498
asaj commented 1 year ago

You could imagine defining a warp route config that specifies:

The hash of this config is the warp route ID.

Each WarpRouteRouter could have an init() function that:

The init function could have an init and initWithOverrides. For the former you use the default routers/ISMs, for the latter you override them

Upon receipt of this message, the remote routers:

ERC20.transferRemote(destination, value, recipient) would:

The warp route router ISM would be a routing ism:

Something like this would allow us to preserve essentially the existing Warp Route API but with the following advantages:

With this design I'm not sure how exactly you would allow expansion of a warp route to incorporate e.g. a new chain but I imagine it can be done, I haven't given this design a ton of thought. There is also probably a better design, this comment is mainly intended to be illustrative.

Gas payments are also not in scope for this design

nambrot commented 1 year ago

Very cool, i can see the strokes of what you have been working on with ICAs in here. This does kinda remind me that I think it would probably be helpful to have documentation and diagrams for both ICAs and then something like WarpRouteRouter because it's a bit harder for me to build all these entities in my head and build a mental model.

I assume that is fine for now, but if you are looking for more specific feedback, I can try to wrap my head around and probably ask more thoughtful questions

asaj commented 1 year ago

I'm not looking for specific feedback on this design, I'm sure there's a better way to do it.

I'm sharing a strawman more to illustrate the advantages of rebuilding Warp Routes in the "interoperable router" pattern, in the hopes that we will choose to prioritize design and implementation.

nambrot commented 1 year ago

From a different issue (can't remember which one): how do you set IGPs on the remote chain?

asaj commented 1 year ago

From a different issue (can't remember which one): how do you set IGPs on the remote chain?

While I have ideas, I want to avoid this devolving into a design discussion. That sounds like a good problem for whomever winds up working on this to solve.

nambrot commented 1 year ago

From a different issue (can't remember which one): how do you set IGPs on the remote chain?

While I have ideas, I want to avoid this devolving into a design discussion. That sounds like a good problem for whomever winds up working on this to solve.

Gotcha makes sense. Do you think that someone should do a design first (i.e. this ticket), and then an implementation later (a different ticket after the design is socialized), or is this one where it should just be done in one swoop? In either scenario, what would you currently estimate the complexity in engineering days to be?

asaj commented 1 year ago

I don't care whether it's one ticket or two, but design should probably come before implementation. Estimate depends on the scope of what we consider "implemented" to be

nambrot commented 1 year ago

KK, i made this the design/investigate ticket then. Do you think 1 day is a reasonable estimate?

asaj commented 1 year ago

Thought a bit more about this on a walk and made some clarifications to the design

jmrossy commented 1 year ago

The list of supported domains The hash of this config is the warp route ID.

@asaj Would this prevent adding/removing domains to a warp route deployment?

nambrot commented 1 year ago

Gas payments are also not in scope for this design

Do you mean that they should not be in scope, i.e. payments should be considered a separate problem, or more not in scope as in "not yet part of the design", but something to figure out?

I also wonder if it would help to reduce the scope to be able to make some simplifying assumptions. IMO, it actually would be useful to maintain that warp route contracts are ownable everywhere to do things like upgrades, ISM changes, router enrollments, IGP changes. IMO the thing to optimize for over the current state is the deployment experience, where ideally you only need a single origin chain tx. A related simplification we imo could make is to have path independence betewen the synthetics, the primary use case is still for the PI chain deployer. (router enrollment could always be done separately) Could we avoid the need for the ID/config hashing in that case?