Skip to content

Initial discussion-point commit of proposed InterledgerAddress per IL-RFC 15 #18

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

Merged
merged 3 commits into from
Apr 1, 2017

Conversation

sappenin
Copy link
Contributor

@sappenin sappenin commented Mar 15, 2017

Starting-point PR to discuss a new InterledgerAddress...

…C 15

* Updates InterledgerAdderss definition to conform to RFC 15
* Transitioned to Interface so multiple implementations of InterledgerAddress can exist.
* Made InterledgerAddress immutable
* Made InterledgerAddress implementation disallows null per https://github.com/google/guava/wiki/UsingAndAvoidingNullExplained
* Added unit tests
@adrianhopebailie
Copy link
Collaborator

@sappenin this is great, thanks!

One question, shouldn't it replace the class at: https://github.com/interledger/java-ilp-core/blob/development/src/main/java/org/interledger/ilp/InterledgerAddress.java ?

@sappenin
Copy link
Contributor Author

sappenin commented Mar 15, 2017

@adrianhopebailie Yes, it should. I'll updated the PR via d037add

*/
private static final class InterledgerAddressImpl implements InterledgerAddress {

private static final String REGEX = "(?=^.{1,1023}$)^(g|private|example|peer|self|test[1-3])[.]([a-zA-Z0-9_~-]+[.])*([a-zA-Z0-9_~-]+)?$";
Copy link
Contributor Author

@sappenin sappenin Mar 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does anyone know why it was decided to only allow a certain number of schemes in an InterledgerAddress?

On the one hand, RFC 15 talks about InterledgerAddresses being used for routing, and not having any central authority (sort of like, anything can work in here, as long as it has these alphanumeric characters). But then it adds this restriction around scheme. Anyone know why?

Currently, this implementation doesn't allow a scheme that isn't in the Regex, but it's unclear to me what value the schemes add.

Perhaps this is a question for the mailing list?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this is a question for the mailing list?

Good idea

@sappenin
Copy link
Contributor Author

sappenin commented Mar 15, 2017

@adrianhopebailie In the previous version of InterledgerAddress, there is code relating to IA5 and translation from a byte[] into an InterledgerAddress. Does this need to be kept around? It's not clear to me why an InterledgerAddress would be created from a binary packet of data -- possibly from the binary data packet proposed in 168?

@sappenin sappenin mentioned this pull request Mar 15, 2017
2 tasks
@@ -0,0 +1,70 @@
package org.interledger.core;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR proposes that ILP-Java base classes (like InterledgerAddress.java, for example) be located in the org.interledger.core package.

The rationale is that something like org.interledger.ilp is somewhat redundant. For example, will the Interledger "community" ever publish something that's not ilp? It seems like the answer is no.

The only counter-point to this line of thinking is if the community (under the auspices of org.interledger) decided to publish an implementation of something like a ledger that doesn't support ILP. One might argue that in that case, the org.interledger.ledger package might need to be distinct from org.interledger.ilp.ledger, but I find this type of possibility unlikely, for the primary reason that if somebody wants to be publishing non-ILP components, then probably the org.interledger package is not the appropriate place to do that.

Thoughts?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My rationale for the package naming was that I see org.interledger as the project prefix. There are many aspects to "Interledger" including the ILP protocol but also other protocols like SPSP.

So stuff that is core ILP is in the org.interledger.ilp namespace.

Copy link
Contributor Author

@sappenin sappenin Mar 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting, thanks for clarifying - that makes sense.

I'm open to reverting the package name, but my only remaining concern is that "ILP" and "Interledger Protocol" are semantically equivalent, but we're trying make them mean two different things.

More specifically, the term "ILP" is actually an acronym that expands to "Interledger Protocol" (I think). So, on the one hand we're saying a protocol like "SPSP" (RFC-9) is not "ILP" (RFC-3), yet we're also saying that SPSP is an "Interledger Protocol" or "ILP."

Seems like conceiving of the thing defined in RFC-3 as something like "Interledger Core" or "Interledger Core Protocol" would then allow us to say that SPSP, ILQP, etc are all ILP/Interledger.

Thoughts?

(I'm hesitant to be bike-shedding here, so feel free to respond back with 'hey, revert the package name and log a ticket to discuss later, or never'. I'm just trying form a mental model of how to organize our code.)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're also saying that SPSP is an "Interledger Protocol" or "ILP."

I'd disagree with this. SPSP is a setup protocol and a setup protocol is a prerequisite for making a payment using ILP. i.e. Before you can make an ILP payment you need to know what the ILP Address and amount are that you put in the packet and also the condition to attach to the first transfer.

It's somewhat analogous to DNS vs IP in my mind.

*
* @see "https://github.com/interledger/rfcs/tree/master/0015-ilp-addresses"
*/
public interface InterledgerAddress {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have various teams of people implementing ILP in Java using various types of libraries, this PR proposes to make all of our "core" classes interfaces, so that if somebody doesn't like the community-provided implementation, they would be free to create their own version while being able to utilize it in existing code bases. Hopefully there's no disagreement here.

* Remove old InterledgerAddress class (and unused unit tests)
* Update Javadoc to abide by checkstyle
* Add package-info.java
@mDuo13 mDuo13 changed the title Initial discussion-point commit of proposed InterledgerAddress per RFC 15 Initial discussion-point commit of proposed InterledgerAddress per IL-RFC 15 Mar 16, 2017
* Move core classes back to org.interledger.ilp package per code review comments.
* Improve Javadoc comments.
* Add more unit tests.
@sappenin
Copy link
Contributor Author

sappenin commented Apr 1, 2017

I think the only remaining blocker for committing this PR was the discussion around whether or not to maintain the core package naming of org.interledger.ilp or use something else like org.interledger.core. After much discussion in the RFCs project (see the Converations tabs in RFC PR 181 and IL RFC Issue 180, I've come around to thinking of the thing in IL-RFC-3 as being called ILP.

Thus, I've moved the InterledgerAddress commits that are the main thrust of this PR back into the org.interledger.ilp package. So, I think this is ready to commit. If anyone else has changes or ideas or what-not, please create an issue and we can discuss more there.

@sappenin
Copy link
Contributor Author

sappenin commented Apr 1, 2017

Successful Build here.

@sappenin sappenin merged commit 51127ab into development Apr 1, 2017
@adrianhopebailie
Copy link
Collaborator

Nice job!

@adrianhopebailie adrianhopebailie deleted the feature/address-interface branch April 2, 2017 00:25
adrianhopebailie pushed a commit that referenced this pull request Oct 2, 2017
…-RFC 15 (#18)

* Initial discussion-point commit of proposed InterledgerAddress per RFC 15

* Updates InterledgerAdderss definition to conform to RFC 15
* Transitioned to Interface so multiple implementations of InterledgerAddress can exist.
* Made InterledgerAddress immutable
* Made InterledgerAddress implementation disallows null per https://github.com/google/guava/wiki/UsingAndAvoidingNullExplained
* Added unit tests

* Remove old InterledgerAddress class

* Remove old InterledgerAddress class (and unused unit tests)
* Update Javadoc to abide by checkstyle
* Add package-info.java

* Misc changes per code review comments

* Move core classes back to org.interledger.ilp package per code review comments.
* Improve Javadoc comments.
* Add more unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants