dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

bad-stake-not-eligible errors on CreateNewBlock #956

Closed thothd closed 5 years ago

thothd commented 5 years ago

Describe the bug Proposer node gets one or more stake not eligible errors when building a block: ERROR: TestBlockValidity: CChainState::ConnectBlock: bad-stake-not-eligible, STAKE_NOT_ELIGIBLE (code 16)

To Reproduce Steps to reproduce the behavior:

  1. Run a proposer with some fund
  2. Propose a block
  3. After CreateNewBlock, getting one or more ERROR: TestBlockValidity: CChainState::ConnectBlock: bad-stake-not-eligible, STAKE_NOT_ELIGIBLE (code 16) errors

Expected behavior A clear log, maybe some information instead of error in case it's relevant

Environment MacOS

scravy commented 5 years ago

Is this the case with current master too? It does sound like what #952 was supposed to fix which was incorporated into #935

scravy commented 5 years ago

I can reproduce this and I'm getting:

2019-04-12 07:21:16 [            ] CreateNewBlock: block weight=1271 txs=0 fees=0 sigops=400
2019-04-12 07:21:16 [            ] ERROR: TestBlockValidity: CChainState::ConnectBlock: bad-stake-not-eligible, STAKE_NOT_ELIGIBLE (code 16)

The proposerstatus says:

09:19:20 scravy@pandoras-box:~/Github/scravy/unit-e (0)
$ src/unit-e-cli proposerstatus
{
  "wallets": [
    {
      "wallet": "wallet.dat",
      "balance": 10000000.00000000,
      "stakeable_balance": 10000000.00000000,
      "status": "IS_PROPOSING",
      "searches": 0,
      "searches_attempted": 0
    }
  ],
  "sync_status": "SYNCED",
  "time": "2019-04-12 07:22:16",
  "incoming_connections": 0,
  "outgoing_connections": 5,
  "active_chain": {
    "tip": "7c519909c03f203a3c305a63fb9c4d1246f093bdbe5bf2b6d4f122c68a1b32b7",
    "genesis": "adc5339b7bb2a66aea0fae7a6ab2d3716bd9269f1d4d106f7b5830b8ebcf8d3d",
    "current_height": 585,
    "current_size": 586
  }
}

and getblockchaininfo:

09:22:26 scravy@pandoras-box:~/Github/scravy/unit-e (0)
$ src/unit-e-cli getblockchaininfo
{
  "chain": "test",
  "blocks": 598,
  "headers": 7206,
  "bestblockhash": "43ff4938730ebb7de3c924df03cfdd71553e1d6fca7f56f9a1780ba8e66c516f",
  "difficulty": 3285526.435418709,
  "mediantime": 1555000936,
  "verificationprogress": 1,
  "initialblockdownload": false,
  "initialsnapshotdownload": false,
  "chainwork": "0000000000000000000000000000000000000000000000006ed07a7f4d79c449",
  "size_on_disk": 396889665,
  "pruned": false,
  "bip9_softforks": {
    "csv": {
      "status": "active",
      "startTime": -1,
      "timeout": 9223372036854775807,
      "since": 0
    }
  },
  "warnings": ""
}
09:

current master at df583d284cea7d895a625b2f64762f9359a55483

checking.

scravy commented 5 years ago

Also stats/counters for searches attempted are not correct (obviously a search was attempted but did not work out)