Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] transactions with invalid inputs should never go into mempool #331

Closed
baaa opened this issue Sep 22, 2018 · 21 comments
Closed

[BUG] transactions with invalid inputs should never go into mempool #331

baaa opened this issue Sep 22, 2018 · 21 comments

Comments

@baaa
Copy link

baaa commented Sep 22, 2018

Transactions inputs should be validated before going into mempool.

This looks like a critical bug.

At the moment, invalid transaction/input is only detected when that transaction is mined into a block. The network than rejects the block because of the invalid transaction/input naturally. But mining time spent on that block is completely lost.

Example:

20180922T000544 DEBUG [node] Potential transaction from [37.139.29.83:5251].54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180922T000544 DEBUG [node] Potential transaction from [37.139.29.83:5251].6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180922T000544 DEBUG [node] Potential transaction from [37.139.29.83:5251].12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180922T000544 DEBUG [blockchain] Transaction saved to mempool (1)
20180922T000544 DEBUG [blockchain] Transaction saved to mempool (2)
20180922T000544 DEBUG [blockchain] Transaction saved to mempool (3)
20180922T000547 DEBUG [blockchain] Orphan pool added block [932e0500fd9f00e37ba59c57c23a2f689cdc926160851deca053eddb56efd0d6] previous [a78cddce48d444a3a1108bb70d0ab50e5c23a1fec39db2f8834244c0c62a906f] old size (2).
20180922T000547 INFO [blockchain] Block [1518011] verify (1) txs and (1) inputs
20180922T000547 INFO [blockchain] Block [1518011] verified in (0) secs or (0) ms/input
20180922T000547 DEBUG [blockchain] Orphan pool removed block [932e0500fd9f00e37ba59c57c23a2f689cdc926160851deca053eddb56efd0d6] old size (3). with status: success
20180922T000547 DEBUG [blockchain]  push block height:1518011 hash:932e0500fd9f00e37ba59c57c23a2f689cdc926160851deca053eddb56efd0d6
20180922T000547 DEBUG [blockchain] Reorganize: tx pool size (3) forked at (1518010) new blocks (1) replace blocks (0)
20180922T000600 DEBUG [blockchain] Orphan pool added block [33453f4b738e1bd2ee682ecf26bfd3fb5f4afe16423937494f385faaf9fa0c72] previous [932e0500fd9f00e37ba59c57c23a2f689cdc926160851deca053eddb56efd0d6] old size (2).
20180922T000600 INFO [blockchain] Block [1518012] verify (1) txs and (1) inputs
20180922T000600 INFO [blockchain] Block [1518012] verified in (0) secs or (0) ms/input
20180922T000600 DEBUG [blockchain] Orphan pool removed block [33453f4b738e1bd2ee682ecf26bfd3fb5f4afe16423937494f385faaf9fa0c72] old size (3). with status: success
20180922T000600 DEBUG [blockchain]  push block height:1518012 hash:33453f4b738e1bd2ee682ecf26bfd3fb5f4afe16423937494f385faaf9fa0c72
20180922T000600 DEBUG [blockchain] Reorganize: tx pool size (3) forked at (1518011) new blocks (1) replace blocks (0)
20180922T000621 DEBUG [network] sync hosts to file(/home/ubuntu/.metaverse/hosts.cache), active hosts size is 5724 hosts found, inactive hosts size is 0
20180922T000630 DEBUG [blockchain] Orphan pool added block [06ae4e99001f5bdf0552f004431511c71f820d27011eb962e2054bbb265a5a97] previous [33453f4b738e1bd2ee682ecf26bfd3fb5f4afe16423937494f385faaf9fa0c72] old size (2).
20180922T000630 INFO [blockchain] Block [1518013] verify (4) txs and (12) inputs
20180922T000630 DEBUG [blockchain] validate inputs of block failed. tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180922T000630 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180922T000630 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180922T000630 INFO [blockchain] Block [1518013] unverified in (0) secs or (0) ms/input
20180922T000630 DEBUG [blockchain] Orphan pool removed block [06ae4e99001f5bdf0552f004431511c71f820d27011eb962e2054bbb265a5a97] old size (3). with status: validation of inputs failed
20180922T000630 DEBUG [consensus] force create new block
20180922T000630 DEBUG [consensus] put_result nonce:cb2f929370845a62 mix_hash:0x43f44a8d493a4bed9cfbf5ee1f8d2f0dff79b20c6362178f5354eff7b306cc94 fail

.54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 goes into mempool at 20180922T000544 and pool starts mining for a solution.

