diff --git a/src/state-manager/TransactionQueue.ts b/src/state-manager/TransactionQueue.ts index 5b01bcadb..c4c7021c0 100644 --- a/src/state-manager/TransactionQueue.ts +++ b/src/state-manager/TransactionQueue.ts @@ -1448,6 +1448,12 @@ class TransactionQueue { * @param queueEntry */ async commitConsensedTransaction(queueEntry: QueueEntry): Promise { + // Debug flag to intentionally skip committing account data + if (this.stateManager.debugFailToCommit) { + /* prettier-ignore */ if (logFlags.debug) this.mainLogger.debug(`debugFailToCommit active. Skipping commit for tx: ${queueEntry.logID}`) + queueEntry.accountDataSet = true + return { success: true } + } let ourLockID = -1 let accountDataList: string | unknown[] let uniqueKeys = [] diff --git a/src/state-manager/index.ts b/src/state-manager/index.ts index e6a2b8500..fff939cb5 100644 --- a/src/state-manager/index.ts +++ b/src/state-manager/index.ts @@ -184,6 +184,7 @@ class StateManager { debugNoTxVoting: boolean debugSkipPatcherRepair: boolean + debugFailToCommit: boolean ignoreRecieptChance: number ignoreVoteChance: number @@ -341,6 +342,7 @@ class StateManager { this.processCycleSummaries = false //starts false and get enabled when startProcessingCycleSummaries() is called this.debugSkipPatcherRepair = config.debug.skipPatcherRepair + this.debugFailToCommit = false this.feature_receiptMapResults = true this.feature_partitionHashes = true @@ -1292,6 +1294,16 @@ class StateManager { this.partitionStats.setupHandlers() + // Debug endpoint to toggle fail-to-commit flag + Context.network.registerExternalGet('debugFailToCommit', isDebugModeMiddleware, (req, res) => { + const { enable } = req.query + if (enable !== undefined) { + const val = enable === 'true' || enable === '1' + this.debugFailToCommit = val + } + res.json({ debugFailToCommit: this.debugFailToCommit }) + }) + // p2p ASK // this.p2p.registerInternal( // 'request_receipt_for_tx_old',