Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/contract_core/qpi_mining_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ static ScoreFunction<

m256i QPI::QpiContextFunctionCall::computeMiningFunction(const m256i miningSeed, const m256i publicKey, const m256i nonce) const
{
// Score's currentRandomSeed is initialized to zero by setMem(score_qpi, sizeof(*score_qpi), 0)
// If the mining seed changes, we must reinitialize it
if (miningSeed != score_qpi->currentRandomSeed)
{
score_qpi->initMiningData(miningSeed);
}
(*score_qpi)(0, publicKey, miningSeed, nonce);
return score_qpi->getLastOutput(0);
}

void QPI::QpiContextFunctionCall::initMiningSeed(const m256i miningSeed) const
{
score_qpi->initMiningData(miningSeed);
}
1 change: 0 additions & 1 deletion src/contracts/QUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,6 @@ struct QUTIL : public ContractBase
BEGIN_EPOCH()
{
state.dfMiningSeed = qpi.getPrevSpectrumDigest();
qpi.initMiningSeed(state.dfMiningSeed);
}

struct BEGIN_TICK_locals
Expand Down
3 changes: 0 additions & 3 deletions src/contracts/qpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1782,9 +1782,6 @@ namespace QPI
// run the score function (in qubic mining) and return first 256 bit of output
inline m256i computeMiningFunction(const m256i miningSeed, const m256i publicKey, const m256i nonce) const;

// init mining seed for the score function (in qubic mining)
inline void initMiningSeed(const m256i miningSeed) const;

inline bit signatureValidity(
const id& entity,
const id& digest,
Expand Down
4 changes: 2 additions & 2 deletions src/public_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static_assert(AUTO_FORCE_NEXT_TICK_THRESHOLD* TARGET_TICK_DURATION >= PEER_REFRE
// If this flag is 1, it indicates that the whole network (all 676 IDs) will start from scratch and agree that the very first tick time will be set at (2022-04-13 Wed 12:00:00.000UTC).
// If this flag is 0, the node will try to fetch data of the initial tick of the epoch from other nodes, because the tick's timestamp may differ from (2022-04-13 Wed 12:00:00.000UTC).
// If you restart your node after seamless epoch transition, make sure EPOCH and TICK are set correctly for the currently running epoch.
#define START_NETWORK_FROM_SCRATCH 1
#define START_NETWORK_FROM_SCRATCH 0

// Addons: If you don't know it, leave it 0.
#define ADDON_TX_STATUS_REQUEST 0
Expand All @@ -57,7 +57,7 @@ static_assert(AUTO_FORCE_NEXT_TICK_THRESHOLD* TARGET_TICK_DURATION >= PEER_REFRE

#define VERSION_A 1
#define VERSION_B 257
#define VERSION_C 0
#define VERSION_C 1

// Epoch and initial tick for node startup
#define EPOCH 176
Expand Down
Loading