Skip to content

WIP: multi-relay routing#7898

Draft
link2xt wants to merge 4 commits intomainfrom
link2xt/regen-user-id
Draft

WIP: multi-relay routing#7898
link2xt wants to merge 4 commits intomainfrom
link2xt/regen-user-id

Conversation

@link2xt
Copy link
Collaborator

@link2xt link2xt commented Feb 25, 2026

This way we can place whatever we want into signature.

Closes #7865 once finished, the idea is to put all relay addresses into notation subpacket of the primary user ID signature.

TODO:

  • Fix tests/test_multitransport.py::test_download_on_demand. It is currently broken because receiving the same pre-message second time results in trashing the second pre-message and replacing first pre-message, so essentially the message that already existed as a pre-message gets trashed. Then you get problem from Post-message resulted in receive_imf failure #7872 when post-message download is automatically requested, but pre-message got trashed.
  • Bring back all the commented out signature subpackets or decide to drop them. SEIPDv2 feature is needed, we also want to recognize it and start sending SEIPDv2 if everyone supports it. Preferred algorithms and hashes practically just increase the signature size at the moment.
  • Have some way to update contact public key (aka OpenPGP certificate). Currently (as of 2.44.0) we never update public keys from Autocrypt header. Simple way to fix this is to accept updates, but only from the signed messages and remember the timestamp, so it is impossible to e.g. forge an update with dropped encryption subkey. But we also want to update from Autocrypt-Gossip, this will need more careful merging, e.g. keeping old certificate but replacing user ID with the one that has highest timestamp on the signature. Currently I just trust the updates from Autocrypt header. EDIT: implemented certificate merging
  • Merge certificates when vCard is imported as well.
  • Only update the signature timestamp when actual changes happen to avoid leaking app start time, save the timestamp somewhere in the config
  • Have some limit on the number of relays we take from the key, take no more than two or three relays.
  • Online Python test that after removing primary relay user can still receive messages. Currently it works already but message is assigned to ad hoc group because the message is not recognized as sent to us. This is supposed to work via "intended recipient fingerprint" (e.g. fix: receive_imf: Look up key contact by intended recipient fingerprint (#7661) #7786) but something does not work. The problem is apparently caused by not stopping IMAP loop when deleting the transport.
  • Per-context lock around prefetching (IMAP loop) or around receive_imf. Currently multitransport tests with download on demand fail because two IMAP loops receive the same messages and download them in parallel and this is not handled properly.

@link2xt link2xt force-pushed the link2xt/regen-user-id branch 3 times, most recently from 722e3e6 to 5be3918 Compare February 25, 2026 22:06
@link2xt link2xt force-pushed the link2xt/regen-user-id branch 3 times, most recently from d810ee5 to e0744da Compare February 27, 2026 01:17
Base automatically changed from link2xt/keypair to main February 28, 2026 16:27
@link2xt link2xt force-pushed the link2xt/regen-user-id branch 2 times, most recently from 79a7943 to 895db47 Compare March 1, 2026 22:40
@link2xt link2xt changed the base branch from main to link2xt/qkzzkkylmtmk March 1, 2026 22:42
@link2xt link2xt force-pushed the link2xt/regen-user-id branch from 895db47 to 48a715b Compare March 2, 2026 03:30
@link2xt link2xt force-pushed the link2xt/qkzzkkylmtmk branch from a3deffe to 37e02ee Compare March 2, 2026 03:30
Base automatically changed from link2xt/qkzzkkylmtmk to main March 2, 2026 16:39
@link2xt link2xt force-pushed the link2xt/regen-user-id branch 3 times, most recently from 527561e to fa350fb Compare March 2, 2026 21:20
@link2xt link2xt self-assigned this Mar 2, 2026
@link2xt link2xt force-pushed the link2xt/regen-user-id branch 8 times, most recently from 1b13ddd to 5554654 Compare March 3, 2026 02:55
@link2xt link2xt changed the title WIP: regenerate signed user ID in memory WIP: multi-relay routing Mar 4, 2026
link2xt added 3 commits March 4, 2026 15:18
This way we can place whatever we want into the signatures.

We put all relay addresses as a notation subpacket
in the direct key signature to distribute the relay addresses.
@link2xt link2xt force-pushed the link2xt/regen-user-id branch from 5554654 to 9260fd5 Compare March 4, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Distribute information about relays in the key signature

1 participant