-3
I've been working on a PIVX fork for some time, to better understand blockchain infrastructure and coding in general. I have been able to modify all parameters, remove checkpoints, set up a new genesis block for blockchain and both enable PoW & disable PoW/switch to PoS and masternode succesfully.
I am somewhat stuck however, on this last piece of the puzzle - spork synchronization. After setting up a seed node, I can continue synchronization from 12% to 25%, yet it will never go past that instance.
The feeling I have is that it has to do with spork activation times (in spork.h), yet changing these values around have not worked in getting the synchronization to complete. I am aware that I may not understand how those sporks are supposed to synchronize well enough, so I hope someone can point me in the right direction.
Any help is much appreciated.
I've been working on a PIVX fork for some time, to better understand blockchain infrastructure and coding in general. I have been able to modify all parameters, remove checkpoints, set up a new genesis block for blockchain and both enable PoW & disable PoW/switch to PoS and masternode succesfully.
I am somewhat stuck however, on this last piece of the puzzle - spork synchronization. After setting up a seed node, I can continue synchronization from 12% to 25%, yet it will never go past that instance.
The feeling I have is that it has to do with spork activation times (in spork.h), yet changing these values around have not worked in getting the synchronization to complete. I am aware that I may not understand how those sporks are supposed to synchronize well enough, so I hope someone can point me in the right direction.
Any help is much appreciated.
Looking through masternode-sync.cpp, I find these instances:
case (MASTERNODE_SYNC_SPORKS):
RequestedMasternodeAssets = MASTERNODE_SYNC_LIST;
break;
[....]
BOOST_FOREACH (CNode* pnode, vNodes) {
pnode->ClearFulfilledRequest("getspork");
[....]
if (mnodeman.CountEnabled() == 0 ) {
if(syncCount < 2){
Reset();
syncCount++;
}
} else
return;
[....]
if (RequestedMasternodeAssets == MASTERNODE_SYNC_SPORKS) {
if (pnode->HasFulfilledRequest("getspork")) continue;
pnode->FulfilledRequest("getspork");
pnode->PushMessage("getsporks"); //get current network sporks
if (RequestedMasternodeAttempt >= 2) GetNextAsset();
RequestedMasternodeAttempt++;
return;
[....]
//set to synced
if (RequestedMasternodeAssets == MASTERNODE_SYNC_SPORKS) {
if (pnode->HasFulfilledRequest("getspork")) continue;
pnode->FulfilledRequest("getspork");
pnode->PushMessage("getsporks"); //get current network sporks
if (RequestedMasternodeAttempt >= 2) GetNextAsset();
RequestedMasternodeAttempt++;
return;
}
They seem to corrobarate that is indeed a lack of nodes; it seems at least 2 nodes needed in order to complete syncing the sporks?
1Downvoted. I don't think "please help me create my own cryptocurrency" are useful questions, as they only benefit the question asker and not a wider audience. Even when such projects are intended as learning experience, all you'll learn is how to make changes to make the codebase distinct. Contributing to existing projects is far more valuable. – Pieter Wuille – 2018-11-17T22:25:50.137
That is not the question, Pieter. I need to understand what is going wrong, in order to be able to fix it. As I said, 'I am aware that I may not understand how sporks are supposed to work'. I know they are soft forks integrated into the source code which can be easily turned on/off in order to prevent having to do a hard fork, or optimize the wallet, but the synchronization part of that does not seem to work. Instead of giving a negative remark and help noone, you could consider pointing in the right direction instead of a 'fix it'-answer - that is, if you know how - which would be appreciated – WG91 – 2018-11-19T06:47:08.367
I do not see how I can contribute to other projects if I can't understand all parts of the code and how they function once integrated. I have tried making several forks, of several different projects, and each time I am succesful up until this point. Therefore I'm assuming it's something small but significant that I do not get right, regarding sporks. There is not enough documentation out there for me to get it to work - or I can't find it - so pointing towards documentation would also be appreciated. – WG91 – 2018-11-19T06:49:06.570
My feeling is it might be due to lack of seed nodes? I tried editing a qt-wallet from a different coin (with protocol version bump) and that also gets stuck at synchronizing sporks. However I don't see why it would not be able to get past that sync. point without seed nodes.. – WG91 – 2018-11-19T07:10:27.613
@PieterWuille I decided to search through masternode-sync.cpp and came up with the parts of code (added to original post). This seems to indicate a lack of seed nodes is indeed the issue, am I right? – WG91 – 2018-11-19T19:04:49.433
This is not related to Bitcoin. There are no sporks on Bitcoin. Does not belong here, imo. – Wapac – 2018-11-19T19:15:51.770
Answered my own question - turned out to be consensus issue, indeed fixed by seed nodes. – WG91 – 2018-11-24T09:33:56.130