Skip to content

Commit

Permalink
further debug and fix the beacon sync sim test and get it working
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Aug 18, 2024
1 parent bbb140b commit 23fd13f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/blockchain/src/blockchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,12 @@ export class Blockchain implements BlockchainInterface {
)
}

if (this._validateBlocks && !isGenesis && item instanceof Block && optimisticOpts === undefined) {
if (
this._validateBlocks &&
!isGenesis &&
item instanceof Block &&
optimisticOpts === undefined
) {
// this calls into `getBlock`, which is why we cannot lock yet
await this.validateBlock(block)
}
Expand Down
2 changes: 2 additions & 0 deletions packages/client/test/sync/skeleton.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ describe('[Skeleton] / initSync', async () => {
storageCache: 1000,
})
const chain = await Chain.create({ config })
;(chain.blockchain as any)._validateBlocks = false
const skeleton = new Skeleton({ chain, config, metaDB: new MemoryLevel() })
await skeleton.open()

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

0 comments on commit 23fd13f

Please sign in to comment.