Skip to content

Commit f1dba27

Browse files
committed
further debug and fix the beacon sync sim test and get it working
1 parent 733bb38 commit f1dba27

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/blockchain/src/blockchain.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,12 @@ export class Blockchain implements BlockchainInterface {
378378
)
379379
}
380380

381-
if (this._validateBlocks && !isGenesis && item instanceof Block && optimisticOpts === undefined) {
381+
if (
382+
this._validateBlocks &&
383+
!isGenesis &&
384+
item instanceof Block &&
385+
optimisticOpts === undefined
386+
) {
382387
// this calls into `getBlock`, which is why we cannot lock yet
383388
await this.validateBlock(block)
384389
}

packages/client/test/sync/skeleton.spec.ts

+2
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ describe('[Skeleton] / initSync', async () => {
242242
storageCache: 1000,
243243
})
244244
const chain = await Chain.create({ config })
245+
;(chain.blockchain as any)._validateBlocks = false
245246
const skeleton = new Skeleton({ chain, config, metaDB: new MemoryLevel() })
246247
await skeleton.open()
247248

@@ -359,6 +360,7 @@ describe('[Skeleton] / setHead', async () => {
359360
storageCache: 1000,
360361
})
361362
const chain = await Chain.create({ config })
363+
;(chain.blockchain as any)._validateBlocks = false
362364
const skeleton = new Skeleton({ chain, config, metaDB: new MemoryLevel() })
363365
await skeleton.open()
364366
for (const block of testCase.blocks ?? []) {

0 commit comments

Comments
 (0)