nochowderforyou / clams

Clam Project
MIT License
62 stars 58 forks source link

downloading blockchain: clamd uses insane CPU power #269

Closed haraldg closed 4 years ago

haraldg commented 8 years ago

Just tried to get started with clamd and have following issue. Note that this is insofar a special case as this is on an IPv6 only node, and only has around 3 connections. (I guess this is not related but just to be complete.)

At first clamd was downloading blocks fine and I was estimating to be finished after 6-7 hours. But the longer the block chain gets, the more often (and longer) it stops adding blocks but still consumes CPU power. Sometimes the CPU is busy for over a minute, without progress. When this happes, something like the following is written into debug.log:

ERROR: ProcessBlock() : already have block (orphan) 3d503686d4cb2cab0cd72a43902d808d8b5f85d6d4e7c77dd5e1a02eaf81abef ERROR: ProcessBlock() : already have block (orphan) cb06812b384f175d3cc476dffb5b5d56c771c860d68ceea79b2711e6954c9d7c ERROR: ProcessBlock() : already have block (orphan) 58f848f762e1a65b3a6e7cce9da2a8af34c56e223a54cdd1c3151d158fcd5b80 ERROR: ProcessBlock() : already have block (orphan) 757a79e2604737d0c6aba65a9456499613c8c183306f7882c8738788d4c7d12f ERROR: ProcessBlock() : already have block (orphan) 1ff41ce2c375aae4f41b6bc1c7239abb93f7c22cc44685d114a823139c065920 ERROR: ProcessBlock() : already have block (orphan) 7d4b596ec2905c1ff4fe2efa163054f26327f30ca6f493d6635bbf53e4ceba8f ERROR: ProcessBlock() : already have block (orphan) a74c499847074278ebccb209d8368a8c979cbd993e63ded9eede997788647cd4 ERROR: ProcessBlock() : already have block (orphan) 01578e6fc8c9e8c85aa1c9b05489669b9b118f2229726b8c38702a83b4ba1ed6 ERROR: ProcessBlock() : already have block (orphan) cd02d1687f75ae446ec2a7744cd1921ba7444deccaf612e9c80962c7f0ff69bf ERROR: ProcessBlock() : already have block (orphan) 6596b91ca1fdc7a2d463271f9f2796af4e568982ebc12a55aa47148c04e20e60 ERROR: ProcessBlock() : already have block (orphan) 77cd80fa0b132b0ace1e5939aff16bb2d07b7172d7fb3608660ed0dcb398e43c ERROR: ProcessBlock() : already have block (orphan) 1b1d87803d38dd5e163b2579f49afbd664e89bdfeff123ed0a31ff90b16f2f72 ERROR: ProcessBlock() : already have block (orphan) 6e923f8e93264602ba80215d48d7e5e6eff04f14225b30c8c22615514d82e4e9 ERROR: ProcessBlock() : already have block (orphan) c35cbb5740a145eb6503e384274b05988fb02e7c72b7a4dbc409e81f256af92f ERROR: ProcessBlock() : already have block (orphan) 6c8c5440886e1b1158e69c7e9585f2731cac90232bb6298c6f7cd08075170fe6 ERROR: ProcessBlock() : already have block (orphan) e950456a2a38cb39719bd709e6b5ce7b3138fa46e16ca33300b5ec52048789e6 ERROR: ProcessBlock() : already have block (orphan) ec6dcc833193fae27873c51c906dfa381f1e6eef4e48369132ed538b98736bc2 ERROR: ProcessBlock() : already have block (orphan) 381282e0ed2a682d3adf38074dd62d44838db33e171ddd4f9fde7102fe08b557 ERROR: ProcessBlock() : already have block (orphan) 1ec6ad0c212ebd6e20598931a2f57af6ba45b5e5c2580c6edfee5c8368f429fe ERROR: ProcessBlock() : already have block (orphan) 202c5a9410f80ecb55ef86b8f21591aa4218e147170d814441e39a4ec6b319c9

$ clams-1.4.17/src/clamd -rpcconnect=::1 getinfo { "version" : "v1.4.17.0-unk", "protocolversion" : 60014, "walletversion" : 60000, "balance" : 0.00000000, "newmint" : 0.00000000, "stake" : 0.00000000, "blocks" : 607865, "timeoffset" : -1, "moneysupply" : 15277917.13048927, "digsupply" : 342922.23440040, "stakesupply" : 503515.72641731, "activesupply" : 846437.96081771, "connections" : 3, "proxy" : "", "ip" : "2a01:4f8:160:20c1::10:115", "difficulty" : { "proof-of-stake" : 51845.12210137 }, "testnet" : false, "keypoololdest" : 1450281923, "keypoolsize" : 101, "paytxfee" : 0.00010000, "mininput" : 0.00000000, "errors" : "" }

dooglus commented 8 years ago

xploited is working on merging newer code from bitcoin that will hopefully solve this issue.

You can find it here if you want to help fix/test it:

https://github.com/l0rdicon/clams/tree/reindex

haraldg commented 8 years ago

I'm afraid I'm not familiar enough with the code base to be of much help, but where/how is this work coordinated anyway?

haraldg commented 8 years ago

I intended to stay away from CLAM till this issue is fixed, but now I stumbled upon https://bitcointalk.org/index.php?topic=623147.msg13477544#msg13477544 which triggered my curiosity.

Can you point me to the commit, that triggered the problem? Is there an old version of clamd, that is not slow, but stil works on the current block chain? Is this a genuine problem of CLAM, or will other peercoin forks be affacted by the same problems once they reach the same block hight as the CLAM blockchain?

l0rdicon commented 4 years ago

Closing issue, unrelated to client v2.1.0 and this is fixed in this version as well

culhane commented 4 years ago

insane cpu power lmao.