Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more debug logs RED-79 #33

Merged
merged 1 commit into from
Apr 30, 2024
Merged
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
2 changes: 2 additions & 0 deletions src/p2p/CycleCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ async function cycleCreator() {

/* prettier-ignore */ if (logFlags.verbose) info(`cc: scheduling currentCycle:${currentCycle} ${callTag} ${startQ1}`)

if (config.debug.cycleRecordOOSDebugLogs) console.log(`CycleCreator: Cycle ${currentCycle} started`)

schedule(runQ1, startQ1, { runEvenIfLateBy: quarterDuration - 1 * SECOND }) // if there's at least one sec before Q2 starts, we can start Q1 now
schedule(runQ2, startQ2)
schedule(runQ3, startQ3)
Expand Down
9 changes: 7 additions & 2 deletions src/p2p/Join/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ const gossipSyncFinishedRoute: P2P.P2PTypes.GossipHandler<P2P.JoinTypes.Finished
if (config.debug.cycleRecordOOSDebugLogs) {
if (receivedSyncFinished.has(payload.nodeId) === false) {
receivedSyncFinished.set(payload.nodeId, true)
console.log('DEBUG CR-OOS: payload id: ', payload.nodeId)
console.log('DEBUG CR-OOS: payload id: ', payload.nodeId, ' payload cycle: ', payload.cycleNumber, 'cC: ', CycleCreator.currentCycle, ' cQ: ', CycleCreator.currentQuarter)
}
}

Expand All @@ -508,7 +508,12 @@ const gossipSyncFinishedRoute: P2P.P2PTypes.GossipHandler<P2P.JoinTypes.Finished
// Validate payload in addFinishedSyncing
const addFinishedSyncingResult = addFinishedSyncing(payload)
nestedCountersInstance.countEvent('p2p', `sync-finished validation success: ${addFinishedSyncingResult.success}`)
if (!addFinishedSyncingResult.success) nestedCountersInstance.countEvent('p2p', `sync-finished failure reason: ${addFinishedSyncingResult.reason}`)
if (!addFinishedSyncingResult.success) {
if (addFinishedSyncingResult.reason !== 'node has already submitted syncFinished request') {
if (config.debug.cycleRecordOOSDebugLogs) console.log('DEBUG CR-OOS: gossipSyncFinished rejected: ', addFinishedSyncingResult.reason, ' payload id: ', payload.nodeId, ' payload cycle: ', payload.cycleNumber)
}
nestedCountersInstance.countEvent('p2p', `sync-finished failure reason: ${addFinishedSyncingResult.reason}`)
}
if (addFinishedSyncingResult.success) {
Comms.sendGossip('gossip-sync-finished', payload, tracker, sender, NodeList.byIdOrder, false)
} else {
Expand Down
Loading