DavidBuchanan314/picopds

Implement Repo V3

DavidBuchanan314 opened this issue · 1 comments

https://atproto.com/specs/repository#repo-data-structure-v3

  • Add rev field
  • Add since field
  • Drop prev field entirely (no backwards compat here!) (EDIT: turns out the BGS does not like this!) (EDIT 2: The spec is being updated, the field is now mandatory but nullable)
  • Tangentially related: correct this variable name (it should say micros)
    nanos = int(time.time()*1000000)

Edit: None of the stuff below here was actually related to V3. I'll leave it here for reference, though.

  • Start deleting "stale" blocks from sqlite, the moment they're no longer referenced (i.e. don't bother trying to keep history)
  • Stop bothering to store old commits, only keep the most recent one
  • Add firehose history cursoring (not strictly related to V3 but ought to be an easy change)

Stretch goals (requires general refactoring - might move these to their own issue):

  • Stop holding the whole MST in-memory, use sqlite with LRU cache
  • Unify/deduplicate code in repo create_record and delete_record methods
  • Add a proper put_record codepath
  • Implement applyWrites
  • Switch to using did:web? It's less centralised than did:plc and ought to be easier to make it Just Work

Milestone: we have enough implemented to resume federation with the sandbox!

tbh the rest of the stuff I listed should probably be moved to a new issue