Skip to content

Commit

Permalink
Merge pull request #261 from qubic/develop (Release v1.230.2)
Browse files Browse the repository at this point in the history
Release v1.230.2
  • Loading branch information
Franziska-Mueller authored Jan 3, 2025
2 parents 2289eda + dbcde5b commit d4ed421
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 15 deletions.
8 changes: 5 additions & 3 deletions src/logging/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ class qLogger
inline static BlobInfo* mapLogIdToBufferIndex = NULL;
inline static unsigned long long logBufferTail;
inline static unsigned long long logId;
inline static unsigned int tickBegin;
inline static unsigned int tickBegin; // initial tick of the epoch
inline static unsigned int tickLoadedFrom; // tick that this node load from (save/load state feature)
inline static unsigned int currentTxId;
inline static unsigned int currentTick;
inline static BlobInfo currentTxInfo;
Expand Down Expand Up @@ -471,7 +472,7 @@ class qLogger
return false;
}
}
reset(0);
reset(0, 0);
#endif
return true;
}
Expand All @@ -497,14 +498,15 @@ class qLogger
#endif
}

static void reset(unsigned int _tickBegin)
static void reset(unsigned int _tickBegin, unsigned int _tickLoadedFrom)
{
#if ENABLED_LOGGING
logBuf.init();
tx.init();
logBufferTail = 0;
logId = 0;
tickBegin = _tickBegin;
tickLoadedFrom = _tickLoadedFrom;
#endif
}

Expand Down
35 changes: 28 additions & 7 deletions src/logging/net_msg_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,18 @@ void qLogger::processRequestTxLogInfo(Peer* peer, RequestResponseHeader* header)
)
{
ResponseLogIdRangeFromTx resp;
BlobInfo info = tx.getLogIdInfo(request->tick, request->txId);
resp.fromLogId = info.startIndex;
resp.length = info.length;
if (request->tick < tickLoadedFrom)
{
// unknown logging because the whole node memory is loaded from files
resp.fromLogId = -2;
resp.length = -2;
}
else
{
BlobInfo info = tx.getLogIdInfo(request->tick, request->txId);
resp.fromLogId = info.startIndex;
resp.length = info.length;
}
enqueueResponse(peer, sizeof(ResponseLogIdRangeFromTx), ResponseLogIdRangeFromTx::type, header->dejavu(), &resp);
return;
}
Expand All @@ -100,12 +109,24 @@ void qLogger::processRequestTickTxLogInfo(Peer* peer, RequestResponseHeader* hea
{
ResponseAllLogIdRangesFromTick resp;
int txId = 0;
for (txId = 0; txId < LOG_TX_PER_TICK; txId++)
if (request->tick < tickLoadedFrom)
{
BlobInfo info = tx.getLogIdInfo(request->tick, txId);
resp.fromLogId[txId] = info.startIndex;
resp.length[txId] = info.length;
// unknown logging because the whole node memory is loaded from files
for (txId = 0; txId < LOG_TX_PER_TICK; txId++)
{
resp.fromLogId[txId] = -2;
resp.length[txId] = -2;
}
}
else
{
for (txId = 0; txId < LOG_TX_PER_TICK; txId++)
{
BlobInfo info = tx.getLogIdInfo(request->tick, txId);
resp.fromLogId[txId] = info.startIndex;
resp.length[txId] = info.length;
}
}
enqueueResponse(peer, sizeof(ResponseAllLogIdRangesFromTick), ResponseAllLogIdRangesFromTick::type, header->dejavu(), &resp);
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/public_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@

#define VERSION_A 1
#define VERSION_B 230
#define VERSION_C 1
#define VERSION_C 2

// Epoch and initial tick for node startup
#define EPOCH 141
#define TICK 18017311
#define EPOCH 142
#define TICK 18168941

#define ARBITRATOR "AFZPUAIYVPNUYGJRQVLUKOPPVLHAZQTGLYAAUUNBXFTVTAMSBKQBLEIEPCVJ"

Expand Down
4 changes: 2 additions & 2 deletions src/qubic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2282,7 +2282,7 @@ static void processTick(unsigned long long processorNumber)

if (system.tick == system.initialTick)
{
logger.reset(system.initialTick); // clear logs here to give more time for querying and persisting the data when we do seamless transition
logger.reset(system.initialTick, system.initialTick); // clear logs here to give more time for querying and persisting the data when we do seamless transition
logger.registerNewTx(system.tick, logger.SC_INITIALIZE_TX);
contractProcessorPhase = INITIALIZE;
contractProcessorState = 1;
Expand Down Expand Up @@ -3410,7 +3410,7 @@ static bool loadAllNodeStates()

#if ENABLED_LOGGING
logToConsole(L"Initializing logger");
logger.reset(system.initialTick); // initialize the logger
logger.reset(system.initialTick, system.tick); // initialize the logger
#endif
return true;
}
Expand Down

0 comments on commit d4ed421

Please sign in to comment.