At 20180922T000630 a solution is found but the block is invalid because tx 54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 contains invalid inputs. but 46 seconds of mining time wasted to remove this invalid TX from mempool.

@baaa
Copy link
Author

baaa commented Sep 22, 2018

@baaa
Copy link
Author

baaa commented Sep 22, 2018

all TX from same person:

6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220

image

12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60

image

@baaa
Copy link
Author

baaa commented Sep 22, 2018

ubuntu@ip-172-31-33-156:~$ tail -fn 500000 .metaverse/debug.log | grep delete_tx
20180921T025532 DEBUG [blockchain]  delete_tx hash:901e402700087adc9651e3fda7275dfcf6601d0a561cbe3ff5b5284e6c270923
20180921T065358 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T065358 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T071023 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T071023 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T072416 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T072416 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T073919 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T073919 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T080907 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T080907 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T081044 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T081044 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T081131 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T081131 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T091350 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T091350 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T091448 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T091448 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T091719 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T091719 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T103935 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T103935 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T104044 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T104044 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T104439 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T104439 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T112708 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T112708 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T112834 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T112834 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T112859 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T112859 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T114739 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T114739 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T114831 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T114831 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T115131 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T115131 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T132206 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T132206 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T132223 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T132223 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T132246 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T132246 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T135218 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T135218 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T135226 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T135226 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T135230 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T135230 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T144420 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T144420 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T144557 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T144557 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T144642 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T144642 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T144940 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T144940 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T145019 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T145019 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T145117 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T145117 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T155047 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T155047 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T155239 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T155239 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T155242 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T155242 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T164701 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T164701 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T165049 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T165049 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T165346 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T165346 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T180622 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T180622 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T180753 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T180753 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T180800 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T180800 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T191533 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T191533 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T191841 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T191841 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T192117 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T192117 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T201811 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T201811 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T202058 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T202058 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T202337 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T202337 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T204106 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T204106 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T204549 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T204549 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T205026 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T205026 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T205814 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T205814 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T210100 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T210100 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T210229 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T210229 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T210709 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T210709 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T210728 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T210728 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T210832 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T210832 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T211704 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T211704 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T211817 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T211817 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T211818 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T211818 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T213949 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T213949 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T214327 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T214327 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T214334 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T214334 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T220115 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T220115 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T220350 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T220350 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T220547 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T220547 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T224301 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T224301 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T224614 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T224614 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T224740 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T224740 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T224753 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T224753 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T225206 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T225206 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T230127 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T230127 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T230136 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T230136 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success
20180921T230518 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T230518 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T230855 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
20180921T230855 DEBUG [blockchain]  delete_tx hash:54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673 success
20180921T231109 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T231109 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T231151 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60
20180921T231151 DEBUG [blockchain]  delete_tx hash:12950214c6441709dd2a244211ad353e5d48f0d6736b180444343fe18390ee60 success

@chengzhpchn
Copy link
Contributor

Hello, I have notice this invalid transaction, like: 54f88271901f90ff81fb1d9b75af8a7583d540478e9cad8106ee2b9e71307673
this transaction contain 2 inputs, but the 2 input refer to the same UTXO, which means it's an invalid transaction.
and also, I have tried to restart the mvs wallet to clean the transaction pool, but unfortunately, it apears again in a short time.
I have compiled a test version(unbuntu 64 bit) to solve this problem, here is the download link:
https://pan.baidu.com/s/19NtQ1idoO4Bd_eWgf0tB7A

if you cannot open the link, please leave your email address below, I will send by the mail.
Note: This is not an official release. The official will be released on 2018-09-25(after the chinese mid-autumn day)

@baaa
Copy link
Author

baaa commented Sep 22, 2018

can you give a link to your commit for the fix?
I am not going to download a binary to install on the pool from a random website.

@chengzhpchn
Copy link
Contributor

diff --git a/src/lib/blockchain/transaction_pool.cpp b/src/lib/blockchain/transaction_pool.cpp
index ccf3ec2..0271a09 100644
--- a/src/lib/blockchain/transaction_pool.cpp
+++ b/src/lib/blockchain/transaction_pool.cpp
@@ -528,6 +528,17 @@ void transaction_pool::add(transaction_ptr tx, confirm_handler handler)
if (maintain_consistency_ && buffer_.size() == buffer_.capacity())
delete_package(error::pool_filled);

  • std::setstd::string set;
  • for (const auto& input : tx->inputs) {
  •    auto tx_hash = input.previous_output.hash;
    
  •    auto value = libbitcoin::encode_hash(tx_hash) + std::to_string(input.previous_output.index);
    
  •    if (set.count(value)) {
    
  •        return;
    
  •    }
    
  •    set.insert(value);
    
  • }
  • buffer_.push_back({ tx, handler });
    }

