Skip to content

Commit

Permalink
Merge pull request #68 from qubic/develop
Browse files Browse the repository at this point in the history
Fixes for v1.195.1
  • Loading branch information
philippwerner authored Mar 7, 2024
2 parents 214ef62 + e72fe47 commit 38e9bb6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ echo -e "o\nY\nd\nn\n\n\n+200G\n\nt\n\nef00\nw\nY" | gdisk /dev/sda
/efi/boot/startup.nsh
/efi/boot/Qubic.efi
```
- contract.000.XXX => must be the current contract.000 file. XXX must be replaced with the current epoch. (e.g. `computer.068`)
- contract.001.XXX => must be the current contract.001 file. XXX must be replaced with the current epoch. (e.g. `computer.068`). Data from Qx.
- contract.002.XXX => must be the current contract.002 file. XXX must be replaced with the current epoch. (e.g. `computer.068`). Data from Quottery.
- contract000.XXX => must be the current contract #0 file. XXX must be replaced with the current epoch. (e.g. `contract000.068`)
- contract001.XXX => must be the current contract #1 file. XXX must be replaced with the current epoch. (e.g. `contract001.068`). Data from Qx.
- contract002.XXX => must be the current contract #2 file. XXX must be replaced with the current epoch. (e.g. `contract002.068`). Data from Quottery.
- Other contract files with the same format as above. For now, we have 4 contracts.
- universe.XXX => must be the current universe file. XXX must be replaced with the current epoch. (e.g `universe.068`)
- spectrum.XXX => must be the current spectrum file. XXX must be replaced with the current epoch. (e.g `spectrum.068`)
- system => to start from scratch, use an empty file. (e.g. `touch system`)
Expand Down
4 changes: 2 additions & 2 deletions src/public_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

#define VERSION_A 1
#define VERSION_B 195
#define VERSION_C 0
#define VERSION_C 1

#define EPOCH 99
#define TICK 12795000
#define TICK 12820000

// random seed is now obtained from spectrumDigests

Expand Down
11 changes: 6 additions & 5 deletions src/qubic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,9 @@ static void processBroadcastMessage(const unsigned long long processorNumber, Re
}
if (k == system.numberOfSolutions)
{
unsigned int solutionScore = (*score)(processorNumber, request->destinationPublicKey, solution_nonce);
if (system.numberOfSolutions < MAX_NUMBER_OF_SOLUTIONS
&& (*score)(processorNumber, request->destinationPublicKey, solution_nonce) >= (unsigned int)solutionThreshold[system.epoch])
&& ((solutionScore >= (DATA_LENGTH / 2) + solutionThreshold[system.epoch]) || (solutionScore <= (DATA_LENGTH / 2) - solutionThreshold[system.epoch])))
{
ACQUIRE(solutionsLock);

Expand Down Expand Up @@ -1393,7 +1394,7 @@ static void __registerUserProcedure(USER_PROCEDURE userProcedure, unsigned short
{
contractUserProcedures[executedContractIndex][inputType] = userProcedure;
contractUserProcedureInputSizes[executedContractIndex][inputType] = inputSize;
contractUserProcedureInputSizes[executedContractIndex][inputType] = outputSize;
contractUserFunctionOutputSizes[executedContractIndex][inputType] = outputSize;
}

static const m256i& __arbitrator()
Expand Down Expand Up @@ -2111,12 +2112,12 @@ static void processTick(unsigned long long processorNumber)
{
minerSolutionFlags[flagIndex >> 6] |= (1ULL << (flagIndex & 63));

unsigned long long score = (*::score)(processorNumber, transaction->sourcePublicKey, solution_nonce);
unsigned long long solutionScore = (*::score)(processorNumber, transaction->sourcePublicKey, solution_nonce);

resourceTestingDigest ^= score;
resourceTestingDigest ^= solutionScore;
KangarooTwelve(&resourceTestingDigest, sizeof(resourceTestingDigest), &resourceTestingDigest, sizeof(resourceTestingDigest));

if (score >= solutionThreshold[system.epoch])
if (((solutionScore >= (DATA_LENGTH / 2) + solutionThreshold[system.epoch]) || (solutionScore <= (DATA_LENGTH / 2) - solutionThreshold[system.epoch])))
{
for (unsigned int i = 0; i < sizeof(computorSeeds) / sizeof(computorSeeds[0]); i++)
{
Expand Down

0 comments on commit 38e9bb6

Please sign in to comment.