atproto utils for zig zat.dev
atproto sdk zig
Something went wrong. Try again.
mst: keep (cid, encoded) cache consistent in nodeCid master
the encoding-cache commit had a corruption bug: nodeCid (the rootCid path) re-serializes dirty nodes and clears dirty, but did not refresh Node.encoded — so a subsequent collectBlocks paired the NEW cid with the STALE cached bytes. any CAR written after the second commit cycle failed reload with BadBlockHash. nodeCid now caches the encoding alongside the cid. invariant stated in a comment: anything clearing dirty after serializing must keep the (cid, encoded) pair consistent. adds a regression test that runs five put/rootCid/collectBlocks cycles and verifies every emitted block hashes to its declared cid. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author zzstoatzz Co-author Claude Fable 5 Date (Jun 12, 2026, 7:51 PM UTC) Commit 3960e708 3960e708e4fd350c6198eccf9bb9d9208d098292 Parent fa178ee5 fa178ee5136859a89c4643d1fbe74c9ff41a430e