Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
June 05, 2019, 02:13:18 PM Last edit: June 09, 2019, 12:28:47 PM by Deff |
|
New version available CACHE-Project, Adding new features and correcting errors in the balance calculation Version : v_6.1.1.29 Version of git : v_0.7.5.147 Subversion : v_0.7.6.41
|
|
|
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
June 09, 2019, 01:08:46 PM |
|
New version available CACHE-Project, Changing the parameters of the "setcontrolrealtime" function. Implemented stop the transfer of a chain of blocks in case of a socket error Version : v_6.1.1.30 Version of git : v_0.7.5.149 Subversion : v_0.7.6.42
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 04, 2019, 07:50:56 AM |
|
Готовящиеся изменения ... 1) При совпадении траста сеть не будет ждать дочку от конкурирующих цепочек. Побеждает блок с большим или меньшим хеш значением. Какое из них использовать высчитывается так-же по большему или меньшему значению хеш предыдущих блоков. // New best if (pindexNew->bnChainTrust > bnBestChainTrust) { if (!SetBestChain(state, txdb, pindexNew)) return false; } else if (pindexNew->bnChainTrust == bnBestChainTrust && fHardForkOne && pindexPrevPos->GetBlockHash() >= pindexPrevPrevPos->GetBlockHash()) { printf(" 'CBlock' - BestChainTrust %s\n", bnBestChainTrust.ToString().c_str()); printf(" 'CBlock' - NewChainTrust %s\n", pindexNew->bnChainTrust.ToString().c_str()); if (((pindexNew->IsProofOfStake() && pindexBest->IsProofOfStake()) ? (pindexNew->GetBlockHash() > pindexBest->GetBlockHash()) : (hash > pindexBest->GetBlockHash())) || (pindexBest->IsProofOfWork() && pindexNew->IsProofOfStake())) { printf(" 'CBlock' bnChainTrust = bnBestChainTrust - Block accepted\n"); if (!SetBestChain(state, txdb, pindexNew)) { return false; } } else { printf(" 'CBlock' bnChainTrust = bnBestChainTrust - Block not accepted\n"); return false; } } else if (pindexNew->bnChainTrust == bnBestChainTrust && fHardForkOne && pindexPrevPos->GetBlockHash() < pindexPrevPrevPos->GetBlockHash()) { printf(" 'CBlock_' - BestChainTrust %s\n", bnBestChainTrust.ToString().c_str()); printf(" 'CBlock_' - NewChainTrust %s\n", pindexNew->bnChainTrust.ToString().c_str()); if (((pindexNew->IsProofOfStake() && pindexBest->IsProofOfStake()) ? (pindexNew->GetBlockHash() < pindexBest->GetBlockHash()) : (hash < pindexBest->GetBlockHash())) || (pindexBest->IsProofOfWork() && pindexNew->IsProofOfStake())) { printf(" 'CBlock' bnChainTrust = bnBestChainTrust - Block accepted\n"); if (!SetBestChain(state, txdb, pindexNew)) { return false; } } else { printf(" 'CBlock' bnChainTrust = bnBestChainTrust - Block not accepted\n"); return false; } } txdb.Close();
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 04, 2019, 07:55:00 AM |
|
Готовящиеся изменения ...
2) Изменение минимально-допустимого значения сложности, адаптировано под NF19 - 20
/ min = 0.00024 -> 0.00000096 /
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 04, 2019, 08:14:32 AM Last edit: November 04, 2019, 08:47:10 AM by Deff |
|
Готовящиеся изменения ... 3) Встречаются ситуации когда цепочка блоков с более поздней временной меткой но большим трастом заменяет собой ранее найденную цепочку. Считаю это уязвимостью с возможностью манипуляций с сетью. В обновлении цепочки блоков с более поздней временной меткой теряют набранный траст. CBlockIndex* pblockindex = NULL; int nPossibleHeight = pindexNew->pprev->nHeight + 1; if (fDebug) printf(" 'AddToBlockIndex()' - The new block pretends to a height %d, block chain height %d\n", nPossibleHeight, pindexBest->nHeight);
if (nPossibleHeight < pindexBest->nHeight && fHardForkOne) { if (nPossibleHeight <= pindexBest->nHeight - nTriggerDepth) { if (fDebug) printf(" 'AddToBlockIndex()' - The new block pretends to a height %d, maximum allowed block height for a competing chain %d\n", nPossibleHeight, pindexBest->nHeight - nTriggerDepth); pindexNew->bnChainTrust = 0;
}
pblockindex = FindBlockByHeight(nPossibleHeight); if (pindexNew->GetBlockTime() > pblockindex->GetBlockTime()) { if (fDebug) printf(" 'AddToBlockIndex()' - Generation time of a new block date=%s later than available in the database date=%s\n", DateTimeStrFormat("%x %H:%M:%S", pindexNew->GetBlockTime()).c_str(), DateTimeStrFormat("%x %H:%M:%S", pblockindex->GetBlockTime()).c_str()); pindexNew->bnChainTrust = 0; } else if (pindexNew->GetBlockTime() < pblockindex->GetBlockTime()) { if (nPossibleHeight < pindexBest->nHeight && nPossibleHeight > pindexBest->nHeight - nTriggerDepth) { if (fDebug) printf(" 'AddToBlockIndex()' - The generation time of a new block date=%s earlier than the one in the database date=%s\n", DateTimeStrFormat("%x %H:%M:%S", pindexNew->GetBlockTime()).c_str(), DateTimeStrFormat("%x %H:%M:%S", pblockindex->GetBlockTime()).c_str()); bnBestChainTrust = pblockindex->pprev->bnChainTrust; } } }
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 07, 2019, 11:46:23 AM |
|
Доработал идею, в результате получился новый алгоритм.. Сравнение траста сейчас происходит только при совпадении временных меток конкурирующих блоков - это считаю самым правильным решением. Теперь поиск возможного ветвления происходит постоянно с приходом каждой новой информации о блоке, глубина по умолчанию установлена в 50 блоков, но в файле конфигурации можно указывать абсолютно любую глубину поиска. При нахождении вилки в лог заносится информация о родительском блоке, точнее высота этого блока, далее выясняется хеш и временные метки конкурирующих блоков дочек. Побеждает блок с более ранней временной меткой у цепочки с поздней меткой траст устанавливается равным=0. Далее появилась возможность создавать виртуальные децентрализованные контрольные точки, их можно брать непосредственно из цепочки блоков при обнаружении возможного ветвления и удерживать до окончания такой возможности, но это позже. Алгоритм интересно показывает себя на тестах. Для тестов использую четыре кошелька, один кошелек генерит POW, два кошелка POS и один пассивный. Кошельки с POS искусственно постоянно подвисают и теряют связь между собой. Также кошельки имеют только один коннект с одним общим тормозным POS кошельком. Сеть постоянно реорганизуется с потерей блоков или не длинных цепочек - двоения не происходит. При всем этом в пассивном кошельке нет ни одного потерянного блока..
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 07, 2019, 11:48:42 AM |
|
Лог для наглядности ... received block 1652a05972b98e678461 CheckStakeKernelHash() : using modifier 0x35d696e7b209ef80 at height=349401 timestamp=2019-08-28 19:25:00 UTC for block from height=348699 timestamp=2019-08-19 21:11:31 UTC CheckStakeKernelHash() : check protocol=0.3 modifier=0x35d696e7b209ef80 nTimeBlockFrom=1566249091 nTxPrevOffset=158 nTimeTxPrev=1566249091 nPrevout=1 nTimeTx=1572903179 hashProof=000001c1e2aca427813ef37c1bc66380e10d2afa0ba691c41d6947d2a4637ced ComputeNextStakeModifier: prev modifier=0x3c2eb5bf4d3202fd time=2019-11-04 18:08:03 UTC 'AddToBlockIndex()' - The new block pretends to a height 357245, block chain height 357285 'AddToBlockIndex()' - A fork is formed, the height of the parent block 357233, hash child blocks hash(1)=46cba156 hash(2)=000084f2, creation date block(1)=04.11.2019 20:04:19 block(2)=04.11.2019 19:19:17, priority has a second block, NewChainTrust=0 down 'AddToBlockIndex()' - Generation time of a new block date=04.11.2019 21:32:59 later than available in the database date=04.11.2019 20:19:24 ProcessBlock: ACCEPTED POS BLOCK 2019-11-06 19:34:49 UTC received: getblocks (997 bytes) received block 0001b495e8c947f2aa67 ComputeNextStakeModifier: prev modifier=0x1673d3f6dc47f14c time=2019-11-07 00:10:33 UTC 'AddToBlockIndex()' - The new block pretends to a height 357365, block chain height 357366 'AddToBlockIndex()' - A fork is formed, the height of the parent block 357364, hash child blocks hash(1)=0001b495 hash(2)=045a8855, creation date block(1)=11/07/19 03:58:09 block(2)=11/07/19 03:59:48, priority has the first block, BestChainTrust=769420279357256 down 'AddToBlockIndex()' - The generation time of a new block date=11/07/19 03:58:09 earlier than the one in the database date=11/07/19 03:59:48 REORGANIZE REORGANIZE: Disconnect 2 blocks; 0d7c1fab0c6ac8e5150a..5729d05204aef49d6c0c REORGANIZE: Connect 1 blocks; 0d7c1fab0c6ac8e5150a..0001b495e8c947f2aa67 Delete redundant memory transactions that are in the connected branch REORGANIZE: done SetBestChain: new best=0001b495e8c947f2aa67 height=357365 trust=769420279357257 date=11/07/19 03:58:09 ProcessBlock: ACCEPTED POW BLOCK 2019-11-07 04:08:04 UTC received: block (335 bytes) received block 0001b6228706fd79e42d Flushed 123 addresses to peers.dat 31ms ComputeNextStakeModifier: prev modifier=0x1673d3f6dc47f14c time=2019-11-07 00:10:33 UTC 'AddToBlockIndex()' - The new block pretends to a height 357349, block chain height 357349 'AddToBlockIndex()' - A fork is formed, the height of the parent block 357348, hash child blocks hash(1)=0001b622 hash(2)=5416c057, creation date block(1)=11/07/19 02:16:20 block(2)=11/07/19 02:19:22, priority has the first block, BestChainTrust=769144828228136 down REORGANIZE REORGANIZE: Disconnect 1 blocks; 741dae93a19fd2a2df2d..5416c057bc5860a31b1c REORGANIZE: Connect 1 blocks; 741dae93a19fd2a2df2d..0001b6228706fd79e42d Delete redundant memory transactions that are in the connected branch REORGANIZE: done SetBestChain: new best=0001b6228706fd79e42d height=357349 trust=769144828228137 date=11/07/19 02:16:20 ProcessBlock: ACCEPTED POW BLOCK
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 07, 2019, 11:52:00 AM |
|
Ну и сам код... Он прост и легко интегрируется в кошелек.. CBlockIndex* pblockindex = NULL; int nPossibleHeight = pindexNew->pprev->nHeight + 1; if (fDebug) printf(" 'AddToBlockIndex()' - The new block pretends to a height %d, block chain height %d\n", nPossibleHeight, pindexBest->nHeight);
nMaxDepthReplacement = GetArg("-maxdepthreplacement", 50);
int nFixPrev = 0; CBlockIndex* newblockindex = pindexNew; int nFixPindexBestnHeight = pindexBest->nHeight; if (fHardForkOne) { if (pindexBest->nHeight > nPossibleHeight) nFixPindexBestnHeight = nPossibleHeight; if (nPossibleHeight > pindexBest->nHeight) { nFixPrev = nPossibleHeight - pindexBest->nHeight; for (int i = nFixPrev; i > 0; i--) { if (i == i) { newblockindex = newblockindex->pprev; } } }
for (int k = nFixPindexBestnHeight; k > nFixPindexBestnHeight - nMaxDepthReplacement; k--) { CBlockIndex* bestblockindex = FindBlockByHeight(k); if (k == k) { if (newblockindex->pprev->GetBlockHash() == bestblockindex->pprev->GetBlockHash()) { if (nPossibleHeight <= pindexBest->nHeight - nMaxDepthReplacement) { pindexNew->bnChainTrust = 0; if (fDebug) printf(" 'AddToBlockIndex()' - The new block pretends to a height %d, maximum allowed block height for a competing chain %d\n", nPossibleHeight, pindexBest->nHeight - nMaxDepthReplacement); break; } else if (newblockindex->GetBlockTime() > bestblockindex->GetBlockTime()) { pindexNew->bnChainTrust = 0; if (fDebug) printf(" 'AddToBlockIndex()' - A fork is formed, the height of the parent block %d, hash child blocks hash(1)=%s hash(2)=%s, creation date block(1)=%s block(2)=%s,\n", bestblockindex->pprev->nHeight, newblockindex->GetBlockHash().ToString().substr(0,8).c_str(), bestblockindex->GetBlockHash(). ToString().substr(0,8).c_str(), DateTimeStrFormat("%x %H:%M:%S", newblockindex->GetBlockTime()).c_str(), DateTimeStrFormat("%x %H:%M:%S", bestblockindex->GetBlockTime()).c_str()); printf(" priority has a second block, NewChainTrust=%s down\n", pindexNew->bnChainTrust.ToString().c_str()); break; } else if (newblockindex->GetBlockTime() < bestblockindex->GetBlockTime() && nPossibleHeight > pindexBest->nHeight - nMaxDepthReplacement) { bnBestChainTrust = bestblockindex->pprev->bnChainTrust;; if (fDebug) printf(" 'AddToBlockIndex()' - A fork is formed, the height of the parent block %d, hash child blocks hash(1)=%s hash(2)=%s, creation date block(1)=%s block(2)=%s,\n", bestblockindex->pprev->nHeight, newblockindex->GetBlockHash().ToString().substr(0,8).c_str(), bestblockindex->GetBlockHash(). ToString().substr(0,8).c_str(), DateTimeStrFormat("%x %H:%M:%S", newblockindex->GetBlockTime()).c_str(), DateTimeStrFormat("%x %H:%M:%S", bestblockindex->GetBlockTime()).c_str()); printf(" priority has the first block, BestChainTrust=%s down\n", bnBestChainTrust.ToString().c_str()); break; } } newblockindex = newblockindex->pprev; } } }
if (nPossibleHeight < pindexBest->nHeight && fHardForkOne) { pblockindex = FindBlockByHeight(nPossibleHeight); if (pindexNew->GetBlockTime() > pblockindex->GetBlockTime()) { if (fDebug) printf(" 'AddToBlockIndex()' - Generation time of a new block date=%s later than available in the database date=%s\n", DateTimeStrFormat("%x %H:%M:%S", pindexNew->GetBlockTime()).c_str(), DateTimeStrFormat("%x %H:%M:%S", pblockindex->GetBlockTime()).c_str()); pindexNew->bnChainTrust = 0; } else if (pindexNew->GetBlockTime() < pblockindex->GetBlockTime()) { if (nPossibleHeight < pindexBest->nHeight && nPossibleHeight > pindexBest->nHeight - nMaxDepthReplacement) { if (fDebug) printf(" 'AddToBlockIndex()' - The generation time of a new block date=%s earlier than the one in the database date=%s\n", DateTimeStrFormat("%x %H:%M:%S", pindexNew->GetBlockTime()).c_str(), DateTimeStrFormat("%x %H:%M:%S", pblockindex->GetBlockTime()).c_str()); bnBestChainTrust = pblockindex->pprev->bnChainTrust; } } }
// New best if (pindexNew->bnChainTrust > bnBestChainTrust) { if (!SetBestChain(state, txdb, pindexNew)) return false; } else if (pindexNew->bnChainTrust == bnBestChainTrust && fHardForkOne && pindexPrevPos->GetBlockHash() >= pindexPrevPrevPos->GetBlockHash()) { printf(" 'AddToBlockIndex()' - BestChainTrust %s\n", bnBestChainTrust.ToString().c_str()); printf(" 'AddToBlockIndex()' - NewChainTrust %s\n", pindexNew->bnChainTrust.ToString().c_str()); if (((pindexNew->IsProofOfStake() && pindexBest->IsProofOfStake()) ? (pindexNew->GetBlockHash() > pindexBest->GetBlockHash()) : (hash > pindexBest->GetBlockHash())) || (pindexBest->IsProofOfWork() && pindexNew->IsProofOfStake())) { printf(" 'AddToBlockIndex()' bnChainTrust = bnBestChainTrust - Block accepted\n"); if (!SetBestChain(state, txdb, pindexNew)) { return false; } } else { printf(" 'AddToBlockIndex()' bnChainTrust = bnBestChainTrust - Block not accepted\n"); } } else if (pindexNew->bnChainTrust == bnBestChainTrust && fHardForkOne && pindexPrevPos->GetBlockHash() < pindexPrevPrevPos->GetBlockHash()) { printf(" 'AddToBlockIndex()_' - BestChainTrust %s\n", bnBestChainTrust.ToString().c_str()); printf(" 'AddToBlockIndex()_' - NewChainTrust %s\n", pindexNew->bnChainTrust.ToString().c_str()); if (((pindexNew->IsProofOfStake() && pindexBest->IsProofOfStake()) ? (pindexNew->GetBlockHash() < pindexBest->GetBlockHash()) : (hash < pindexBest->GetBlockHash())) || (pindexBest->IsProofOfWork() && pindexNew->IsProofOfStake())) { printf(" 'AddToBlockIndex()_' bnChainTrust = bnBestChainTrust - Block accepted\n"); if (!SetBestChain(state, txdb, pindexNew)) { return false; } } else { printf(" 'AddToBlockIndex()_' bnChainTrust = bnBestChainTrust - Block not accepted\n"); } }
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 07, 2019, 01:05:47 PM |
|
Ну и уменьшение минимального порога сложности делает добычу доступной обычными проциками..
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 08, 2019, 06:50:53 AM |
|
Добавлено два режима..
Set virtual decentralized checkpoint - setvirtualdecentralizedcheckpoint=1 Ignore later found blocks - ignorelaterfoundblocks=1
По умолчанию включено..
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 11, 2019, 07:40:57 PM |
|
Децентрализованный checkpoint предоставил возможности, которые раньше казались невозможными. Предположил случай, когда кошелек или группа кошельков по какой-то причине задерживали информацию о новом блоке. Теперь новый блок, имеющий более раннюю отметку времени с задержкой информации о себе, сетью будет принят при условии, что задержка составляет не более двух новых блоков. Для блоков с более ранней временной меткой и еще большей задержкой включается подсчет «ChainTrust», и при более низком его значении цепочка будет отклонена протоколом. Поскольку код теперь знает о высоте родительского блока разветвления, он выходит из него самостоятельно, устанавливая контрольную точку для самой длинной цепочки.
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 11, 2019, 08:23:16 PM |
|
Преимущества перед пред идущей версией.
1) Побеждает блок только с более ранней временной меткой. -- В старой версии блок с более поздней меткой с лёгкостью мог переписать кучу блоков, для этого ему было достаточно набрать больший Траст. 2) Равенство блоков POW - POS -- Именно блоки POW представляют ценность в поддержании безопасности сети, однако они могли свободно замещаться производным от Proof-of-stake. Траст оценивал работу Proof-of-Work в одну единицу, таким способом осуществлялась защита сети от атак в 51%. Вроде как сколько-бы блоков не было добыто они все равно будут иметь меньший Траст и осиротить цепочку имеющую в себе POS не получится. Так и было пока не набралось достаточное количество монет для POW-POS атак.
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 12, 2019, 09:24:03 AM |
|
3) Для достижения консенсуса сеть не ждет новых блоков -- Так как решение принимается быстрее количество сиротеющих блоков дочек от конкурирующих цепей. Решение принимается уменьшится в несколько раз. Сеть начинает принимать решение при обнаружении в несколько раз быстрее. возможности будущего ветвления.
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 25, 2019, 12:46:37 PM |
|
New version available CACHE-Project, Pre hard fork version Version : v_6.1.1.31 Version of git : v_0.7.5.156 Subversion : v_0.7.6.43
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 26, 2019, 04:13:37 PM |
|
Приветствую Ты команду bind используешь? Что-то не дает осуществить привязку, например файрвол.
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
November 28, 2019, 03:40:35 PM |
|
На сегодня новый код не позволяет совершить двойную трату да-же обладателю 100% мощности сети. От использования подсчета траста пришлось отказаться.
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
December 17, 2019, 06:19:04 AM Last edit: March 12, 2020, 06:46:20 AM by Deff |
|
Перенос на следующую страницу
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
January 04, 2020, 01:31:50 PM |
|
New version available - Hard Fork version CACHE-Project, Hard Fork date is set in this version. Block - 364000, Version fixing Version : v_6.1.1.33 Version of git : v_0.7.5.190 Subversion : v_0.7.6.45
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
January 21, 2020, 09:07:33 AM |
|
New version available - Hard Fork version CACHE-Project, HardFork stable version, new protocol testing Version : v_6.1.1.34 Version of git : v_0.7.5.195 Subversion : v_0.7.6.46
|
|
|
|
Deff (OP)
Sr. Member
Offline
Activity: 939
Merit: 261
Data HDD Repair - Recovery of lost information
|
|
January 21, 2020, 11:04:13 AM |
|
Solo.... https://github.com/JayDDee/cpuminer-opt/releasestaskkill /F /IM cpuminer-opt.exe cpuminer-opt.exe -h Pause start cpuminer-opt.exe -a scryptjane:19 -o http://127.0.0.1:2224 -u USER -p PASS -t 8 --cpu-affinity ff --randomize --no-redirect -b 0 --no-gbt --coinbase-addr=address exit
|
|
|
|
|