VeriBlock / vbk-ri-btc

Bitcoin Core integration/staging tree
https://bitcoincore.org/en/download
Other
4 stars 6 forks source link

New best block(s) #315

Closed Leonardiae closed 4 years ago

Leonardiae commented 4 years ago

I noticed in my logs that it often happens that the latest block is being overwritten. I just checked the logs of one of those cases and wonder why this happens in this case:

For some reason there seem to be three different block hashes available for block 9216: f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000 00000038873cf79d995ffa9308aa75446fb9649d6eb60f4cb9a10e05ead923f4 00000001fe0c54d97e2945cb5a757f6e548fb1478407493b2008535770ad68a1

My APM had been endorsing block 9216:00000038873cf79d995ffa9308aa75446fb9649d6eb60f4cb9a10e05ead923f4 (https://testnet.explore.veriblock.org/tx/85D2804449FF1F1A126AE7F3A90C0D347ACD180996BFCE0341C2416E93905CFF) so it ends up endorsing a block that does not being used anymore in the end. (I assume I don't get paid for this endorsement but not sure). //vbtca3af4e9b

I'm not an expert on block forking :) but why was the latest block overwritten twice without a new (9217) block being found and while chain A remains the best chain all the time (as far as I can see)?

2020-08-20T05:25:12Z [] UpdateTip: new best=ALT:9215:00000001278eb9717e0d2561c7ea0ed00b9611e36cc0235127b383c75420469a VBK:788038:000000001ed0f6a2c5504474e93a33a74cf5f12c9243217f BTC:1807855:00000000e20ebc7d1889c0c8b9320fef30f7c25c2c373d4a285b9aa340c1e8e2 version=0x20000000 log2_work=41.988428 tx=10524 date='2020-08-20T05:11:04Z' progress=1.000000 cache=0.0MiB(348txo)
2020-08-20T05:40:27Z [] [alt-cpp] [info] addPayloads: ALT add 74 VBK, 4 VTB, 8 ATV payloads to block ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution.
2020-08-20T05:25:12Z [] UpdateTip: new best=ALT:9215:00000001278eb9717e0d2561c7ea0ed00b9611e36cc0235127b383c75420469a VBK:788038:000000001ed0f6a2c5504474e93a33a74cf5f12c9243217f BTC:1807855:00000000e20ebc7d1889c0c8b9320fef30f7c25c2c373d4a285b9aa340c1e8e2 version=0x20000000 log2_work=41.988428 tx=10524 date='2020-08-20T05:11:04Z' progress=1.000000 cache=0.0MiB(348txo)
2020-08-20T05:40:27Z [] [alt-cpp] [info] addPayloads: ALT add 74 VBK, 4 VTB, 8 ATV payloads to block ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:8808:a78b4e5e3b8f3d20f29a634d32ef21632c4dc6c9411f9db0647b0c3d03000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:8831:7c82ceae1ed5d9ee9faccc80e3594bc49f1c7509a84536f6aadcf4a41b000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:8848:3f38f7ca7dc775c4ca65094a781303b20900520067bb744e3600afdc01000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:8864:9fc1af2dc32d21d667ff4d35d7dac4fdf53e84cb07487765d6a29b3500000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:8912:7f64bea1d0a0f50dd0c8710579089aa5f0d091161012e41bf97b500501000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:8921:3d98363b02c9170ac82d91e15bfb7b11b6b13998acf790bcd466a2670c000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:8963:a1c071f5ee8e3b0480b274fb14093d5f5aaebfb7f50174cf3b867c2900000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:8975:1710b9d30b66bb9b6bd48a048555f7e176ca3eab6f65af073743c4a961000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScoreImpl: ChainA score=500, ChainB score=0
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:8985:b7a250a75b0733b53ff7b7f25c34f8ead304a597ab1668a15685cb8300000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScoreImpl: ChainA score=300, ChainB score=0
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:8989:9f5ade06b2c8dd89d3327ec434cfc59c27ad80902f9857546d5c39fe00000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:8999:4ad3bbc4a6e282ef44964a7ccd4dd5ef77d8b8ec735cee93f23073fb02000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:9006:d0a8fac1e9d43b81efcae92dd7b5bafa13676ad884321c1b14e08e8800000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:9020:70f6ed43d05dbd21cb25b71bca6d62a273fc669d0688fd4f507ffe1101000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScoreImpl: ChainA score=300, ChainB score=0
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:9067:2fd3bfc5e82c6e9007d6ecb91262c7c22b3b05f801a6d5f7360084d102000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:9096:ce4a94ad9352704ce9994c8a8ae2cbc6470ab0462252565267e4c9b402000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:9158:6a598c1a61438012b818d6f08deb9c65cba4c5e3124e4097021e5cef2a000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:9173:2a4f4297afaf4c3bb8110f6dd8479790f5d8771bf690a8a177020f1447000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Candidate ALT:9177:8b5b339ef7722e2591968262f8d4ebf317a2098516f70b8f201197aa4e000000 is invalid, the current chain wins
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9215:9a462054c783b3275123c06ce311960bd00eeac761250d7e71b98e2701000000, Candidate=ALT:9180:cf45436e2695f3a6164493db73f5041eb4868a9f139c8f3badacde5a01000000
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScoreImpl: ChainA score=100, ChainB score=0
2020-08-20T05:40:27Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:40:28Z [] UpdateTip: new best=ALT:9216:00000038873cf79d995ffa9308aa75446fb9649d6eb60f4cb9a10e05ead923f4 VBK:788112:0000000014d0dbc626b6ddce3f142449234589fbc7fe964f BTC:1807857:0000000056ff6c4ec0402b0117158ad2331d88c6c9d9b637007396adde78aec0 version=0x20080000 log2_work=41.98844 tx=10525 date='2020-08-20T05:40:18Z' progress=1.000000 cache=0.0MiB(351txo)
2020-08-20T05:45:13Z [] [alt-cpp] [info] addPayloads: ALT add 41 VBK, 2 VTB, 4 ATV payloads to block ALT:9216:a168ad70575308203b49078447b18f546e7f755acb45297ed9540cfe01000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:8808:a78b4e5e3b8f3d20f29a634d32ef21632c4dc6c9411f9db0647b0c3d03000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:8831:7c82ceae1ed5d9ee9faccc80e3594bc49f1c7509a84536f6aadcf4a41b000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:8848:3f38f7ca7dc775c4ca65094a781303b20900520067bb744e3600afdc01000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:8864:9fc1af2dc32d21d667ff4d35d7dac4fdf53e84cb07487765d6a29b3500000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:8912:7f64bea1d0a0f50dd0c8710579089aa5f0d091161012e41bf97b500501000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:8921:3d98363b02c9170ac82d91e15bfb7b11b6b13998acf790bcd466a2670c000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:8963:a1c071f5ee8e3b0480b274fb14093d5f5aaebfb7f50174cf3b867c2900000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:8975:1710b9d30b66bb9b6bd48a048555f7e176ca3eab6f65af073743c4a961000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScoreImpl: ChainA score=500, ChainB score=0
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:8985:b7a250a75b0733b53ff7b7f25c34f8ead304a597ab1668a15685cb8300000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScoreImpl: ChainA score=300, ChainB score=0
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:8989:9f5ade06b2c8dd89d3327ec434cfc59c27ad80902f9857546d5c39fe00000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:8999:4ad3bbc4a6e282ef44964a7ccd4dd5ef77d8b8ec735cee93f23073fb02000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:9006:d0a8fac1e9d43b81efcae92dd7b5bafa13676ad884321c1b14e08e8800000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:9020:70f6ed43d05dbd21cb25b71bca6d62a273fc669d0688fd4f507ffe1101000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScoreImpl: ChainA score=300, ChainB score=0
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:9067:2fd3bfc5e82c6e9007d6ecb91262c7c22b3b05f801a6d5f7360084d102000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:9096:ce4a94ad9352704ce9994c8a8ae2cbc6470ab0462252565267e4c9b402000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:9158:6a598c1a61438012b818d6f08deb9c65cba4c5e3124e4097021e5cef2a000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:9173:2a4f4297afaf4c3bb8110f6dd8479790f5d8771bf690a8a177020f1447000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Candidate ALT:9177:8b5b339ef7722e2591968262f8d4ebf317a2098516f70b8f201197aa4e000000 is invalid, the current chain wins
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:9180:cf45436e2695f3a6164493db73f5041eb4868a9f139c8f3badacde5a01000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScoreImpl: ChainA score=100, ChainB score=0
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Chain A remains the best chain
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Doing ALT POP fork resolution. Best=ALT:9216:f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000, Candidate=ALT:9216:a168ad70575308203b49078447b18f546e7f755acb45297ed9540cfe01000000
2020-08-20T05:45:13Z [] [alt-cpp] [info] comparePopScore: Neither chain crossed a keystone boundary: chains are equal
2020-08-20T05:45:13Z [] UpdateTip: new best=ALT:9215:00000001278eb9717e0d2561c7ea0ed00b9611e36cc0235127b383c75420469a VBK:788038:000000001ed0f6a2c5504474e93a33a74cf5f12c9243217f BTC:1807855:00000000e20ebc7d1889c0c8b9320fef30f7c25c2c373d4a285b9aa340c1e8e2 version=0x20000000 log2_work=41.988428 tx=10524 date='2020-08-20T05:11:04Z' progress=1.000000 cache=0.0MiB(351txo)
2020-08-20T05:45:14Z [] UpdateTip: new best=ALT:9216:00000001fe0c54d97e2945cb5a757f6e548fb1478407493b2008535770ad68a1 VBK:788079:000000002cbf16e40330b4d07372e4aeef53bac50c8f9307 BTC:1807856:0000000030edde73593335f9bc973d643dec166a6403e5e8ed8e7ef3f99b0d3f version=0x20080000 log2_work=41.988858 tx=10525 date='2020-08-20T05:25:17Z' progress=1.000000 cache=0.0MiB(354txo)

Warchant commented 4 years ago

@Leonardiae

f423d9ea050ea1b94c0fb66e9d64b96f4475aa0893fa5f999df73c8738000000

is actually reversed

00000038873cf79d995ffa9308aa75446fb9649d6eb60f4cb9a10e05ead923f4

And third hash is probably a block on the same height.

In BTC it takes long time to mine a block and when it is already mined there's little chance that your block on same height will be selected as best, if you mine it a bit later. So all miners pay attention at network and if new block is created they cancel mining at current height, and start building new block on top of new last block.

In our case we use generatetoaddress which does not cancel mining until it succeeds. As a result, you can observe a lot of forks with length=1 (when there're 2 blocks on same height) when multiple miners mine blocks.

  /-o  -> fork with length=1
o-o-o  -> current tip

As for "chain A always wins" -> chain A is currently applied chain (in our terms), chain B is any other block. When any new block comes we do POP Fork Resolution between current best chain (A) all tip candidates (essentially, all valid tips). When current tip is better, it says "A is better". When other chain wins, it prints "chain B wins". Debug.log is polluted, yes, but it helps to debug.

Leonardiae commented 4 years ago

@Warchant Thanks for explaining! This is cool stuff to learn more about.

I learned that there can be a lot of forks with length 1 but for me this raises several questions:

For me as a PoP miner the issue is that I have been PoP mining a block hash (and paid the fees to send the endorsements to the VBK network) and I assume I don't get paid for an endorsement of a block hash that never reaches the needed amount of confirmations.

Leonardiae commented 4 years ago

Actually in this case I got a nice payment :) DONE 11. COMPLETED Paid amount: 866.80518660

Warchant commented 4 years ago

Why is another hash selected as new best? I could understand if another block was build on that hash, but this was not the case here. the other hash is selected as new best without a new block being found yet (as far as I have seen).

It is hard to say. With our current setup it is very likely that both blocks on same height will have same POP score. In this case, we fallback to FR by chainwork (native FR in bitcoin). If block won, then it is better either by POP score or has higher chainwork.

Why is generatetoaddress being used in this case?

We did not invest time into changing mining software, generatetoaddress was easiest choice.

Leonardiae commented 4 years ago

Thanks again. Well then I think this is the answer for now. If nessecary in the future I'll circle back to this :)