Skip to content

Commit 622a906

Browse files
authored
Skip ticks due to unsolvable votes (#831)
* Skip 3 ticks to resolve unresolvable ticks * Ignore votes for skip ticks * Bump version
1 parent 1d29a80 commit 622a906

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

src/public_settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static_assert(AUTO_FORCE_NEXT_TICK_THRESHOLD* TARGET_TICK_DURATION >= PEER_REFRE
7070

7171
#define VERSION_A 1
7272
#define VERSION_B 286
73-
#define VERSION_C 0
73+
#define VERSION_C 1
7474

7575
// Epoch and initial tick for node startup
7676
#define EPOCH 208

src/qubic.cpp

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -863,9 +863,28 @@ static void processBroadcastTick(Peer* peer, RequestResponseHeader* header)
863863
}
864864
else
865865
{
866-
// Copy the sent tick to the tick storage
867-
copyMem(tsTick, &request->tick, sizeof(Tick));
868-
peer->lastActiveTick = max(peer->lastActiveTick, peer->getDejavuTick(header->dejavu()));
866+
// HACK: force empty ticks 49124963-49124965 — remove after passing these ticks
867+
bool isOk = true;
868+
if (request->tick.tick == 49124963 || request->tick.tick == 49124964)
869+
{
870+
if (!(isZero(request->tick.transactionDigest) && isZero(request->tick.expectedNextTickTransactionDigest)))
871+
{
872+
isOk = false;
873+
}
874+
}
875+
if (request->tick.tick == 49124965)
876+
{
877+
if (!isZero(request->tick.transactionDigest))
878+
{
879+
isOk = false;
880+
}
881+
}
882+
if (isOk)
883+
{
884+
// Copy the sent tick to the tick storage
885+
copyMem(tsTick, &request->tick, sizeof(Tick));
886+
peer->lastActiveTick = max(peer->lastActiveTick, peer->getDejavuTick(header->dejavu()));
887+
}
869888
}
870889

871890
ts.ticks.releaseLock(request->tick.computorIndex);
@@ -5476,6 +5495,13 @@ static void tickProcessor(void*)
54765495
findNextTickDataDigestFromCurrentTickVotes();
54775496
}
54785497

5498+
// HACK: force empty ticks 49124963-49124965 — remove after passing these ticks
5499+
if (system.tick >= 49124962 && system.tick <= 49124964)
5500+
{
5501+
targetNextTickDataDigest = m256i::zero();
5502+
targetNextTickDataDigestIsKnown = true;
5503+
}
5504+
54795505
ts.tickData.acquireLock();
54805506
copyMem(&nextTickData, &ts.tickData[nextTickIndex], sizeof(TickData));
54815507
ts.tickData.releaseLock();

0 commit comments

Comments
 (0)