Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/state-manager/TransactionQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,12 @@ class TransactionQueue {
* @param queueEntry
*/
async commitConsensedTransaction(queueEntry: QueueEntry): Promise<CommitConsensedTransactionResult> {
// 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 = []
Expand Down
12 changes: 12 additions & 0 deletions src/state-manager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class StateManager {

debugNoTxVoting: boolean
debugSkipPatcherRepair: boolean
debugFailToCommit: boolean

ignoreRecieptChance: number
ignoreVoteChance: number
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand Down
Loading