Skip to content

Commit 0383fba

Browse files
authored
Increase solution threshold (#817) (#818)
* Increase ADDITION_SOLUTION_THRESHOLD_DEFAULT to 75700 * Switch Sol Threshold based on tick
1 parent 35be049 commit 0383fba

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

src/public_settings.h

Lines changed: 7 additions & 2 deletions
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 285
73-
#define VERSION_C 0
73+
#define VERSION_C 1
7474

7575
// Epoch and initial tick for node startup
7676
#define EPOCH 207
@@ -106,7 +106,12 @@ static constexpr unsigned long long ADDITION_NUMBER_OF_TICKS = 1000;
106106
static constexpr unsigned long long ADDITION_NUMBER_OF_NEIGHBORS = 728; // 2M. Must be divided by 2
107107
static constexpr unsigned long long ADDITION_NUMBER_OF_MUTATIONS = 500;
108108
static constexpr unsigned long long ADDITION_POPULATION_THRESHOLD = ADDITION_NUMBER_OF_INPUT_NEURONS + ADDITION_NUMBER_OF_OUTPUT_NEURONS + ADDITION_NUMBER_OF_MUTATIONS; // P
109-
static constexpr unsigned int ADDITION_SOLUTION_THRESHOLD_DEFAULT = 75200;
109+
static constexpr unsigned int ADDITION_SOLUTION_THRESHOLD_DEFAULT = 75700;
110+
// Mid-epoch threshold increase: ticks before activation use old threshold (75200),
111+
// ticks >= activation use ADDITION_SOLUTION_THRESHOLD_DEFAULT (75700).
112+
// Activation tick is inside XMR marathon where no solutions are submitted.
113+
static constexpr unsigned int ADDITION_SOLUTION_THRESHOLD_PRE_ACTIVATION = 75200;
114+
static constexpr unsigned int ADDITION_SOLUTION_THRESHOLD_ACTIVATION_TICK = 48196000;
110115

111116
// Multipler of score
112117
static constexpr unsigned int HYPERIDENTITY_SOLUTION_MULTIPLER = 1;

src/qubic.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,9 +700,14 @@ static void processBroadcastMessage(const unsigned long long processorNumber, Re
700700
{
701701
unsigned int solutionScore = (*score)(processorNumber, request->destinationPublicKey, solution_miningSeed, solution_nonce);
702702
score_engine::AlgoType selectedAlgo = score_engine::getAlgoType(solution_nonce.m256i_u8);
703-
const int threshold = (system.epoch < MAX_NUMBER_EPOCH) ?
704-
solutionThreshold[system.epoch][selectedAlgo]
703+
int threshold = (system.epoch < MAX_NUMBER_EPOCH) ?
704+
solutionThreshold[system.epoch][selectedAlgo]
705705
: score_engine::DEFAUL_SOLUTION_THRESHOLD[selectedAlgo];
706+
if (selectedAlgo == score_engine::AlgoType::Addition
707+
&& system.tick < ADDITION_SOLUTION_THRESHOLD_ACTIVATION_TICK)
708+
{
709+
threshold = ADDITION_SOLUTION_THRESHOLD_PRE_ACTIVATION;
710+
}
706711
if (system.numberOfSolutions < MAX_NUMBER_OF_SOLUTIONS
707712
&& score->isValidScore(solutionScore, selectedAlgo)
708713
&& score->isGoodScore(solutionScore, threshold, selectedAlgo))
@@ -1413,6 +1418,10 @@ static void processRequestSystemInfo(Peer* peer, RequestResponseHeader* header)
14131418
respondedSystemInfo.randomMiningSeed = score->currentRandomSeed;
14141419
respondedSystemInfo.solutionThreshold = (system.epoch < MAX_NUMBER_EPOCH) ? solutionThreshold[system.epoch][score_engine::AlgoType::HyperIdentity] : HYPERIDENTITY_SOLUTION_THRESHOLD_DEFAULT;
14151420
respondedSystemInfo.solutionAdditionalThreshold = (system.epoch < MAX_NUMBER_EPOCH) ? solutionThreshold[system.epoch][score_engine::AlgoType::Addition] : ADDITION_SOLUTION_THRESHOLD_DEFAULT;
1421+
if (system.tick < ADDITION_SOLUTION_THRESHOLD_ACTIVATION_TICK)
1422+
{
1423+
respondedSystemInfo.solutionAdditionalThreshold = ADDITION_SOLUTION_THRESHOLD_PRE_ACTIVATION;
1424+
}
14161425

14171426
respondedSystemInfo.totalSpectrumAmount = spectrumInfo.totalAmount;
14181427
respondedSystemInfo.currentEntityBalanceDustThreshold = (dustThresholdBurnAll > dustThresholdBurnHalf) ? dustThresholdBurnAll : dustThresholdBurnHalf;
@@ -2761,9 +2770,14 @@ static void processTickTransactionSolution(const MiningSolutionTransaction* tran
27612770
{
27622771
resourceTestingDigest ^= solutionScore;
27632772
KangarooTwelve(&resourceTestingDigest, sizeof(resourceTestingDigest), &resourceTestingDigest, sizeof(resourceTestingDigest));
2764-
const int threshold = (system.epoch < MAX_NUMBER_EPOCH) ?
2773+
int threshold = (system.epoch < MAX_NUMBER_EPOCH) ?
27652774
solutionThreshold[system.epoch][selectedAlgo]
27662775
: score_engine::DEFAUL_SOLUTION_THRESHOLD[selectedAlgo];
2776+
if (selectedAlgo == score_engine::AlgoType::Addition
2777+
&& system.tick < ADDITION_SOLUTION_THRESHOLD_ACTIVATION_TICK)
2778+
{
2779+
threshold = ADDITION_SOLUTION_THRESHOLD_PRE_ACTIVATION;
2780+
}
27672781
if (score->isGoodScore(solutionScore, threshold, selectedAlgo))
27682782
{
27692783
// Solution deposit return

0 commit comments

Comments
 (0)