lijian2019
Copper Member
Jr. Member
Offline
Activity: 444
Merit: 3
|
|
October 01, 2019, 11:04:11 AM |
|
About emergency help!!
IFC infinite coin, China's community foundation development one person one mine plan has been very good, now there is a strange phenomenon of block reward. This serious problem has hindered the development plan of mining machinery. I hope technicians can help solve this problem. Mining workers are looking forward to correcting this problem. Please technicians to repair this problem as soon as possible!!
|
|
|
|
msy2008
Copper Member
Full Member
Offline
Activity: 755
Merit: 110
|
|
October 01, 2019, 04:29:19 PM |
|
The block reward code is as follows: int64 static GetBlockValue(int nHeight, int64 nFees) { int64 nSubsidy = 524288 * COIN;
// Subsidy is cut in half every 86400 blocks, which will occur approximately every 1 month nSubsidy >>= (nHeight / 86400); // Infinitecoin: 86400 blocks in ~1 month return nSubsidy + nFees; } The halving is every month (based on 30 second blocks). After 64 months, the halving number appears to return to 0 based on the undefined behavior of a 64bit number being right shifted 64 bits. According to the C++ language, this operation has undefined results -- this means that the result could be different on different machines/CPU's. If there are differences this could lead to forks or clients and apps that do not sync past 5529600. This will require a hard fork fix on the code above. At a certain block height in the future, this code would be modified to force the reward to be zero. Thank you very much! Very precious clue June 1, 2014 I checked the source code of the myriad versions of Bitcoin. Bitcoin fixes this issue in version 0.9.2rc1
|
|
|
|
lgt19720
Newbie
Offline
Activity: 24
Merit: 0
|
|
October 04, 2019, 09:55:25 PM |
|
If successful, ifc will make an important contribution to the recognition of the digital currency model on a global scale.
|
|
|
|
almightyruler
Legendary
Offline
Activity: 2268
Merit: 1092
|
|
October 05, 2019, 02:58:47 AM |
|
The halving is every month (based on 30 second blocks). After 64 months, the halving number appears to return to 0 based on the undefined behavior of a 64bit number being right shifted 64 bits.
According to the C++ language, this operation has undefined results -- this means that the result could be different on different machines/CPU's.
If there are differences this could lead to forks or clients and apps that do not sync past 5529600.
So I see IFC's reward has wrapped around like I thought it may. It's definitely important to avoid undefined behaviour in consensus code, and it will need to be addressed at some point, but I'm wondering whether anyone has actually forked away because their CPU does something different to the majority of IFC clients? Has anyone running a non x86 CPU had problems? I know of at least one other coin which has gone beyond 64 bits, and we didn't need to fix the consensus code... but that community was not as large as IFC. There's also the question of whether the IFC community wants to "restart" rewards, or prefers it to stay at 0 indefinitely.
|
|
|
|
yzzifc
Jr. Member
Offline
Activity: 95
Merit: 1
|
|
October 05, 2019, 07:54:48 AM |
|
The halving is every month (based on 30 second blocks). After 64 months, the halving number appears to return to 0 based on the undefined behavior of a 64bit number being right shifted 64 bits.
According to the C++ language, this operation has undefined results -- this means that the result could be different on different machines/CPU's.
If there are differences this could lead to forks or clients and apps that do not sync past 5529600.
So I see IFC's reward has wrapped around like I thought it may. It's definitely important to avoid undefined behaviour in consensus code, and it will need to be addressed at some point, but I'm wondering whether anyone has actually forked away because their CPU does something different to the majority of IFC clients? Has anyone running a non x86 CPU had problems? I know of at least one other coin which has gone beyond 64 bits, and we didn't need to fix the consensus code... but that community was not as large as IFC. There's also the question of whether the IFC community wants to "restart" rewards, or prefers it to stay at 0 indefinitely. IFC has been completely mined, this is the consensus, so there will be no reward to reappear, the current consensus is to dig fees.
|
|
|
|
|
almightyruler
Legendary
Offline
Activity: 2268
Merit: 1092
|
|
October 05, 2019, 07:49:20 PM |
|
Uh oh. Making this code "effective immediately" will break consensus on existing clients, and will cause a hard fork. If peers disagree on rewards they will probably ban each other (as they should), which will split the network. The fork point really should have been set at a future block, so people had time to upgrade.
|
|
|
|
|
msy2008
Copper Member
Full Member
Offline
Activity: 755
Merit: 110
|
|
October 08, 2019, 01:15:41 AM Last edit: October 08, 2019, 01:27:22 AM by msy2008 |
|
Uh oh. Making this code "effective immediately" will break consensus on existing clients, and will cause a hard fork. If peers disagree on rewards they will probably ban each other (as they should), which will split the network. The fork point really should have been set at a future block, so people had time to upgrade. An overflow vulnerability exists in versions 188 and 1910 and 1914 and 1916 and 1918 If your consensus is a fixed total of 90.6 billion IFC Then you should upgrade the node 1919 version that fixes the vulnerability. See Bitcoin on June 1, 2014 0.9.2 rc1 version IFC fix vulnerability on line 873 https://github.com/WilliamXuu/infinitecoin/blob/master/src/main.cppPlease check the bitcoin source code https://github.com/bitcoin/bitcoin/releases?after=v0.9.2
|
|
|
|
almightyruler
Legendary
Offline
Activity: 2268
Merit: 1092
|
|
October 08, 2019, 05:03:51 AM |
|
Uh oh. Making this code "effective immediately" will break consensus on existing clients, and will cause a hard fork. If peers disagree on rewards they will probably ban each other (as they should), which will split the network. The fork point really should have been set at a future block, so people had time to upgrade. An overflow vulnerability exists in versions 188 and 1910 and 1914 and 1916 and 1918 I understand why it's being done, but the point I am making is that the blockchain fork should have been activated at some future block number, to give people a chance to upgrade. Because you've changed consensus code I think you may also have problems with people syncing, since the fork point will be set to the first 64 bit halving (block 5529600). People who have already synced past this point (which is anyone who has run the IFC client in the past 2 weeks) may be left on another blockchain fork, even once they upgrade. Current blockchain looks like this: #5529599 0.0 IFC #5529600 524,288.0 IFC ... #5544990 524,288.0 IFC
But a client with the new version syncing from scratch (or a block below #5529600) will expect: #5529599 0.0 IFC #5529600 0.0 IFC ... #5544990 0.0 IFC
This is where the consensus fails and peers start banning each other for misbehaving. It may require people who are fully synced to delete the blockchain and start again. In addition, since the fork point is in the past, any transactions that were sent after #5529599 will be invalidated.Code should be something more like //Force block reward to zero when right shift if undefined if(halvings>=64 && nHeight >= 5616000) // hard fork point set to specific block in future return nFees;
Bitcoin fixed the problem before it happened, so the change in consensus code will not cause a hard fork.
|
|
|
|
msy2008
Copper Member
Full Member
Offline
Activity: 755
Merit: 110
|
|
October 09, 2019, 01:22:39 AM |
|
Uh oh. Making this code "effective immediately" will break consensus on existing clients, and will cause a hard fork. If peers disagree on rewards they will probably ban each other (as they should), which will split the network. The fork point really should have been set at a future block, so people had time to upgrade. An overflow vulnerability exists in versions 188 and 1910 and 1914 and 1916 and 1918 I understand why it's being done, but the point I am making is that the blockchain fork should have been activated at some future block number, to give people a chance to upgrade. Because you've changed consensus code I think you may also have problems with people syncing, since the fork point will be set to the first 64 bit halving (block 5529600). People who have already synced past this point (which is anyone who has run the IFC client in the past 2 weeks) may be left on another blockchain fork, even once they upgrade. Current blockchain looks like this: #5529599 0.0 IFC #5529600 524,288.0 IFC ... #5544990 524,288.0 IFC
But a client with the new version syncing from scratch (or a block below #5529600) will expect: #5529599 0.0 IFC #5529600 0.0 IFC ... #5544990 0.0 IFC
This is where the consensus fails and peers start banning each other for misbehaving. It may require people who are fully synced to delete the blockchain and start again. In addition, since the fork point is in the past, any transactions that were sent after #5529599 will be invalidated.Code should be something more like //Force block reward to zero when right shift if undefined if(halvings>=64 && nHeight >= 5616000) // hard fork point set to specific block in future return nFees;
Bitcoin fixed the problem before it happened, so the change in consensus code will not cause a hard fork. Thank you very much, all the problems have been solved. If there is a block with errors, please synchronize from the block before 5529599
|
|
|
|
msy2008
Copper Member
Full Member
Offline
Activity: 755
Merit: 110
|
|
October 09, 2019, 01:25:13 AM |
|
Block generated by 64-bit Linux 1.8.8 version Infinitecoin block 5529012 download https://mega.nz/#!gzwFUSAD!2Pow5A3fE4iDZG5gPxesuxoXV_GGyD8vDN6yIkjkTgA
|
|
|
|
IFCSHARE
Jr. Member
Offline
Activity: 90
Merit: 1
|
|
October 09, 2019, 05:33:22 AM |
|
Congratulations to IFC for successfully solving the bug. Now you need to upgrade the 1.9.1.9 version of the whole node. Synchronize from before the 5529599 block to eliminate the additional blocks.
|
|
|
|
yzzifc
Jr. Member
Offline
Activity: 95
Merit: 1
|
|
October 09, 2019, 08:12:14 AM |
|
Hello, fans of IFC, the whole node of 1.8.8 has a vulnerability, please upgrade the full node of IFC to 1.9.1.9, and finally thank all the fans who contributed selflessly to IFC in this IFC vulnerability fix!
|
|
|
|
cyl2077
Newbie
Offline
Activity: 70
Merit: 0
|
|
October 09, 2019, 12:39:54 PM |
|
I am very happy that we have solved the problem. Thanks to everyone who paid for it.
|
|
|
|
lgt19720
Newbie
Offline
Activity: 24
Merit: 0
|
|
October 09, 2019, 01:02:53 PM |
|
In the field of encrypted electronic money, there is a buzzword: "Bitcoin is Gold, Litecoin is Silver, Infinitecoin is Copper", which means "bit gold, Wright silver, infinite copper".
|
|
|
|
msy2008
Copper Member
Full Member
Offline
Activity: 755
Merit: 110
|
|
October 10, 2019, 05:02:11 AM Last edit: October 10, 2019, 03:10:21 PM by msy2008 |
|
About infinitecoin overflow vulnerability has been successfully fixed1 Delete error block and sync from 5529599 2 Using the 1919 version 3 Upgrade your wallet version and full-node version Source code https://github.com/WilliamXuu/infinitecoinWallet download https://github.com/WilliamXuu/infinitecoin/releasesAuthor: WilliamXu (WilliamXu1) Infinitecoin block 5529012 download https://mega.nz/#!gzwFUSAD!2Pow5A3fE4iDZG5gPxesuxoXV_GGyD8vDN6yIkjkTgA InfiniteCoin Blockchain Explorer https://chainz.cryptoid.info/ifc/ (Syncing) Known 1919 version of the full node addnode=8.209.73.126 addnode=47.108.82.81 addnode=47.252.81.22 addnode=47.245.52.188 addnode=149.129.174.246 addnode=140.143.207.19 addnode=95.179.221.207 addnode=220.179.77.92 addnode=139.180.137.140 addnode=222.71.191.210 addnode=118.24.129.200 addnode=47.92.211.243 addnode=115.212.200.109 addnode=39.99.33.79
|
|
|
|
lijian2019
Copper Member
Jr. Member
Offline
Activity: 444
Merit: 3
|
|
October 10, 2019, 05:27:09 AM |
|
Error blocks have been successfully repaired, version 1.9.1.9 wallet has gone beyond the error blocks, miners mining machines are running, continue to develop a one-person-one-miner plan!
|
|
|
|
lijian2019
Copper Member
Jr. Member
Offline
Activity: 444
Merit: 3
|
|
October 10, 2019, 06:07:02 AM |
|
|
|
|
|
IFCSHARE
Jr. Member
Offline
Activity: 90
Merit: 1
|
|
October 10, 2019, 06:45:24 AM |
|
Thanks to all the IFC fans who participated in this bug fix, you are the best
|
|
|
|
|