this is the patch

@jowenshaw
Copy link
Contributor

you can ref. the following patch:

diff --git a/src/lib/blockchain/transaction_pool.cpp b/src/lib/blockchain/transaction_pool.cpp
index ccf3ec2..0271a09 100644
--- a/src/lib/blockchain/transaction_pool.cpp
+++ b/src/lib/blockchain/transaction_pool.cpp
@@ -528,6 +528,17 @@ void transaction_pool::add(transaction_ptr tx, confirm_handler handler)
     if (maintain_consistency_ && buffer_.size() == buffer_.capacity())
         delete_package(error::pool_filled);
 
+    std::set<std::string> input_point_set;
+    for (const auto& input : tx->inputs) {
+        auto key = libbitcoin::encode_hash(input.previous_output.hash) + std::string(":") + std::to_string(input.previous_output.index);
+        if (input_point_set.count(key)) {
+            return; // find duplicate input point of utxo
+        }
+
+        input_point_set.insert(key);
+    }
+
     buffer_.push_back({ tx, handler });
 }

@baaa
Copy link
Author

baaa commented Sep 22, 2018

step by step build instructions for pool owners:

mkdir mvsbuild
cd mvsbuild/
git clone https://github.com/mvs-org/metaverse.git
cd metaverse/
git checkout 0.8.3

---> edit src/lib/blockchain/transaction_pool.cpp
find the function void transaction_pool::add(transaction_ptr tx, confirm_handler handler)
change it to

void transaction_pool::add(transaction_ptr tx, confirm_handler handler)
{
    // When a new tx is added to the buffer drop the oldest.
    if (maintain_consistency_ && buffer_.size() == buffer_.capacity())
        delete_package(error::pool_filled);

    std::set<std::string> input_point_set;
    for (const auto& input : tx->inputs) {
        auto key = libbitcoin::encode_hash(input.previous_output.hash) + std::string(":") + std::to_string(input.previous_output.index);
        if (input_point_set.count(key)) {
            return; // find duplicate input point of utxo
        }

        input_point_set.insert(key);
    }


    buffer_.push_back({ tx, handler });
}

sudo apt-get install build-essential autoconf automake libtool pkg-config git cmake
sudo ./install_dependencies.sh --build-boost --build-upnpc
mkdir build
cd build
cmake ..
make -j4
sudo make install

@NotoriousPyro
Copy link

Well done again MVS team for not letting pool owners know. Absolutely exemplary work...

@baaa
Copy link
Author

baaa commented Sep 22, 2018

it is not mvs teams job to monitor pools. it was a bug and a team member came up with a solution 1 hour after it being reported. metaverse.farm stopped producing blocks almost a complete day before this bug even affected the network, so something else is probably wrong there.

Furthermore github is not a good place to whinge and whine, it is mainly used for source code management.

However, I understand your failure to realise your pool has not produced a single block in 46 hours and you want to blame someone for it.

@NotoriousPyro
Copy link

NotoriousPyro commented Sep 22, 2018

it is not mvs teams job to monitor pools. it was a bug and a team member came up with a solution 1 hour after it being reported. metaverse.farm stopped producing blocks almost a complete day before this bug even affected the network, so something else is probably wrong there.

It's mvs teams' job to ensure network stability and conformity is most definitely their job. By allowing serious bugs to propogate, like the one a few months ago where if we hadn't have been notified of a serious wallet bug, that the chain would fork which is pretty serious, they are allowing the network to weaken, thus allowing higher potential of a 51% attack.

Furthermore github is not a good place to whinge and whine, it is mainly used for source code management.

I have programmed and used GitHub before you even wrote your first "Hello World" mate. I don't need you to explain to me what it's used for. This is most definitely the place to have the discussion about MVS team's lack of serious bug notifications, the wallets control the network and they are responsible for the network - they have all our email addresses all they need to do is send an email.

However, I understand your failure to realise your pool has not produced a single block in 46 hours and you want to blame someone for it.

Just because you have nothing better to do with your time so you have all this time left to dedicate to ensuring your pool is super operational (might I add while also looking shit and in need of innovation), doesn't mean we all have nothing better to do with our time.

@baaa
Copy link
Author

baaa commented Sep 22, 2018

I am befuddled how you managed to not call me "son" in that rant. Everyone in the community is well aware of your tendencies. I mean why on earth would you try to attack me about my first hello world, or "innovation" of dodopool or what I do with my time? I sincerely struggle to understand. I could defend my experience, pool or lifestyle but that'd contribute to this futile argument.

