Skip to content

Commit

Permalink
Merge pull request #230 from qubic/develop
Browse files Browse the repository at this point in the history
Release/v1.228.0
  • Loading branch information
Franziska-Mueller authored Dec 4, 2024
2 parents 4a85c33 + b0349ec commit b086d09
Show file tree
Hide file tree
Showing 12 changed files with 694 additions and 427 deletions.
6 changes: 0 additions & 6 deletions src/contract_core/contract_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,11 @@ struct __FunctionOrProcedureBeginEndGuard
#undef CONTRACT_STATE_TYPE
#undef CONTRACT_STATE2_TYPE

#ifndef NO_QVAULT
#define QVAULT_CONTRACT_INDEX 10
#define CONTRACT_INDEX QVAULT_CONTRACT_INDEX
#define CONTRACT_STATE_TYPE QVAULT
#define CONTRACT_STATE2_TYPE QVAULT2
#include "contracts/QVAULT.h"
#endif

#define MAX_CONTRACT_ITERATION_DURATION 0 // In milliseconds, must be above 0; for now set to 0 to disable timeout, because a rollback mechanism needs to be implemented to properly handle timeout

Expand Down Expand Up @@ -215,9 +213,7 @@ constexpr struct ContractDescription
{"SWATCH", 123, 10000, sizeof(IPO)},
{"CCF", 127, 10000, sizeof(CCF)}, // proposal in epoch 125, IPO in 126, construction and first use in 127
{"QEARN", 137, 10000, sizeof(QEARN)}, // proposal in epoch 135, IPO in 136, construction in 137 / first donation after END_EPOCH, first round in epoch 138
#ifndef NO_QVAULT
{"QVAULT", 138, 10000, sizeof(IPO)}, // proposal in epoch 136, IPO in 137, construction and first use in 138
#endif
};

constexpr unsigned int contractCount = sizeof(contractDescriptions) / sizeof(contractDescriptions[0]);
Expand Down Expand Up @@ -303,7 +299,5 @@ static void initializeContracts()
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(SWATCH);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(CCF);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(QEARN);
#ifndef NO_QVAULT
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(QVAULT);
#endif
}
2 changes: 1 addition & 1 deletion src/contracts/Quottery.h
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ struct QUOTTERY : public ContractBase
return;
}

diffDateInSecond(locals.curDate, locals.endDate, locals.i0, locals.u64_0, locals.u64_1, locals.duration);
diffDateInSecond(locals.endDate, locals.curDate, locals.i0, locals.u64_0, locals.u64_1, locals.duration);
locals.duration = div(locals.duration, 3600ULL * 24);
if (locals.duration < 2)
{
Expand Down
7 changes: 7 additions & 0 deletions src/contracts/Qx.h
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,13 @@ struct QX : public ContractBase
state._tradeFee = 5000000; // 0.5%
_

BEGIN_EPOCH

// TODO: Remove this and the following 2 lines after epoch 138 has begun
state._transferFee = 100;
state._tradeFee = 3000000; // 0.3%
_

END_TICK
if ((div((state._earnedAmount - state._distributedAmount), 676ULL) > 0) && (state._earnedAmount > state._distributedAmount))
{
Expand Down
17 changes: 8 additions & 9 deletions src/public_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
// Config options that should NOT be changed by operators

#define VERSION_A 1
#define VERSION_B 227
#define VERSION_B 228
#define VERSION_C 0

// Epoch and initial tick for node startup
#define EPOCH 137
#define TICK 17420000
#define EPOCH 138
#define TICK 17560000

#define ARBITRATOR "AFZPUAIYVPNUYGJRQVLUKOPPVLHAZQTGLYAAUUNBXFTVTAMSBKQBLEIEPCVJ"

Expand All @@ -65,14 +65,13 @@ static unsigned short UNIVERSE_FILE_NAME[] = L"universe.???";
static unsigned short SCORE_CACHE_FILE_NAME[] = L"score.???";
static unsigned short CONTRACT_FILE_NAME[] = L"contract????.???";

static unsigned short REVENUE_FILE_NAME[] = L"revenueScore"; // TODO: for testing purpose, will delete at epoch 111

#define DATA_LENGTH 256
#define NUMBER_OF_HIDDEN_NEURONS 10000
#define NUMBER_OF_NEIGHBOR_NEURONS 10000
#define MAX_DURATION 100000000
#define NUMBER_OF_HIDDEN_NEURONS 3000
#define NUMBER_OF_NEIGHBOR_NEURONS 3000
#define MAX_DURATION 9000000
#define NUMBER_OF_OPTIMIZATION_STEPS 30
#define NEURON_VALUE_LIMIT 1LL
#define SOLUTION_THRESHOLD_DEFAULT 45
#define SOLUTION_THRESHOLD_DEFAULT 130

#define SOLUTION_SECURITY_DEPOSIT 1000000

Expand Down
6 changes: 4 additions & 2 deletions src/qubic.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#define SINGLE_COMPILE_UNIT

//#define NO_QVAULT

// contract_def.h needs to be included first to make sure that contracts have minimal access
#include "contract_core/contract_def.h"
#include "contract_core/contract_exec.h"
Expand Down Expand Up @@ -190,6 +188,7 @@ static ScoreFunction<
NUMBER_OF_HIDDEN_NEURONS,
NUMBER_OF_NEIGHBOR_NEURONS,
MAX_DURATION,
NUMBER_OF_OPTIMIZATION_STEPS,
NUMBER_OF_SOLUTION_PROCESSORS
> * score = nullptr;
static volatile char solutionsLock = 0;
Expand Down Expand Up @@ -2237,6 +2236,7 @@ static void processTickTransaction(const Transaction* transaction, const m256i&
}
}

#pragma optimize("", off)
static void processTick(unsigned long long processorNumber)
{
if (system.tick > system.initialTick)
Expand Down Expand Up @@ -2666,6 +2666,8 @@ static void processTick(unsigned long long processorNumber)
updateAndAnalzeEntityCategoryPopulations();
}

#pragma optimize("", on)

static void beginEpoch()
{
// This version doesn't support migration from contract IPO to contract operation!
Expand Down
Loading

0 comments on commit b086d09

Please sign in to comment.