pocketnetteam / pocketnet.core

Decentralized social network based on the blockchain
https://pocketnet.app
Apache License 2.0
115 stars 28 forks source link

Staking problem #147

Closed andyoknen closed 2 years ago

andyoknen commented 2 years ago

little bit thoughts about:

-paytxfee=<amt>
       Fee (in POC/kB) to add to transactions you send (default: 0.00)

not sure if 0.00 is good value., because wallet by default wont send any pkoin until settxfee is set.

one more:

./getstakinginfo 
{
  "enabled": true,
  "staking": false,
  "errors": "",
  "currentblockweight": 0,
  "currentblocktx": 0,
  "difficulty": 209554.3210532084,
  "search-interval": 0,
  "weight": 288338140000,
  "balance": 288338140000,
  "netstakeweight": 228282320709942,
  "expectedtime": 0
}

wallet is unlocked, fully synced, but "staking": false, want start

also

estimatesmartfee 6
{
  "errors": [
    "Insufficient data or no feerate found"
  ],
  "blocks": 6
}

wallet is running few days but not able to estimate...

got same issues with previous(.16) version.

Originally posted by @nnmfnwl7 in https://github.com/pocketnetteam/pocketnet.core/issues/136#issuecomment-1006919586

andyoknen commented 2 years ago

@nnmfnwl7 I am looking at the code and I have an assumption that this may be due to the incorrect time of your PC.

What is the output from your node on public port 38081 for the getnodeinfo method?

curl --location --request POST '127.0.0.1:38081/' \
--header 'Content-Type: application/json' \
--data-raw '{"method":"getnodeinfo","params":[]}'
nnmfnwl7 commented 2 years ago

Time is correct, other chains works well. Hmm, curl: (7) Failed to connect to 127.0.0.1 port 38081: Connection refused, wondering why, because config has publicrpcport=38081 But anyway, staking should not depend on public rpc....

andyoknen commented 2 years ago

Staking really does not depend on the public port, just this method will show the node time. You can try to see the output of getblockchaininfo via a private port or a cli utility

nnmfnwl7 commented 2 years ago

Staking really does not depend on the public port, just this method will show the node time. You can try to see the output of getblockchaininfo via a private port or a cli utility

"chain": "main",
"blocks": 1523692,
"headers": 1523692,
"bestblockhash": "cfef08e3aa6ba1a7b1861b3cbb6755933202b2bf754b8a84fa82891bafe5731a",
"difficulty": 130492.5640324492,
"time": 1641992496,
"mediantime": 1641992192,
"verificationprogress": 0.9999993607580812,
"initialblockdownload": false,
"chainwork": "000000000000000000000000000000000000000000000030b2dae3068503f3ae",
"size_on_disk": 5045153541,
"pruned": false,
"coid": 100000000,
"softforks": [
{
"id": "bip34",
"version": 2,
"reject": {
"status": true
}
},
{
"id": "bip66",
"version": 3,
"reject": {
"status": true
}
},
{
"id": "bip65",
"version": 4,
"reject": {
"status": true
}
}
],
"bip9_softforks": {
"csv": {
"status": "failed",
"startTime": 1462060800,
"timeout": 1493596800,
"since": 100
},
"segwit": {
"status": "active",
"startTime": -1,
"timeout": 9223372036854775807,
"since": 0
}
},
"warnings": ""
}
andyoknen commented 2 years ago

@nnmfnwl7 I think it makes sense to look at the full log file of the node startup and the subsequent 5-10 minutes of work. Delete the debug.log file in the node data directory. Start the node:

> pocketcoind -debug=all
nnmfnwl7 commented 2 years ago

@nnmfnwl7 I think it makes sense to look at the full log file of the node startup and the subsequent 5-10 minutes of work. Delete the debug.log file in the node data directory. Start the node:

> pocketcoind -debug=all

Ok, and what string to look for in debug log, any string hints to focus on?

andyoknen commented 2 years ago

it's hard to say - I think the absence of any records may give us ideas

nnmfnwl7 commented 2 years ago

it's hard to say - I think the absence of any records may give us ideas

I have no time to look at logs when i have no clue what to look for. Aft first i was expecting ideas maybe about why "bip9_softforks": { "csv": { "status": "failed",... Next i was expecting what str seach for. So i deleted all chain data will try again from checkpoint , will see.

nnmfnwl7 commented 2 years ago

it's hard to say - I think the absence of any records may give us ideas

So finally tested, prebuild binary v0.20.18.0 version from github and seems like staking was enabled and working. So manually compiled from scratch again with clang version 11.0.1-2 and it was not working. So compiled with gcc 10.2.1 20210110 and seems like staking enabled and working, but still waiting for first stake to pass. Will see soon. So seems like problem is that CLANG compiler didn't done what was expected but GCC compiler did better job :D

nnmfnwl7 commented 2 years ago

Finally said, my issue was related to compiler, pkoin node compiled with clang break staking, node compiled with gcc staking works well.

andyoknen commented 2 years ago

This sounds strange, since I am building a test node for debugging using cmake and have no difficulties. @lostystyg can you help with this issue?

lostystyg commented 2 years ago

CMake is using one of the installed compilers based on toolchain. However, this looks like implementation defined stuff used somewhere in code that is bad. Its known that gcc has some things not related to C++ standard and clang has not but it is strange that using something of this can result in so polite behavior. If it is really implementation defined, then it is important to find out where because it means no-one prevents gcc from changing this in a newer versions and blow up our code. I'll try to reproduce this.