Stop attacking people on github or random forum pages. Go innovate some solutions so you don't have to dedicate all your time to pool. on top of my head 3 lines of shellscript

if my pool hasn't produced any blocks for the last x minutes {
  aws sns publish --phone-number +44myphonenumber --message "the pool made a booboo"
}

i'm not going to get further baited into an argument here,
best of luck,

@NotoriousPyro
Copy link

NotoriousPyro commented Sep 22, 2018

I am befuddled how you managed to not call me "son" in that rant

Well thanks for confirming I was at least correct you haven't been around long then.

The fact of the matter is, regardless of if people LIKE me or not is irrelevant to me and I could care less. What I do care about is a stable, solid wallet. A team which is enterprise and company ready which includes alerting systems for serious network issues.

I care about valid transactions, people not ripping off miners like CryptoPoolPond did, or how you somehow used to claim the missing payouts where "out of your control" - was that to pocket some of it?

But I don't expect a hobbyist engineer like yourself to know that.

@NotoriousPyro
Copy link

NotoriousPyro commented Sep 23, 2018

metaverse.farm stopped producing blocks almost a complete day before this bug even affected the network, so something else is probably wrong there.

This was actually confirmed as this bug, as Metaverse.farm started mining again by the patch above... Nothing "wrong" with ANYTHING programmed by me at all.

This was after the blocktime attack which I had already notified of and it remained unfixed for some time. Then there was the wallet corruption, and now block validation?

The wallet critical bugs have struck again - no enterprise or company would take this seriously at this level of amateur project programming.

@baaa
Copy link
Author

baaa commented Sep 23, 2018

that is interesting. can you kindly paste the transaction id that stopped metaverse.farm a day before others? I'd like to see why a transaction only tried to propagate through your wallet and stopped it.

@NotoriousPyro
Copy link

NotoriousPyro commented Sep 23, 2018

The first time a double spend appeared was

20180921T090453 WARNING [blockchain] Double spend attempt.
20180921T090453 WARNING [blockchain] Invalid input [6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220:0]
20180921T090453 WARNING [blockchain] Invalid block [c4181f4d317300da234763fcfd832117d27b95a713966e9b7d8bf0b4acb5a5df] validation of inputs failed
20180921T090453 WARNING [blockchain] orphan_chain.empty()
20180921T090453 ERROR [consensus] store_block error: validation of inputs failed

I presume the fact the last block was found at 9pm on the 20th was just bad luck that then we were affected by this 12 hours later... (which would be the reason for the length of time between the last block found - 20th at 21:00 - until recently patched....)

20180921T090453 DEBUG [blockchain] Orphan pool added block [c4181f4d317300da234763fcfd832117d27b95a713966e9b7d8bf0b4acb5a5df] previous [6a1d8e5d4b7c0cfc55b960e75b17627d73b592a653b5546c59574bceb4508835] old size (205).
20180921T090453 INFO [blockchain] Block [1516448] verify (7) txs and (11) inputs
20180921T090453 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220
20180921T090453 INFO [blockchain] Block [1516448] unverified in (0.001) secs or (0.0909091) ms/input
20180921T090453 DEBUG [blockchain] Orphan pool removed block [c4181f4d317300da234763fcfd832117d27b95a713966e9b7d8bf0b4acb5a5df] old size (206). with status: validation of inputs failed
20180921T090453 DEBUG [blockchain]  delete_tx hash:6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220 success
20180921T090453 DEBUG [consensus] force create new block
20180921T090453 DEBUG [consensus] put_result nonce:275761080b610d6f mix_hash:0x06eae945c99c0a7925532a01adc708468f89ea757711d5ddb5695e7bf12072a6 fail
20180921T090455 DEBUG [blockchain] Orphan pool added block [287e7a8db0ff86d8cf732818117b58cb3019b2b4c6f20c859c2ffa846a5e92ff] previous [6a1d8e5d4b7c0cfc55b960e75b17627d73b592a653b5546c59574bceb4508835] old size (205).
20180921T090455 INFO [blockchain] Block [1516448] verify (6) txs and (9) inputs
20180921T090455 INFO [blockchain] Block [1516448] verified in (0) secs or (0) ms/input
20180921T090455 DEBUG [blockchain] Orphan pool removed block [287e7a8db0ff86d8cf732818117b58cb3019b2b4c6f20c859c2ffa846a5e92ff] old size (206). with status: success
20180921T090455 DEBUG [blockchain]  push block height:1516448 hash:287e7a8db0ff86d8cf732818117b58cb3019b2b4c6f20c859c2ffa846a5e92ff
20180921T090455 DEBUG [blockchain] Reorganize: tx pool size (5) forked at (1516447) new blocks (1) replace blocks (0)
20180921T090522 DEBUG [blockchain] Orphan pool added block [28e0cfdcb63bd7ad0d1c0ec1442f1031f663ab4bee44f03abc42e2266857a34e] previous [287e7a8db0ff86d8cf732818117b58cb3019b2b4c6f20c859c2ffa846a5e92ff] old size (205).
20180921T090522 INFO [blockchain] Block [1516449] verify (2) txs and (2) inputs
20180921T090522 INFO [blockchain] Block [1516449] verified in (0) secs or (0) ms/input
20180921T090522 DEBUG [blockchain] Orphan pool removed block [28e0cfdcb63bd7ad0d1c0ec1442f1031f663ab4bee44f03abc42e2266857a34e] old size (206). with status: success
20180921T090522 DEBUG [blockchain]  push block height:1516449 hash:28e0cfdcb63bd7ad0d1c0ec1442f1031f663ab4bee44f03abc42e2266857a34e
20180921T090522 DEBUG [blockchain] Reorganize: tx pool size (1) forked at (1516448) new blocks (1) replace blocks (0)
20180921T090525 DEBUG [network] sync hosts to file(/.metaverse/hosts.cache), active hosts size is 5700 hosts found, inactive hosts size is 0
20180921T090535 DEBUG [node] Potential transaction from [49.51.40.205:5251].ec1ce0c5fffa213905e71c0bf533055a4cc5e9ebe92b5eb28c3cf490ee55917d
20180921T090535 DEBUG [blockchain] Transaction saved to mempool (1)

