Pages:
Author

Topic: [ANN] microCoin MRC - alcurEX - Scrypt-Jane - nFactor - page 31. (Read 374703 times)

member
Activity: 98
Merit: 10
One life. Live it.
My point wasn't the fact that it gave the wrong block reward and now needed to be there; it was why did anyone write...

nSubsidy = (3100 - ((nHeight * 0.01) - 310000)) - 300000;

...in the first place?

Hehe, yes you are totally right about that very ambiguous code, but it is not my code Smiley My suggestion patch is here: https://bitcointalksearch.org/topic/m.6522098

(The formula could be shortened as: nSubsidy = (6900 - nHeight * 0.01) * COIN. Both of them are the same, but the original way looks more understandable.)

If MRC/halibit followed my suggested code at the first place without inventing this piece for the 1st fork (and then deleting an existing corrected code for the 2nd fork), this mess would never happen.

However I think it is not time to complain, it is time to work together to fix the mess. We need more patience, kind of patience we have showed all during the history of this coin.
hero member
Activity: 600
Merit: 500
It's nice to see that many people are helping if problems exist. I wouldn't say that the coins future is affected but we should see it as an amber light to do all things with still more care Smiley.
full member
Activity: 434
Merit: 100
Here you go, its ALL files needed except wallet.dat file with blocks calculated for today for microcoin_client2_1_1_2

Its like 315 Mb. All working, enjoy: http://yadi.sk/d/Wti85ZbbPDRSM
hero member
Activity: 482
Merit: 500
Code:
// Erroneous 0.01 block rewards (wrong logic again, but we need to keep it because it's already happened)
else if (nHeight <= 318000)
{
nSubsidy = (3100 - ((nHeight * 0.01) - 310000)) - 300000;
// NOTE: Seriously!? Who came up with this code as the "fix"? It's the same as:
// nSubsidy = 13100 - nHeight * 0.01;
// That's so utterly wrong and confusing to begin with, it's no wonder things broke.
}

If you follow the story, you will understand why we need to keep that ugly and shit code. Because the new version need to be compartable with the old versions. If there is a logic, which even is wrong as coin spec, but it's already happend, we need to keep it for sure.

That's why removing an existing code from the original code is a very bad bug, so hopefully hallibit will fix this as very soon as possible.

I still do not know why that part (160,000 - 310,000) was removed Sad But first of all, I need to blame myself for my terrible reviewing skill.
My point wasn't the fact that it gave the wrong block reward and now needed to be there; it was why did anyone write...

nSubsidy = (3100 - ((nHeight * 0.01) - 310000)) - 300000;

...in the first place? It's the same with the line that says:
nSubsidy = (160000 - (nHeight -160000) ) * COIN;

Really, why are we doing such crappy math? (320000 - nHeight) * COIN is not only more concise, but it's also more easily understood, especially with a well-placed comment. Programming should be reduced to the simplest form possible, not expanded with useless additions. Otherwise why don't we write:

nSubsidy = (32 * (nHeight + 5000) - (nHeight -160000))) * COIN - nHeight * 32 / COIN;

Or perhaps:

nSubsidy = (32 * (nHeight + 5000 - nThisIsStupid) - (nHeight -160000))) * COIN - (nHeight * 32 + 544 * (nThisIsStupid / 17)) / COIN;

I don't even know if I did that math properly, but you get the point I hope: adding numbers and complexity to an expression doesn't help.
full member
Activity: 434
Merit: 100
YET new wallet have troubles for new users, i may upload all blocks DAT files for today, to use wallet until it will be fixed.
member
Activity: 98
Merit: 10
One life. Live it.
Code:
// Erroneous 0.01 block rewards (wrong logic again, but we need to keep it because it's already happened)
else if (nHeight <= 318000)
{
nSubsidy = (3100 - ((nHeight * 0.01) - 310000)) - 300000;
// NOTE: Seriously!? Who came up with this code as the "fix"? It's the same as:
// nSubsidy = 13100 - nHeight * 0.01;
// That's so utterly wrong and confusing to begin with, it's no wonder things broke.
}

If you follow the story, you will understand why we need to keep that ugly and shit code. Because the new version need to be compartable with the old versions. If there is a logic, which even is wrong as coin spec, but it's already happend, we need to keep it for sure.

That's why removing an existing code from the original code is a very bad bug, so hopefully hallibit will fix this as very soon as possible.

I still do not know why that part (160,000 - 310,000) was removed Sad But first of all, I need to blame myself for my terrible reviewing skill.

member
Activity: 98
Merit: 10
One life. Live it.
OMG, I did not notice that the following code was removed without any reason

Quote
else if(nHeight >= 160000 && nHeight < 310000) // decreasing block size on every blocks -1.  ** Blocks: 160001 - 310000
{
nSubsidy = (160000 - (nHeight -160000) ) * COIN;
}         

You can see the change at this commit:
https://github.com/microcoinsource/microcoin/commit/4a6de77b362881b184445630475912538ebf744b

