From b3e7a150431120a4f383fb74231e8a91dc280d45 Mon Sep 17 00:00:00 2001 From: dholms Date: Thu, 16 Nov 2023 20:26:24 -0600 Subject: [PATCH] yet more --- packages/pds/src/api/com/atproto/temp/importRepo.ts | 2 ++ packages/repo/src/sync/consumer.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/packages/pds/src/api/com/atproto/temp/importRepo.ts b/packages/pds/src/api/com/atproto/temp/importRepo.ts index 822c00209d5..37eebb4b433 100644 --- a/packages/pds/src/api/com/atproto/temp/importRepo.ts +++ b/packages/pds/src/api/com/atproto/temp/importRepo.ts @@ -110,9 +110,11 @@ const importRepo = async ( : null log.info({ did }, 'pds-v2-debug loaded curr repo') const diff = await verifyDiff(currRepo, blocks, roots[0]) + log.info({ did }, 'pds-v2-debug finished diff') outBuffer.push(`diffed repo and found ${diff.writes.length} writes\n`) diff.commit.rev = rev await actorStore.repo.storage.applyCommit(diff.commit, currRepo === null) + log.info({ did }, 'pds-v2-debug applied commit') const recordQueue = new PQueue({ concurrency: 50 }) let blobRefs: BlobRef[] = [] let count = 0 diff --git a/packages/repo/src/sync/consumer.ts b/packages/repo/src/sync/consumer.ts index 08ca98195f2..af7f51aa6ff 100644 --- a/packages/repo/src/sync/consumer.ts +++ b/packages/repo/src/sync/consumer.ts @@ -8,6 +8,7 @@ import { def } from '../types' import { MST } from '../mst' import { cidForCbor } from '@atproto/common' import BlockMap from '../block-map' +import logger from '../logger' export const verifyRepoCar = async ( carBytes: Uint8Array, @@ -60,13 +61,16 @@ export const verifyDiff = async ( signingKey, ) const diff = await DataDiff.of(updated.data, repo?.data ?? null) + logger.error('pds-v2-debug finished diff') const writes = await util.diffToWriteDescripts(diff, updateBlocks) + logger.error('pds-v2-debug finished diff to write descripts') const newBlocks = diff.newMstBlocks const leaves = updateBlocks.getMany(diff.newLeafCids.toList()) if (leaves.missing.length > 0) { throw new Error(`missing leaf blocks: ${leaves.missing}`) } newBlocks.addMap(leaves.blocks) + logger.error('pds-v2-debug added map') const removedCids = diff.removedCids const commitCid = await newBlocks.add(updated.commit) // ensure the commit cid actually changed