@NotoriousPyro
Copy link

See, double spend attempt and this is precisely around the time this all began. All the times add up: https://explorer.mvs.org/tx/6733c1ab1e19a9815f00d85c26e90deefe2215f6b0880632e02e3760b4ccc220

@itsmylife44
Copy link

img_20180924_085916

@baaa

Are you sure It wasn't a metaverse problem ?

@luozhaohui
Copy link
Contributor

img_20180924_085916

@baaa

Are you sure It wasn't a metaverse problem ?

There is another issue about this.
#325

@itsmylife44
Copy link

After patching It show

20180925T103126 DEBUG [blockchain] Orphan pool added block [b1e870ae07d0a5a4c6c98003008876036539606f9c2bf4dd68013f5df6b24451] previous [34385a8b15e716a2f7ee30920e9384a01373c2b2052f8ac4198600d1697bd520] old size (2). 20180925T103126 INFO [blockchain] Block [1526938] verify (1) txs and (1) inputs 20180925T103126 INFO [blockchain] Block [1526938] verified in (0) secs or (0) ms/input 20180925T103126 DEBUG [blockchain] Orphan pool removed block [b1e870ae07d0a5a4c6c98003008876036539606f9c2bf4dd68013f5df6b24451] old size (3). with status: success 20180925T103126 DEBUG [blockchain] push block height:1526938 hash:b1e870ae07d0a5a4c6c98003008876036539606f9c2bf4dd68013f5df6b24451 20180925T103126 DEBUG [blockchain] Reorganize: tx pool size (0) forked at (1526937) new blocks (1) replace blocks (0) 20180925T103132 DEBUG [network] sync hosts to file(/root/.metaverse/hosts.cache), active hosts size is 5858 hosts found, inactive hosts size is 0 20180925T103143 DEBUG [blockchain] Orphan pool added block [fa13281e3c0ecbed5bbab43f4731efa0e136b79085dede89414e39d6ff01e8cf] previous [b1e870ae07d0a5a4c6c98003008876036539606f9c2bf4dd68013f5df6b24451] old size (2). 20180925T103143 INFO [blockchain] Block [1526939] verify (1) txs and (1) inputs 20180925T103143 INFO [blockchain] Block [1526939] verified in (0) secs or (0) ms/input 20180925T103143 DEBUG [blockchain] Orphan pool removed block [fa13281e3c0ecbed5bbab43f4731efa0e136b79085dede89414e39d6ff01e8cf] old size (3). with status: success 20180925T103143 DEBUG [blockchain] push block height:1526939 hash:fa13281e3c0ecbed5bbab43f4731efa0e136b79085dede89414e39d6ff01e8cf 20180925T103143 DEBUG [blockchain] Reorganize: tx pool size (0) forked at (1526938) new blocks (1) replace blocks (0)

@luozhaohui
Copy link
Contributor

This issue is fixed in v0.8.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants