Skip to content
Draft
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
1 change: 1 addition & 0 deletions src/state-manager/AccountSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,7 @@ class AccountSync {
queueEntry.txGroupDebug = `${before} -> ${queueEntry.ourNodeInTransactionGroup}`

//if(queueEntry.ourNodeInTransactionGroup === true){
/* prettier-ignore */ if (logFlags.dapp_verbose) console.log(`[my-log] TX moving to aging phase - txId:${queueEntry.acceptedTx.txId} timestamp:${queueEntry.txKeys.timestamp} accounts:${queueEntry.txKeys.allKeys.length}`)
this.stateManager.transactionQueue.updateTxState(queueEntry, 'aging')
queueEntry.didWakeup = true
this.stateManager.transactionQueue.updateHomeInformation(queueEntry)
Expand Down
1 change: 1 addition & 0 deletions src/state-manager/TransactionQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6303,6 +6303,7 @@ class TransactionQueue {
// We wait in the aging phase, and mark accounts as seen to prevent a TX that is after this from using or changing data
// on the accounts in this TX
// note that code much earlier in the loop rejects any queueEntries younger than time M
/* prettier-ignore */ if (logFlags.dapp_verbose) console.log(`[processTransactions] TX finishing aging phase, moving to processing - txId:${queueEntry.acceptedTx.txId} timestamp:${queueEntry.txKeys?.timestamp} ageTime:${shardusGetTime() - queueEntry.txKeys?.timestamp}ms`)
this.updateTxState(queueEntry, 'processing')
this.processQueue_markAccountsSeen(seenAccounts, queueEntry)
}
Expand Down
5 changes: 5 additions & 0 deletions src/state-manager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2801,15 +2801,18 @@ class StateManager {

// If enabled, check the RI cache first
if (opts.useRICache) {
/* prettier-ignore */ if (logFlags.dapp_verbose) console.log(`[getLocalOrRemoteAccount] Checking RI cache - addr:${address}`)
const riCacheResult = await this.app.getCachedRIAccountData([address])
if (riCacheResult != null) {
if (riCacheResult.length > 0) {
/* prettier-ignore */ if (logFlags.dapp_verbose) console.log(`[getLocalOrRemoteAccount] RI cache HIT - addr:${address} data:${riCacheResult[0] != null}`)
nestedCountersInstance.countEvent('stateManager', 'getLocalOrRemoteAccount: RI cache hit')
if (logFlags.verbose) this.mainLogger.debug(`getLocalOrRemoteAccount: RI cache hit for ${address}`)
wrappedAccount = riCacheResult[0] as ShardusTypes.WrappedDataFromQueue
return wrappedAccount
}
} else {
/* prettier-ignore */ if (logFlags.dapp_verbose) console.log(`[getLocalOrRemoteAccount] RI cache MISS - addr:${address}`)
nestedCountersInstance.countEvent('stateManager', 'getLocalOrRemoteAccount: RI cache miss')
}
}
Expand All @@ -2834,6 +2837,7 @@ class StateManager {
}

if (accountIsRemote) {
/* prettier-ignore */ if (logFlags.dapp_verbose) console.log(`[getLocalOrRemoteAccount] Account is REMOTE - addr:${address} useRICache:${opts.useRICache} canThrow:${opts.canThrowException}`)
let randomConsensusNode: P2PTypes.NodeListTypes.Node
const preCheckLimit = 5
for (let i = 0; i < preCheckLimit; i++) {
Expand Down Expand Up @@ -2937,6 +2941,7 @@ class StateManager {
}
} else {
// we are local!
/* prettier-ignore */ if (logFlags.dapp_verbose) console.log(`[getLocalOrRemoteAccount] Account is LOCAL - addr:${address} useRICache:${opts.useRICache}`)
const accountData = await this.app.getAccountDataByList([address])
if (accountData != null) {
for (const wrappedAccountEntry of accountData) {
Expand Down
Loading