I am very sorry that I did not read the whole block when halibit asked me for reviewing. I did only read the part I suggested to add. I am feel very bad about this, I apologise again  Cry.

Halibit, please add that block back to the code and compile the new code.
hero member
Activity: 482
Merit: 500
Addendum to my above post: I had some more bad math. Hahaha... it's why I'm not the developer. :-)

Basically, the 160000-309999 case was returning 150000 to 0 coins, not 160000 to 10000 coins. I've edited my post (changed 310000 to 320000 on that one line), but you can see the incorrect code quoted above me.
fixed it so noone can copy wrong code, seems to be very complicated to code.
On a separate note: does Proof of Stake for sure never kick in? Has anyone taken a closer look at that code? I'll be honest: MRC is going nowhere fast right now, but maybe it can still recover somewhat -- basically, any coin that's creating 100 billion coins is going to run into some serious problems IMO (hello <1 satoshi trading). But I see some stuff in the code like GetProofOfStakeReward, and I believe MRC is not supposed to have any PoS stuff going on. It's pretty telling that the coin developers didn't even take the time to properly remove stuff like GetProofOfStakeReward. I fear that MRC -- and Alcurex along with it -- are going to be a money losing venture.
legendary
Activity: 912
Merit: 1000
I'm surprised there has not been a bigger dump on the exchanges yet.  I'd get out before this coin goes Corgi down to single digits on the LTC market.   Wink
sr. member
Activity: 364
Merit: 250
Yowsers!!! After a 14 hour battle of wills, 2 new server builds, 3 DB migrations and a bunch of other stuff to boot.... were back on the air!!

All shares, coins (what little coins there are Tongue ), blocks etc are accounted for as mining was not affected.

The pool is running through the backlogs but it may take a while.

Sorry for the inconvenience.

Nut



Thank you for your hard work nutnut, next codefix is coming soon, so you will not get out of practice  Grin.

Yaye! look forward to it.  Undecided

So, reading through the posts, it looks like we still don't have a working code version?
sr. member
Activity: 434
Merit: 250
Yowsers!!! After a 14 hour battle of wills, 2 new server builds, 3 DB migrations and a bunch of other stuff to boot.... were back on the air!!

All shares, coins (what little coins there are Tongue ), blocks etc are accounted for as mining was not affected.

The pool is running through the backlogs but it may take a while.

Sorry for the inconvenience.

Nut



Thank you for your hard work nutnut, next codefix is coming soon, so you will not get out of practice  Grin.
sr. member
Activity: 364
Merit: 250
Yowsers!!! After a 14 hour battle of wills, 2 new server builds, 3 DB migrations and a bunch of other stuff to boot.... were back on the air!!

All shares, coins (what little coins there are Tongue ), blocks etc are accounted for as mining was not affected.

The pool is running through the backlogs but it may take a while.

Sorry for the inconvenience.

Nut

hero member
Activity: 600
Merit: 500
I can definitely confirm the problem as i saw that the new wallet in my virtual machine now also stopped syncing at block 159,999 (as i said a few posts before)...
sr. member
Activity: 434
Merit: 250
Addendum to my above post: I had some more bad math. Hahaha... it's why I'm not the developer. :-)

Basically, the 160000-309999 case was returning 150000 to 0 coins, not 160000 to 10000 coins. I've edited my post (changed 310000 to 320000 on that one line), but you can see the incorrect code quoted above me.

fixed it so noone can copy wrong code, seems to be very complicated to code.
hero member
Activity: 482
Merit: 500
Addendum to my above post: I had some more bad math. Hahaha... it's why I'm not the developer. :-)

Basically, the 160000-309999 case was returning 150000 to 0 coins, not 160000 to 10000 coins. I've edited my post (changed 310000 to 320000 on that one line), but you can see the incorrect code quoted above me.
legendary
Activity: 1148
Merit: 1000
client hangs on launch with message "loading block explorer"
sr. member
Activity: 434
Merit: 250
Um... don't we have buggy code still? Let me post what's in there right now:

....

It seems we're missing the case of the block number being 160000-310000 with rewards going from 160000 back to 10000. Doesn't that matter? Actually, right now blocks 160000-310000 would be in the category of <= 318000, which would mean blocks 160000-310000 and 315000-318000 would be worth the wrong values. Anyone grabbing a new wallet and downloading the block chain would get all sorts of problems, wouldn't they? If I'm reading that correctly and understand the code (which I may not!), then the correct code should be as follows (with a bit of modified formatting for readability because the indentations were off):

....

This is insane, people. As someone that studied computer science 20 years back, I can't believe the sort of hack-job coding we're seeing. Let me give you some advise: properly commented code is important, and obfuscating code with behind-the-scenes math is a bad idea.

MRC donations for my awesome code (which will be worth squat very soon at this rate): 14LADSmN8FkX7kfsAkvgvmPH8ZGJUdABLV

