diem / dip

Libra Improvement Proposals
https://lip.libra.org
Apache License 2.0
40 stars 55 forks source link

Should HTTP end point URL contain local/remote address (for LIP-1 and beyond) ? #85

Closed longbowlu closed 3 years ago

longbowlu commented 3 years ago

HTTP end point in LIP-1 specifies that HTTP urls has the following format:

https://<hostname>:<port>/<protocol_version>/<LocalVASPAddress>/<RemoteVASPAddress>/command

It has been causing some confusion of what LocalVASPAddress and RemoteVASPAddress means and it is sort of easy to mix them up. As this URL will also be used in other off chain related LIPs, it's worth discussing whether we want to keep them in the URL.

Pros:

  1. easier (VASPs/DDs) for users to do load balancing: users can forward the request to right tiers according to from address and/or to address. Without this, users need to parse the JWS message to get these info.

Cons:

  1. easy to mistake one with the other
  2. makes the URL longer

I also think it's worthwhile discussing whether we put protocol_version in the front or rear (i.e. after command). Because as we add protocols in the future, more keywords will be introduced (e.g. pay in Libra ID). Logically we want them each to have a version (easier for iterating).

cc @kphfb , @gdanezis , @xli , @sunmilee , @andll , @bmaurer

andll commented 3 years ago

To be honest I don't buy point 1 - I don't understand how would VASP/DD do load balancing based on to/from and why would they do that

Additionally, I am not sure why do we need LocalVASPAddress - don't VASP know who they are?

I think for the version general guideline should be having it as early as possible (ideally first part of the path part of the URL) Reason for this is quite simple - maybe in some future version we will decide to change this Local/remote/command part, so it would be easier to reason about if version goes first.

kphfb commented 3 years ago

I agree with removing it also. Version early also makes sense. Let's make it happen

longbowlu commented 3 years ago

Closing this as we agreed to remove addresses in url and placing version early.