| 351 | } |
| 352 | |
| 353 | async setBlockHeader(header: Header): Promise<void> { |
| 354 | this._blockHeader = header; |
| 355 | |
| 356 | if (this.modelProvider instanceof PlainStoreModelService) { |
| 357 | assert(!this.#transaction, new Error(`Transaction already exists for height: ${header.blockHeight}`)); |
| 358 | |
| 359 | this.#transaction = await this.sequelize.transaction({ |
| 360 | deferrable: this._historical ? undefined : Deferrable.SET_DEFERRED(), |
| 361 | }); |
| 362 | this.#transaction.afterCommit(() => (this.#transaction = undefined)); |
| 363 | } |
| 364 | if (this.config.proofOfIndex) { |
| 365 | this.operationStack = new StoreOperations(this.modelsRelations.models); |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | getOperationMerkleRoot(): Uint8Array { |
| 370 | if (this.config.proofOfIndex) { |