Skip to content

Commit ae55576

Browse files
authored
client: Fix double runs of the block execution (ethereumjs#2730)
* client: Fix double runs of the block execution * fix comment * clear cache is the vmhead not at parent stateroot * run iterator inside the runwithlock to prevent entanglement with runWithoutSetHead or setHead * fix lint
1 parent 9c8f407 commit ae55576

File tree

5 files changed

+301
-170
lines changed

5 files changed

+301
-170
lines changed

packages/blockchain/src/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ export interface BlockchainInterface {
6262
*/
6363
getIteratorHead?(name?: string): Promise<Block>
6464

65+
/**
66+
* Set header hash of a certain `tag`.
67+
* When calling the iterator, the iterator will start running the first child block after the header hash currently stored.
68+
* @param tag - The tag to save the headHash to
69+
* @param headHash - The head hash to save
70+
*/
71+
setIteratorHead(tag: string, headHash: Uint8Array): Promise<void>
72+
6573
/**
6674
* Gets total difficulty for a block specified by hash and number
6775
*/

0 commit comments

Comments
 (0)