Bitcoin-ABC / Bitcoin-ABC/bitcoin-abc

getblockchaininfo returns blocks > headers when update from 0.18.5 to 0.18.6

Open
#305 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
1.3k
Forks
788
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue
When I update bitcoin abc from `0.18.5` to `0.18.6` and run `bitcoin-cli getblockchaininfo` on testnet, it returns blocks > headers.
```
{
"chain": "test",
"blocks": 1286392,
"headers": 1286288,
"bestblockhash": "000000000000a77a83ec1dbbda5c8197358ff923467defea577230885a1e167a",
"difficulty": 1,
"mediantime": 1550287157,
"verificationprogress": 0.9999991773758619,
"chainwork": "0000000000000000000000000000000000000000000000439e9c205f379d5d51",
"pruned": false,
"softforks": [
{
"id": "bip34",
"version": 2,
"reject": {
"status": true
}
},
{
"id": "bip66",
"version": 3,
"reject": {
"status": true
}
},
{
"id": "bip65",
"version": 4,
"reject": {
"status": true
}
},
{
"id": "csv",
"version": 5,
"reject": {
"status": true
}
}
]
}
```

### Expected behaviour
blocks <= headers

### Actual behaviour
blocks > header

### Machine specs:
- OS: MacOS
- CPU: 2.9 GHz Intel Core i9
- RAM: 32Gb
- Disk size: 256Gb
- Disk Type (HD/SDD): SDD

After update, I tried run bitcoin-abc with [`-reindex`](https://bitcoin.stackexchange.com/questions/60709/when-should-i-use-reindex-chainstate-and-when-reindex/60711) option, but the blocks number is still bigger than headers number.
Result of `bitcoin-cli getnetworkinfo`
```
{
"version": 180600,
"subversion": "/Bitcoin ABC:0.18.6(EB32.0)/",
"protocolversion": 70015,
"localservices": "0000000000000025",
"localrelay": true,
"timeoffset": -1,
"networkactive": true,
"connections": 8,
"networks": [
{
"name": "ipv4",
"limited": false,
"reachable": true,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "ipv6",
"limited": false,
"reachable": true,
"proxy": "",
"proxy_randomize_credentials": false
},
{
"name": "onion",
"limited": true,
"reachable": false,
"proxy": "",
"proxy_randomize_credentials": false
}
],
"relayfee": 0.00001000,
"excessutxocharge": 0.00000000,
"localaddresses": [
],
"warnings": ""
}
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the testnet upgrade scenario from Bitcoin ABC 0.18.5 to 0.18.6 and inspect the implementation behind bitcoin-cli getblockchaininfo, including behavior after -reindex. Compare the reported blocks and headers values with the chain state; done means the RPC no longer reports blocks greater than headers and the behavior is verified after reindexing.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.