Our Personal Data Server from scratch! tranquil.farm

Set a maximum record size #654

Merged jola.dev
targeting main from jola.dev/tranquil-pds:johanna/validate-record-size
Merged opened by and assigned to jola.dev
targeting main from jola.dev/tranquil-pds:johanna/validate-record-size

Left an explanation in the code as well but basically although the spec doesn't set a hard limit on the size of a CBOR record, there is a hard limit on individual commit event record blocks in the sync 1.1 spec. indigo-relay doesn't seem to validate the size of your commits, but hits a hard limit in the websocket library if the commit is too large, causing the connection to drop and instantly reconnect.

I had a 10MiB record on my PDS and I had 9 relays hammering my server constantly trying to backfill that same event and choking on it over and over, until I cleaned it up.

With this PR tranquil introduces a 1MB limit on CBOR records, ensuring we don't go over the per block limit on records, and definitely don't go over by 9MB. Separately we need to ensure we don't pack more than 1MB worth of blocks in a commit.

Commits 0