Skip to content

Commit f71a621

Browse files
committed
formatting
1 parent 810624e commit f71a621

2 files changed

Lines changed: 47 additions & 36 deletions

File tree

src/state-manager/AccountPatcher.ts

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,8 @@ class AccountPatcher {
17531753
for (const chunk of report.summary.chunks) {
17541754
if (chunk.recordsProcessed > 0) {
17551755
res.write(
1756-
`Chunk ${chunk.chunkIndex}: ${chunk.recordsProcessed} records in ${chunk.timeSpentMs
1756+
`Chunk ${chunk.chunkIndex}: ${chunk.recordsProcessed} records in ${
1757+
chunk.timeSpentMs
17571758
}ms (${chunk.low.substring(0, 4)}...)\n`
17581759
)
17591760
}
@@ -1784,9 +1785,7 @@ class AccountPatcher {
17841785
res.write(` Cache: [missing]\n`)
17851786
}
17861787
if (account.trie) {
1787-
res.write(
1788-
` Trie: hash=${account.trie.hash.substring(0, 8)}...\n`
1789-
)
1788+
res.write(` Trie: hash=${account.trie.hash.substring(0, 8)}...\n`)
17901789
} else {
17911790
res.write(` Trie: [missing]\n`)
17921791
}
@@ -1797,9 +1796,7 @@ class AccountPatcher {
17971796
} else {
17981797
res.write(` Storage: [missing]\n`)
17991798
}
1800-
res.write(
1801-
` Matches: cth=${account.cth} cst=${account.cst} csh=${account.csh} tsh=${account.tsh}\n\n`
1802-
)
1799+
res.write(` Matches: cth=${account.cth} cst=${account.cst} csh=${account.csh} tsh=${account.tsh}\n\n`)
18031800
}
18041801
}
18051802
}
@@ -2451,7 +2448,8 @@ class AccountPatcher {
24512448
if (coverageEntry == null || coverageEntry.firstChoice == null) {
24522449
const numActiveNodes = this.stateManager.currentCycleShardData.nodes.length
24532450
this.statemanager_fatal(
2454-
`getNodeForQuery null ${coverageEntry == null} ${coverageEntry?.firstChoice == null
2451+
`getNodeForQuery null ${coverageEntry == null} ${
2452+
coverageEntry?.firstChoice == null
24552453
} numActiveNodes:${numActiveNodes}`,
24562454
`getNodeForQuery null ${coverageEntry == null} ${coverageEntry?.firstChoice == null}`
24572455
)
@@ -2969,7 +2967,8 @@ class AccountPatcher {
29692967
/* prettier-ignore */ nestedCountersInstance.countEvent(`accountPatcher`, `not enough votes ${radix} ${utils.makeShortHash(votesMap.bestHash)} uniqueVotes: ${votesMap.allVotes.size}`, 1)
29702968
this.statemanager_fatal(
29712969
'debug findBadAccounts',
2972-
`debug findBadAccounts ${cycle}: ${radix} bestVotes${votesMap.bestVotes
2970+
`debug findBadAccounts ${cycle}: ${radix} bestVotes${
2971+
votesMap.bestVotes
29732972
} < minVotes:${minVotes} uniqueVotes: ${votesMap.allVotes.size} ${utils.stringifyReduce(simpleMap)}`
29742973
)
29752974
}
@@ -3037,8 +3036,10 @@ class AccountPatcher {
30373036
}
30383037
this.statemanager_fatal(
30393038
'debug findBadAccounts',
3040-
`debug findBadAccounts ${cycle}: ${radixToFix.radix
3041-
} isInNonConsensusRange: ${hasNonConsensusRange} isInNonStorageRange: ${hasNonStorageRange} bestVotes ${votesMap.bestVotes
3039+
`debug findBadAccounts ${cycle}: ${
3040+
radixToFix.radix
3041+
} isInNonConsensusRange: ${hasNonConsensusRange} isInNonStorageRange: ${hasNonStorageRange} bestVotes ${
3042+
votesMap.bestVotes
30423043
} minVotes:${minVotes} uniqueVotes: ${votesMap.allVotes.size} ${utils.stringifyReduce(simpleMap)}`
30433044
)
30443045
}
@@ -3792,7 +3793,8 @@ class AccountPatcher {
37923793

37933794
if (logFlags.debug) {
37943795
this.mainLogger.debug(
3795-
`badAccounts cycle: ${cycle}, ourBadAccounts: ${results.badAccounts.length
3796+
`badAccounts cycle: ${cycle}, ourBadAccounts: ${
3797+
results.badAccounts.length
37963798
}, ourBadAccounts: ${Utils.safeStringify(results.badAccounts)}`
37973799
)
37983800
}
@@ -3802,7 +3804,8 @@ class AccountPatcher {
38023804
accountsTheyNeedToRepair = accountsTheyNeedToRepair.concat(results.extraBadAccounts)
38033805
}
38043806
this.mainLogger.debug(
3805-
`badAccounts cycle: ${cycle}, accountsTheyNeedToRepair: ${accountsTheyNeedToRepair.length
3807+
`badAccounts cycle: ${cycle}, accountsTheyNeedToRepair: ${
3808+
accountsTheyNeedToRepair.length
38063809
}, accountsTheyNeedToRepair: ${Utils.safeStringify(accountsTheyNeedToRepair)}`
38073810
)
38083811
fireAndForget(() => this.requestOtherNodesToRepair(accountsTheyNeedToRepair))
@@ -3874,7 +3877,8 @@ class AccountPatcher {
38743877
'checkAndSetAccountData updateTooOld',
38753878
`checkAndSetAccountData updateTooOld ${cycle}: acc:${utils.stringifyReduce(
38763879
wrappedData.accountId
3877-
)} updateTS:${wrappedData.timestamp} updateHash:${utils.stringifyReduce(wrappedData.stateId)} cacheTS:${accountMemData.t
3880+
)} updateTS:${wrappedData.timestamp} updateHash:${utils.stringifyReduce(wrappedData.stateId)} cacheTS:${
3881+
accountMemData.t
38783882
} cacheHash:${utils.stringifyReduce(accountMemData.h)}`
38793883
)
38803884
filterStats.tooOld++
@@ -4091,7 +4095,8 @@ class AccountPatcher {
40914095
)
40924096
this.statemanager_fatal(
40934097
'isInSync = false',
4094-
`bad accounts cycle:${cycle} bad:${results.badAccounts.length} received:${wrappedDataList.length} failedH: ${failedHashes.length
4098+
`bad accounts cycle:${cycle} bad:${results.badAccounts.length} received:${wrappedDataList.length} failedH: ${
4099+
failedHashes.length
40954100
} filtered:${utils.stringifyReduce(filterStats)} stats:${utils.stringifyReduce(
40964101
results.stats
40974102
)} getAccountStats: ${utils.stringifyReduce(getAccountStats)} details: ${utils.stringifyReduceLimit(
@@ -4677,7 +4682,8 @@ class AccountPatcher {
46774682
}
46784683

46794684
stream.write(
4680-
`node: ${nodesCovered.id} ${nodesCovered.ipPort}\tgraph: ${partitionGraph}\thome: ${nodesCovered.hP
4685+
`node: ${nodesCovered.id} ${nodesCovered.ipPort}\tgraph: ${partitionGraph}\thome: ${
4686+
nodesCovered.hP
46814687
} data:${Utils.safeStringify(nodesCovered)}\n`
46824688
)
46834689
}

src/state-manager/index.ts

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -375,18 +375,16 @@ class StateManager {
375375
// Log a few example mismatched accounts (first 5)
376376
if (report.accounts) {
377377
const mismatchedAccounts = report.accounts
378-
.filter(
379-
(account) =>
380-
!account.cth || !account.cst || !account.csh || !account.tsh
381-
)
378+
.filter((account) => !account.cth || !account.cst || !account.csh || !account.tsh)
382379
.slice(0, 5)
383380

384381
for (const account of mismatchedAccounts) {
385382
this.logger
386383
.getLogger('main')
387384
.info(
388-
`Mismatch example: ${account.accountId.substring(0, 16)}... - Matches: cth=${account.cth
389-
} cst=${account.cst} csh=${account.csh} tsh=${account.tsh}`
385+
`Mismatch example: ${account.accountId.substring(0, 16)}... - Matches: cth=${account.cth} cst=${
386+
account.cst
387+
} csh=${account.csh} tsh=${account.tsh}`
390388
)
391389
}
392390
}
@@ -1469,8 +1467,9 @@ class StateManager {
14691467
}
14701468

14711469
if (queueEntry == null) {
1472-
response.note = `failed to find queue entry: ${utils.stringifyReduce(deserialized.txid)} ${deserialized.timestamp
1473-
} dbg:${this.debugTXHistory[utils.stringifyReduce(deserialized.txid)]}`
1470+
response.note = `failed to find queue entry: ${utils.stringifyReduce(deserialized.txid)} ${
1471+
deserialized.timestamp
1472+
} dbg:${this.debugTXHistory[utils.stringifyReduce(deserialized.txid)]}`
14741473
respond(response, serializeRequestReceiptForTxResp)
14751474
return
14761475
}
@@ -1488,8 +1487,9 @@ class StateManager {
14881487
if (response.receipt != null) {
14891488
response.success = true
14901489
} else {
1491-
response.note = `found queueEntry but no receipt: ${utils.stringifyReduce(deserialized.txid)} ${deserialized.txid
1492-
} ${deserialized.timestamp}`
1490+
response.note = `found queueEntry but no receipt: ${utils.stringifyReduce(deserialized.txid)} ${
1491+
deserialized.txid
1492+
} ${deserialized.timestamp}`
14931493
}
14941494
respond(response, serializeRequestReceiptForTxResp)
14951495
} catch (e) {
@@ -1627,15 +1627,17 @@ class StateManager {
16271627
queueEntry = this.transactionQueue.getQueueEntryArchived(txId, route)
16281628
}
16291629
if (queueEntry == null) {
1630-
response.note = `failed to find queue entry: ${utils.stringifyReduce(txId)} dbg:${this.debugTXHistory[utils.stringifyReduce(txId)]
1631-
}`
1630+
response.note = `failed to find queue entry: ${utils.stringifyReduce(txId)} dbg:${
1631+
this.debugTXHistory[utils.stringifyReduce(txId)]
1632+
}`
16321633
/* prettier-ignore */ nestedCountersInstance.countEvent('stateManager', `${route} cant find queue entry`)
16331634
return respond(response, serializeRequestStateForTxPostResp)
16341635
}
16351636

16361637
if (queueEntry.hasValidFinalData === false) {
1637-
response.note = `has queue entry but not final data: ${utils.stringifyReduce(txId)} dbg:${this.debugTXHistory[utils.stringifyReduce(txId)]
1638-
}`
1638+
response.note = `has queue entry but not final data: ${utils.stringifyReduce(txId)} dbg:${
1639+
this.debugTXHistory[utils.stringifyReduce(txId)]
1640+
}`
16391641

16401642
if (logFlags.error && logFlags.verbose) this.mainLogger.error(response.note)
16411643
/* prettier-ignore */ nestedCountersInstance.countEvent('stateManager', `${route} hasValidFinalData==false, tx state: ${queueEntry.state}`)
@@ -1830,8 +1832,9 @@ class StateManager {
18301832
}
18311833

18321834
if (queueEntry == null) {
1833-
response.note = `failed to find queue entry: ${utils.stringifyReduce(txid)} dbg:${this.debugTXHistory[utils.stringifyReduce(txid)]
1834-
}`
1835+
response.note = `failed to find queue entry: ${utils.stringifyReduce(txid)} dbg:${
1836+
this.debugTXHistory[utils.stringifyReduce(txid)]
1837+
}`
18351838

18361839
if (logFlags.error) this.mainLogger.error(`${route} ${response.note}`)
18371840
respond(response, serializeRequestTxAndStateResp)
@@ -1932,8 +1935,9 @@ class StateManager {
19321935
}
19331936

19341937
if (queueEntry == null) {
1935-
response.note = `failed to find queue entry: ${utils.stringifyReduce(txid)} dbg:${this.debugTXHistory[utils.stringifyReduce(txid)]
1936-
}`
1938+
response.note = `failed to find queue entry: ${utils.stringifyReduce(txid)} dbg:${
1939+
this.debugTXHistory[utils.stringifyReduce(txid)]
1940+
}`
19371941

19381942
if (logFlags.error) this.mainLogger.error(`${route} ${response.note}`)
19391943
respond(response, serializeRequestTxAndStateResp)
@@ -1962,8 +1966,9 @@ class StateManager {
19621966
if (beforeState && beforeState.stateId === receipt2.proposal.beforeStateHashes[index]) {
19631967
response.stateList.push(queueEntry.collectedData[accountId])
19641968
} else {
1965-
response.note = `has bad beforeStateAccount: ${utils.stringifyReduce(txid)} dbg:${this.debugTXHistory[utils.stringifyReduce(txid)]
1966-
}`
1969+
response.note = `has bad beforeStateAccount: ${utils.stringifyReduce(txid)} dbg:${
1970+
this.debugTXHistory[utils.stringifyReduce(txid)]
1971+
}`
19671972
if (logFlags.error) this.mainLogger.error(`${route} ${response.note}`)
19681973
respond(response, serializeRequestTxAndStateResp)
19691974
return

0 commit comments

Comments
 (0)