rippled icon indicating copy to clipboard operation
rippled copied to clipboard

URI of list publisher wrong

Open alloynetworks opened this issue 4 years ago • 11 comments

The command rippled validators reports the "uri" as the peer from which it received the UNL over the network. The "uri" should always be that of the list provider, and if we want to report where the server got it from that should be a separate field.

example:

            ],
            "pubkey_publisher" : "ED45D1840EE724BE327ABE9146503D5848EFD5F38B6D5FEDE71E80ACCE5E6E738B",
            "seq" : 2021100701,
            "uri" : "[::ffff:116.202.148.26]:56500",
            "version" : 2
         },

The "uri" value should be "https://vl.xrplf.org"

alloynetworks avatar Oct 07 '21 07:10 alloynetworks

This was an intentional design decision.

The reasoning is that rippled doesn't actually know which list or lists to expect from each site. This is why [validator_list_sites] and [validator_list_keys] are separate stanzas. It's only after rippled downloads, for example, XRPLF's VL from XRPLF's server that XRPLF's server URL is associated with that VL in the uri field.

Thus, when a properly signed and updated VL is received from a peer on the network, that peer is effectively a canonical source. It's pretty unlikely because of runtime startup order, but depending on timing, rippled may never actually download the VL from the configured site.

All that said, this obviously isn't written in stone. Adding a field, and populating it depending on where the relevant function is called from can be done - if it's worth it. The only real risk is that uri could potentially be empty, which may cause confusion, so we'd have to be clear that this scenario is ok and normal.

ximinez avatar Oct 07 '21 14:10 ximinez

It might be a good idea to expand the valid fields in a UNL to include an "authoritative URL" for a given list.

nbougalis avatar Oct 07 '21 20:10 nbougalis

Instead of "uri", a better name for the field might be "source"

intelliot avatar Oct 09 '21 04:10 intelliot

How about we create a new separate field for this? src or url seems like a great fit (src > url).

            ],
            "pubkey_publisher" : "ED45D1840EE724BE327ABE9146503D5848EFD5F38B6D5FEDE71E80ACCE5E6E738B",
            "seq" : 2021100701,
            "uri" : "[::ffff:116.202.148.26]:56500",
            "src" : "https://vl.xrplf.org",
            "version" : 2
         },

wojake avatar Nov 03 '21 15:11 wojake

How about replacing the uri field with source_peer and source_url. The source_peer field would reference the peer that first provided the list, and the source_url field would be filled if the list had ever been downloaded.

edit: source_peer should reference the first peer rather than the most recent that provided the UNL.

undertome avatar Nov 04 '21 18:11 undertome

@wojake You gave a thumbs down - can you be more specific?

undertome avatar Nov 05 '21 15:11 undertome

@undertome I'd go with uri and url, validator maintainers can google up these terms if they don't know what they mean, source_peer and source_url are not easily searchable, I suppose it's not regularly used.

wojake avatar Nov 05 '21 16:11 wojake

Oh, I thought you had a problem with the logic itself. I think the names are fine - the only difference between our name suggestions is that I'm using the term peer rather than uri which I'd say is an improvement since the term peer is used frequently in code and in the documentation. Googling uri doesn't make it clear that in this case we're referring to a peer since uri is an extremely broad term, which actually includes things like urls. Furthermore, anyone familiar with rippled should know what these terms mean, but for those who aren't, in addition to the code changes we would provide documentation for the new fields (hence the labels). As it stands, the field uri is not documented on xrpl.org.

undertome avatar Nov 05 '21 16:11 undertome

Ah I see, alright then LGTM, thanks.

wojake avatar Nov 05 '21 16:11 wojake

How about replacing the uri field with source_peer and source_url. The source_peer field would reference the peer that first provided the list, and the source_url field would be filled if the list had ever been downloaded.

@alloynetworks @WietseWind What do you think of this proposal?

intelliot avatar Nov 05 '21 21:11 intelliot

@intelliot Yes, I like that.

WietseWind avatar Nov 06 '21 23:11 WietseWind