Sound for me as you found the explanation for new wallets stopping sync at 159.999
Still time to change code and (hopefully last time) inform all involved parties.
I will also donate you plenty of MRC, but after this all is sorted out. I dont risk sending coins now with whatever version.
As soon as we are stable again....if this happens ever  Sad
hero member
Activity: 600
Merit: 500
That's exactly why my new wallet stops syncing at block 159,999 Angry

For now, don't update your wallet to v2.1.1.2. It's defective Cry
hero member
Activity: 482
Merit: 500
If i delete everything except wallet.dat and open the new wallet it will sync till block 159,999 and nothing more! So i cannot do it as it is recommended. Don't know what the reason is...
the reason is... dev like CTRL+V
The real reason: see my code above. The dev forgot about the case of blocks 160000-309999. *Sigh*
hero member
Activity: 482
Merit: 500
Um... don't we have buggy code still? Let me post what's in there right now:
Code:
int64 GetProofOfWorkReward( int nHeight, uint256 prevHash)
{

// microCoin block size.
        int64 nSubsidy = 1 * COIN;
        if(nHeight < 10000)    
        {
                nSubsidy = 0.0001 * COIN; // Premining 1 coin. (10000 blocks * 0.0001 coins) = Total 1 coin. ** For network security purpose. (Needed with the fair launch).
        }
else if(nHeight >= 10000 && nHeight < 160000) // Launch start. Increasing block size on every blocks +1. ** Blocks: 1001 - 160000
        {
nSubsidy = nHeight * COIN;
}
else if (nHeight >= 310000 && nHeight <= 315000) // 310,000 block rewards, decreasing 0.01 on every block
{
nSubsidy = (310000 - ((nHeight - 310000) * 0.01)) * COIN;
}

else if (nHeight <= 318000) // 0.01 block rewards (wrong logic as coin spec, but we need to keep it because it's already happened)
{
nSubsidy = (3100 - ((nHeight * 0.01) - 310000)) - 300000;
}

else
{
nSubsidy = (10000 - ((nHeight - 318000) * 0.01)) * COIN;
if (nSubsidy <= 1000 * COIN) nSubsidy = 1000 * COIN; // Rest of blocks are 1000 coins. Then network working forever with stake blocks.
}


    return nSubsidy;
}

It seems we're missing the case of the block number being 160000-310000 with rewards going from 160000 back to 10000. Doesn't that matter? Actually, right now blocks 160000-310000 would be in the category of <= 318000, which would mean blocks 160000-310000 and 315000-318000 would be worth the wrong values. Anyone grabbing a new wallet and downloading the block chain would get all sorts of problems, wouldn't they? If I'm reading that correctly and understand the code (which I may not!), then the correct code should be as follows (with a bit of modified formatting for readability because the indentations were off):

Code:
int64 GetProofOfWorkReward( int nHeight, uint256 prevHash)
{

// microCoin block reward amount.
int64 nSubsidy = 1 * COIN;

// Premining 1 coin. (10000 blocks * 0.0001 coins) = Total 1 coin. ** For network security purpose. (Needed with the fair launch).
if(nHeight < 10000)
{
nSubsidy = 0.0001 * COIN;
}

// Launch start. Increasing block size on every blocks +1. ** Blocks: 1001 - 160000
else if(nHeight >= 10000 && nHeight < 160000)
{
nSubsidy = nHeight * COIN;
}

// Count back down from 160K to 10K block rewards.
else if (nHeight >= 160000 && nHeight < 310000)
{
nSubsidy = (320000 - nHeight) * COIN;
}

// Erroneous 310,000-309,950 block rewards, decreasing 0.01 on every block (this already happened so we keep it)
else if (nHeight >= 310000 && nHeight <= 315000)
{
nSubsidy = (310000 - ((nHeight - 310000) * 0.01)) * COIN;
}

// Erroneous 0.01 block rewards (wrong logic again, but we need to keep it because it's already happened)
else if (nHeight <= 318000)
{
nSubsidy = (3100 - ((nHeight * 0.01) - 310000)) - 300000;
// NOTE: Seriously!? Who came up with this code as the "fix"? It's the same as:
// nSubsidy = 13100 - nHeight * 0.01;
// That's so utterly wrong and confusing to begin with, it's no wonder things broke.
}

// Rewards decrease from 10000 to 10000 in 0.01 steps; minimum reward is 1000 coins.
else
{
nSubsidy = (10000 - ((nHeight - 318000) * 0.01)) * COIN;

// The remaining blocks are 1000 coins each, with network continuing forever with stake blocks.
if (nSubsidy <= 1000 * COIN) nSubsidy = 1000 * COIN;
}

    return nSubsidy;
}

This is insane, people. As someone that studied computer science 20 years back, I can't believe the sort of hack-job coding we're seeing. Let me give you some advise: properly commented code is important, and obfuscating code with behind-the-scenes math is a bad idea.

MRC donations for my awesome code (which will be worth squat very soon at this rate): 14LADSmN8FkX7kfsAkvgvmPH8ZGJUdABLV
Pages:
Jump to: