Snipa22 / nodejs-pool

Other
479 stars 422 forks source link

Orphaned Block is stuck in the leaf queue, casuing lots of connections in master node. #191

Open sunxfof opened 6 years ago

sunxfof commented 6 years ago

When leaf node found an orphaned block, the block entered the queue, but master block won't accept the orphaned block as the hash doesn't exist in the master blockchain database. This causing master node opening 7K+ connections per second and monerd constantly using a lot of resources. As a remedy, I altered monerod code to pass status 200 even ti's an orphaned block. So the orphaned block now enters accepted by the master node, and entered lmdb, showing in the blocks section of the main page. I'm not sure about aftershocks of doing this. Is it possibled to add an exception cacher to handle this?

1rV1N-git commented 6 years ago

Check your pool_out log if you have like 2017-12-15 23:13:37 +00:00: (Worker 4 - 38471) Block b56f11 found at height .... by ........... ID: ..... IP: ......, share type: true - submit result: undefined change string in pool.js templateUpdate(); } else if (rpcResult) { //Success! Submitted a block without an issue. on this templateUpdate(); } else if (rpcResult.result) { //Success! Submitted a block without an issue. I think i it is solved problem

sunxfof commented 6 years ago

Thank you, the leaf nodes output results show: submit result: ("status" : "OK")

And on the master node, error message if "Can't get block by hash"

bobbieltd commented 6 years ago

I know I should open new issue to ask but most people here doesn't have much leaf node experiences so I ask here. I got these logs when two or more blockManager update block_log : 2|blockMan | 2018-01-21 11:32 +00:00: Tried to reprocess a block that'd already been processed 2|blockMan | {"code":"ER_DUP_ENTRY","errno":1062,"sqlMessage":"Duplicate entry '1dcd3cf4afaf2acb28e93cd3a172c829203e35747c7b55f04ede6ec2f6f467f0' for key 'PRIMARY'","sqlState":"23000","index":0,"sql":"INSERT INTO block_log (id, orphan, hex, find_time, reward, difficulty, major_version, minor_version) VALUES (121905, false, '1dcd3cf4afaf2acb28e93cd3a172c829203e35747c7b55f04ede6ec2f6f467f0', '2018-01-21 11:07:55', 707498, 19780780364, 1, 1)"}

Are these logs normal ? Thanks for help.

bobbieltd commented 6 years ago

For the part of V1r1N-git suggested, I think it should be : ..... templateUpdate(); } else if (typeof rpcResult.result !== 'undefined') { .... Should we make PR for this because I'm not sure ?

aeon-team commented 6 years ago

I have the same error on a leaf node: 1|blockMan | 2018-05-29 18:09 +00:00: Tried to reprocess a block that'd already been processed 1|blockMan | 2018-05-29 18:09 +00:00: {"code":"ER_DUP_ENTRY","errno":1062,"sqlMessage":

I've tried to edit node.js file on a leaf node with suggested method - didn’t work. How can I fix this problem? Look's like it causes high load on a leaf node.