Skip to content
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

Make origin field go away #374

Open
turt2live opened this issue Sep 6, 2018 · 15 comments
Open

Make origin field go away #374

turt2live opened this issue Sep 6, 2018 · 15 comments
Labels
A-S2S Server-to-Server API (federation) wart A point where the protocol is inconsistent or inelegant

Comments

@turt2live
Copy link
Member

turt2live commented Sep 6, 2018

Updated by @richvdh 2023/05/30:

origin is specced but redundant in:

For completeness: origin is also specced as part of the X-Matrix authentication mechanism, where it is not redundant.


Related: matrix-org/synapse#3816

@turt2live turt2live added wart A point where the protocol is inconsistent or inelegant A-S2S Server-to-Server API (federation) labels Sep 6, 2018
@turt2live
Copy link
Member Author

Worth noting that the spec at one point said that the origin of a transaction is to be overwritten by the sending server's domain name, however this text has gone missing. In the end, it just reinforces the fact that the field should go away.

If/when the change is made, there should probably be a note about origin being a historical field that the server should ignore, otherwise people might make the same mistake as synapse despite the field being missing from the spec.

@richvdh
Copy link
Member

richvdh commented Nov 20, 2020

also: send_join is supposed to have an origin (see https://matrix.org/docs/spec/server_server/r0.1.4#put-matrix-federation-v2-send-join-roomid-eventid), though synapse doesn't actually send it (matrix-org/synapse#8786)

@ShadowJonathan
Copy link
Contributor

Does this need an MSC to remove?

@turt2live
Copy link
Member Author

yes

@richvdh richvdh transferred this issue from matrix-org/matrix-spec-proposals Mar 1, 2022
@richvdh
Copy link
Member

richvdh commented Mar 11, 2022

It seems that there already exist some implementations which do not include an origin on their outgoing PDUs, and Synapse does not insist on its presence on incoming events. I'm therefore leaning to the idea that the presence of the field in the spec should be considered a spec bug.

@turt2live
Copy link
Member Author

can the same consideration be made for transaction.origin?

@richvdh
Copy link
Member

richvdh commented Mar 11, 2022

Possibly, but if there are any implementations that omit transaction.origin, there's more room to argue that such an implementation is buggy (since transactions aren't persisted to a room DAG)

@richvdh richvdh changed the title Make transaction.origin and pdu.origin optional/go away Make transaction.origin go away Sep 26, 2022
@richvdh richvdh changed the title Make transaction.origin go away Make origin field go away Sep 26, 2022
@jplatte
Copy link
Contributor

jplatte commented Oct 11, 2022

Re.

the body of a send_join request

I'm seeing an origin field in other places:

  • The response fields of GET /make_knock/{roomId}/{userId}
  • The response fields of GET /make_leave/{roomId}/{userId}
  • The Room State object (used in the response of PUT /send_join/{roomId}/{eventId})
  • The InviteEvent object (used in request and response of PUT /invite/{roomId}/{eventId})

Are some of these also redundant?

@richvdh
Copy link
Member

richvdh commented Oct 12, 2022

Possibly, but if there are any implementations that omit transaction.origin, there's more room to argue that such an implementation is buggy (since transactions aren't persisted to a room DAG)

I'm having a hard time deciphering this. I think what I meant was: any implementation that does not send transaction.origin is buggy, and:

The difference between transaction.origin and pdu.origin is that the ecosystem already has to deal with missing pdu.origin.

This is because Synapse does not enforce the presence of pdu.origin, and will therefore happily relay events that have no origin to other servers. In other words: if, when you receive a pdu, you insist on origin, then you cut yourself off from whole rooms; if you insist on transaction.origin, you only cut yourself off from the one server that is failing to send them.

@richvdh
Copy link
Member

richvdh commented Oct 12, 2022

Re.

the body of a send_join request

I'm seeing an origin field in other places:

  • The response fields of GET /make_knock/{roomId}/{userId}

  • The response fields of GET /make_leave/{roomId}/{userId}

  • The Room State object (used in the response of PUT /send_join/{roomId}/{eventId})

  • The InviteEvent object (used in request and response of PUT /invite/{roomId}/{eventId})

Are some of these also redundant?

Links to the relevant parts of the spec would be useful, but off the top of my head: they sound like they are just special cases of pdu.origin.

@richvdh
Copy link
Member

richvdh commented May 30, 2023

Re.

the body of a send_join request

I'm seeing an origin field in other places:

* The response fields of `GET /make_knock/{roomId}/{userId}`

* The response fields of `GET /make_leave/{roomId}/{userId}`

* The `Room State` object (used in the response of `PUT /send_join/{roomId}/{eventId}`)

* The `InviteEvent` object (used in request and response of `PUT /invite/{roomId}/{eventId}`)

Are some of these also redundant?

@jplatte I found most of these references and updated the description accordingly, but I can't find what you mean with respect to the Room State object (I even looked at older spec versions). Can you provide a link to help me out?

@jplatte
Copy link
Contributor

jplatte commented May 30, 2023

The response of PUT /_matrix/federation/v1/send_join/{roomId}/{eventId} is

Array of integer, Room State.

And the spec also uses the name "Room State" for the entire response object of the v2 endpoint. This object contains an origin field.

@richvdh
Copy link
Member

richvdh commented May 30, 2023

The response of PUT /_matrix/federation/v1/send_join/{roomId}/{eventId} is

Array of integer, Room State.

And the spec also uses the name "Room State" for the entire response object of the v2 endpoint. This object contains an origin field.

Ok, that sounds like what I mean by "the body of v1 and v2 /send_join responses" in the description, so I think we've got everything on your list. Thanks!

@jplatte
Copy link
Contributor

jplatte commented May 30, 2023

Ah yes, I guess just wrote all that I found, "other places" was wrong and misleading.

@richvdh
Copy link
Member

richvdh commented May 30, 2023

Ah yes, I guess just wrote all that I found, "other places" was wrong and misleading.

To be honest I think that instance probably wasn't listed at the time you added your update - we just both found it independently! Anyway no worries, we're on the same page now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-S2S Server-to-Server API (federation) wart A point where the protocol is inconsistent or inelegant
Projects
None yet
Development

No branches or pull requests

5 participants