⚠️ jsarenik reopened an issue: "not punishing manually connected peer"
(https://github.com/bitcoin/bitcoin/issues/30426)
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Current behaviour
The only peer (via `connect=IP` in `bitcoin.conf`) is another local node also running this same aba504759caa version and that node has 94 other peers at the moment so I guess there is no problem there.
I do not know if it is related, but since I run aba504759caa (the testnet4 commit) also for mainnet, here is link to testnet4: https://github.com/bitcoin/bitcoin/pull/29775
### Expec
...
(https://github.com/bitcoin/bitcoin/issues/30426)
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Current behaviour
The only peer (via `connect=IP` in `bitcoin.conf`) is another local node also running this same aba504759caa version and that node has 94 other peers at the moment so I guess there is no problem there.
I do not know if it is related, but since I run aba504759caa (the testnet4 commit) also for mainnet, here is link to testnet4: https://github.com/bitcoin/bitcoin/pull/29775
### Expec
...
💬 jsarenik commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222170006)
Ah, I have something:
```
2024-07-11T06:50:34Z initload thread exit
2024-07-11T06:50:34Z [net] sending getheaders (1029 bytes) peer=0
2024-07-11T06:50:34Z [net] initial getheaders (851623) to peer=0 (startheight:851650)
2024-07-11T06:50:34Z Leaving InitialBlockDownload (latching to false)
2024-07-11T06:50:34Z [net] received: headers (2188 bytes) peer=0
2024-07-11T06:50:34Z [net] Misbehaving: peer=0: invalid header received
2024-07-11T06:50:34Z Warning: not punishing manually connected
...
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222170006)
Ah, I have something:
```
2024-07-11T06:50:34Z initload thread exit
2024-07-11T06:50:34Z [net] sending getheaders (1029 bytes) peer=0
2024-07-11T06:50:34Z [net] initial getheaders (851623) to peer=0 (startheight:851650)
2024-07-11T06:50:34Z Leaving InitialBlockDownload (latching to false)
2024-07-11T06:50:34Z [net] received: headers (2188 bytes) peer=0
2024-07-11T06:50:34Z [net] Misbehaving: peer=0: invalid header received
2024-07-11T06:50:34Z Warning: not punishing manually connected
...
💬 jsarenik commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222173245)
How can I receive an invalid header from a perfectly running node?
mainnet, I just use the same version which I use for testnet4
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222173245)
How can I receive an invalid header from a perfectly running node?
mainnet, I just use the same version which I use for testnet4
💬 jsarenik commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222191303)
```
2024-07-11T07:02:21Z UpdateTip: new best=000000000000000000036686ffd324b99fa90f190f48c7372e14738bda739383 height=851624 version=0x2462e000 log2_work=95.031625 tx=1038976733 date='2024-07-11T02:42:12Z' progress=0.999901 cache=17.4MiB(151149txo)
2024-07-11T07:02:21Z initload thread exit
2024-07-11T07:02:21Z [net] sending getheaders (1029 bytes) peer=0
2024-07-11T07:02:21Z [net] initial getheaders (851623) to peer=0 (startheight:851650)
2024-07-11T07:02:21Z Leaving InitialBlockDownload (la
...
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222191303)
```
2024-07-11T07:02:21Z UpdateTip: new best=000000000000000000036686ffd324b99fa90f190f48c7372e14738bda739383 height=851624 version=0x2462e000 log2_work=95.031625 tx=1038976733 date='2024-07-11T02:42:12Z' progress=0.999901 cache=17.4MiB(151149txo)
2024-07-11T07:02:21Z initload thread exit
2024-07-11T07:02:21Z [net] sending getheaders (1029 bytes) peer=0
2024-07-11T07:02:21Z [net] initial getheaders (851623) to peer=0 (startheight:851650)
2024-07-11T07:02:21Z Leaving InitialBlockDownload (la
...
💬 maflcko commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222191711)
ugh. Why is the `BlockValidationState` not logged?
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222191711)
ugh. Why is the `BlockValidationState` not logged?
💬 jsarenik commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222192561)
Already on Bitcoin 27.1 binary release from bitcoincore.org
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222192561)
Already on Bitcoin 27.1 binary release from bitcoincore.org
💬 maflcko commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222197175)
> ugh. Why is the `BlockValidationState` not logged?
You'll also have to enable validation logging. (C.f. `ChainstateManager::AcceptBlockHeader`)
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222197175)
> ugh. Why is the `BlockValidationState` not logged?
You'll also have to enable validation logging. (C.f. `ChainstateManager::AcceptBlockHeader`)
💬 jsarenik commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222210269)
```
2024-07-11T07:15:41Z UpdateTip: new best=000000000000000000036686ffd324b99fa90f190f48c7372e14738bda739383 height=851624 version=0x2462e000 log2_work=95.031625 tx=1038976733 date='2024-07-11T02:42:12Z' progress=0.999896 cache=17.2MiB(151149txo)
2024-07-11T07:15:41Z [validation] Enqueuing BlockConnected: block hash=000000000000000000036686ffd324b99fa90f190f48c7372e14738bda739383 block height=851624
2024-07-11T07:15:41Z [validation] Enqueuing UpdatedBlockTip: new block hash=00000000000000000
...
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222210269)
```
2024-07-11T07:15:41Z UpdateTip: new best=000000000000000000036686ffd324b99fa90f190f48c7372e14738bda739383 height=851624 version=0x2462e000 log2_work=95.031625 tx=1038976733 date='2024-07-11T02:42:12Z' progress=0.999896 cache=17.2MiB(151149txo)
2024-07-11T07:15:41Z [validation] Enqueuing BlockConnected: block hash=000000000000000000036686ffd324b99fa90f190f48c7372e14738bda739383 block height=851624
2024-07-11T07:15:41Z [validation] Enqueuing UpdatedBlockTip: new block hash=00000000000000000
...
💬 jsarenik commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222218220)
```
2024-07-11T07:20:02Z [validation] AcceptBlockHeader: block 00000000000000000000c29870d6f87b9aca6577e25ab2a780603e605db99ae4 is marked invalid
2024-07-11T07:20:02Z [net] Misbehaving: peer=0 (0 -> 100) DISCOURAGE THRESHOLD EXCEEDED: invalid header received
2024-07-11T07:20:02Z Warning: not punishing manually connected peer 0!
```
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222218220)
```
2024-07-11T07:20:02Z [validation] AcceptBlockHeader: block 00000000000000000000c29870d6f87b9aca6577e25ab2a780603e605db99ae4 is marked invalid
2024-07-11T07:20:02Z [net] Misbehaving: peer=0 (0 -> 100) DISCOURAGE THRESHOLD EXCEEDED: invalid header received
2024-07-11T07:20:02Z Warning: not punishing manually connected peer 0!
```
💬 jsarenik commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222220690)
marked invalid here on this run, but not by mempool https://mempool.space/block/00000000000000000000c29870d6f87b9aca6577e25ab2a780603e605db99ae4
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222220690)
marked invalid here on this run, but not by mempool https://mempool.space/block/00000000000000000000c29870d6f87b9aca6577e25ab2a780603e605db99ae4
💬 maflcko commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222222527)
You'll have to check the debug log when `00000000000000000000c29870d6f87b9aca6577e25ab2a780603e605db99ae4` was first connected to see the error reason.
But my guess would be corruption on your machine.
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222222527)
You'll have to check the debug log when `00000000000000000000c29870d6f87b9aca6577e25ab2a780603e605db99ae4` was first connected to see the error reason.
But my guess would be corruption on your machine.
💬 jsarenik commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222226878)
OK, data corruption is possible. How can I tell Bitcoin to redownload that block again?
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222226878)
OK, data corruption is possible. How can I tell Bitcoin to redownload that block again?
💬 maflcko commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222239736)
re-downloading the block may not be enough, depending on the data corruption.
For example, if the utxo db is corrupt, you'll have to build it from scratch.
I think calling the RPC `gettxoutsetinfo muhash` on both nodes (when they are synced to the same block) and it matches for all, then the chainstate leveldb at that point in time is probably fine.
To recreate the block connection to get the failure again, I think you can use `invalidateblock`+`reconsiderblock`.
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222239736)
re-downloading the block may not be enough, depending on the data corruption.
For example, if the utxo db is corrupt, you'll have to build it from scratch.
I think calling the RPC `gettxoutsetinfo muhash` on both nodes (when they are synced to the same block) and it matches for all, then the chainstate leveldb at that point in time is probably fine.
To recreate the block connection to get the failure again, I think you can use `invalidateblock`+`reconsiderblock`.
💬 jsarenik commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222249865)
Yes! Calling `gettxoutsetinfo muhash` triggered this:
```
2024-07-11T07:36:31Z Fatal LevelDB error: Corruption: block checksum mismatch: /home/b/.bitcoin/chainstate/13938982.ldb
2024-07-11T07:36:31Z You can use -debug=leveldb to get more complete diagnostic messages
2024-07-11T07:36:31Z *** System error while flushing: Fatal LevelDB error: Corruption: block checksum mismatch: /home/b/.bitcoin/chainstate/13938982.ldb
2024-07-11T07:36:31Z Error: A fatal internal error occurred, see debug.lo
...
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222249865)
Yes! Calling `gettxoutsetinfo muhash` triggered this:
```
2024-07-11T07:36:31Z Fatal LevelDB error: Corruption: block checksum mismatch: /home/b/.bitcoin/chainstate/13938982.ldb
2024-07-11T07:36:31Z You can use -debug=leveldb to get more complete diagnostic messages
2024-07-11T07:36:31Z *** System error while flushing: Fatal LevelDB error: Corruption: block checksum mismatch: /home/b/.bitcoin/chainstate/13938982.ldb
2024-07-11T07:36:31Z Error: A fatal internal error occurred, see debug.lo
...
✅ jsarenik closed an issue: "not punishing manually connected peer"
(https://github.com/bitcoin/bitcoin/issues/30426)
(https://github.com/bitcoin/bitcoin/issues/30426)
💬 jsarenik commented on issue "not punishing manually connected peer":
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222253823)
Thank you for support, @maflcko !
(https://github.com/bitcoin/bitcoin/issues/30426#issuecomment-2222253823)
Thank you for support, @maflcko !
👍 alfonsoromanz approved a pull request: "test, assumeutxo: Remove resolved todo comments and add new test"
(https://github.com/bitcoin/bitcoin/pull/30403#pullrequestreview-2171156459)
Re ACK e1018672672f39910655ab37080bf3213ca55a39
(https://github.com/bitcoin/bitcoin/pull/30403#pullrequestreview-2171156459)
Re ACK e1018672672f39910655ab37080bf3213ca55a39
💬 maflcko commented on pull request "rpc, rest: Improve getblock error when only header is available":
(https://github.com/bitcoin/bitcoin/pull/30410#issuecomment-2222264395)
> Makes sense to me, so concept a c k to that! Depending on how large this PR is going to be and how long it's going to take to complete it, I could either close this simple PR, which changes return errors and is not a refactor, or it could be a pure refactor on top of it? Let me know what you prefer.
Ok, I'll give it a try.
Another thing to check before closing the issue is the RPC return code: https://github.com/bitcoin/bitcoin/issues/20978#issuecomment-764846601 to confirm it is accurat
...
(https://github.com/bitcoin/bitcoin/pull/30410#issuecomment-2222264395)
> Makes sense to me, so concept a c k to that! Depending on how large this PR is going to be and how long it's going to take to complete it, I could either close this simple PR, which changes return errors and is not a refactor, or it could be a pure refactor on top of it? Let me know what you prefer.
Ok, I'll give it a try.
Another thing to check before closing the issue is the RPC return code: https://github.com/bitcoin/bitcoin/issues/20978#issuecomment-764846601 to confirm it is accurat
...
👍 darosior approved a pull request: "descriptors: Be able to specify change and receiving in a single descriptor string"
(https://github.com/bitcoin/bitcoin/pull/22838#pullrequestreview-2168736128)
ACK 00337ef0e115f8bd8c1ede425f21ae7a1b6d30de
(https://github.com/bitcoin/bitcoin/pull/22838#pullrequestreview-2168736128)
ACK 00337ef0e115f8bd8c1ede425f21ae7a1b6d30de
💬 darosior commented on pull request "descriptors: Be able to specify change and receiving in a single descriptor string":
(https://github.com/bitcoin/bitcoin/pull/22838#discussion_r1672053063)
nit: not dramatic but could have used a set to avoid `O(n^2)` complexity.
In any case we'll probably have to put some bounds on the number of multipaths steps in the fuzzer to avoid timeouts (as in #30197) as there is a few operations quadratic in the number of steps. Of course, not in this PR.
(https://github.com/bitcoin/bitcoin/pull/22838#discussion_r1672053063)
nit: not dramatic but could have used a set to avoid `O(n^2)` complexity.
In any case we'll probably have to put some bounds on the number of multipaths steps in the fuzzer to avoid timeouts (as in #30197) as there is a few operations quadratic in the number of steps. Of course, not in this PR.