iroh icon indicating copy to clipboard operation
iroh copied to clipboard

Sync tracking issue

Open Frando opened this issue 2 years ago • 0 comments

This issue contains an overview of known limitations, bugs, missing features and chances for optimization for Iroh sync. It was mostly copied from the original PR overview (#1333) to get started.

Known bugs & limitations

  • [ ] Fix cross-compiles to arm/android. See https://github.com/cross-rs/cross/issues/1311
  • [x] Ensure that we don't block async executors: #1502 Fixed in #1612
  • [x] Make sync propagate through the swarm: #1515
  • [ ] Sync propagation test is flakey #1741

Missing features

  • [x] Add iroh_sync::Store::close_replica: #1495
  • [ ] ~~Implement AuthorImport and AuthorShare RPC & CLI commands~~ maybe let's not do this to and keep authors device-local so we can assume linear inserts
  • [ ] Partial sync and partial download policies for documents
  • [x] Make read-only replicas possible: #1767
  • [ ] #1494

Reliability / performance / optimizations

  • [ ] Make content download reliable and predictable.
    • [x] Propagate content availabilits: #1480
    • [ ] Allow to download missing content from peers / prevent "lost content": #1489
  • [ ] Add basic peer management and persistence. Currently live sync will stop to do anything after a node restart.
    • [x] Remember peers in iroh-net: #1488
    • [x] Persist the addressbook of peers for a document, and reconnect when restarting the node. Likely track "sync policy" per document
    • [ ] Implement PeerAdd and PeerList RPC & CLI commands for a document
  • [ ] Improve algorithm when to sync with which peer. Currently sync runs on initial peer and for each NeighborUp event from the gossip layer. Make sure this reliably syncs often enough, and prevent double syncs. First step is better tracking, see #1491
  • [ ] Make fingerprinting calculation fast and do not allocate for each entry. And/or cache fingerprints to not recalculate everything, always.
  • [ ] sync store list_namespaces and list_authors internally collect, return iterator instead

Security

  • [ ] Use a cryptographic algorithm for fingerprint calculation in place of the current XOR algorithm
  • [ ] Make sure that we never leak the NamespaceId of a document (which is also used as TopicId for gossip), because the NamespaceId gives read-only access to a document.
    • [ ] Maybe make the TopicId a hash of the NamespaceId to reduce the surface of potential exposure?
  • [ ] #1519

Other TODOs collected from the code

  • [ ] Port hammer and fs commands from REPL example to iroh cli
  • [ ] iroh-sync shouldn't depend on iroh-bytes only for Hash type -> #1354
  • [ ] iroh_sync: Remove some items only used in tests (marked with #[cfg(test)])
  • [ ] ranger::SimpleStore::get_range: optimize
  • [ ] ranger::Peer avoid allocs?
  • [ ] fs::StoreInstance::get_fingerprint optimize

Frando avatar Sep 18 '23 11:09 Frando