bonesoul / CoiniumServ

Next-gen crypto currency mining pool software
Other
795 stars 494 forks source link

Bitcoin getnetworkhashps overflow #933

Open felixonmars opened 6 years ago

felixonmars commented 6 years ago

Currently bitcoind returns a big float for getnetworkhashps:

$ bitcoin-cli getnetworkhashps
1.981210751281945e+19

This prevents CoiniumServ from starting up:

21:03:59 [Error] [Pool] [Bitcoin] Pool initilization failed; Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: CoiniumServ.Pools.INetworkInfo ---> Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: CoiniumServ.Pools.NetworkInfo ---> System.Exception: There was a problem deserializing the response from the coin wallet. ---> Newtonsoft.Json.JsonSerializationException: Error converting value 1.98121075128195E+19 to type 'System.UInt64'. Path 'result.networkhashps', line 1, position 158. ---> System.OverflowException: Arithmetic operation resulted in an overflow.
  at (wrapper managed-to-native) System.Object:__icall_wrapper___emul_fconv_to_ovf_u8 (double)
  at System.Convert.ToUInt64 (System.Double value) [0x00006] in <a84b655e5e6a49ee96b338ec792f5580>:0
  at System.Double.System.IConvertible.ToUInt64 (System.IFormatProvider provider) [0x00000] in <a84b655e5e6a49ee96b338ec792f5580>:0
  at System.Convert.ChangeType (System.Object value, System.Type conversionType, System.IFormatProvider provider) [0x00171] in <a84b655e5e6a49ee96b338ec792f5580>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType (Newtonsoft.Json.JsonReader reader, System.Object value, System.Globalization.CultureInfo culture, Newtonsoft.Json.Serialization.JsonContract contract, System.Type targetType) [0x000aa] in <dc86da7fc46c487ba6c7ab826da479cc>:0
   --- End of inner exception stack trace ---
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType (Newtonsoft.Json.JsonReader reader, System.Object value, System.Globalization.CultureInfo culture, Newtonsoft.Json.Serialization.JsonContract contract, System.Type targetType) [0x000eb] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0009b] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue (Newtonsoft.Json.Serialization.JsonProperty property, Newtonsoft.Json.JsonConverter propertyConverter, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, Newtonsoft.Json.JsonReader reader, System.Object target) [0x00061] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject (System.Object newObject, Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty member, System.String id) [0x00268] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00161] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0006d] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndCreatorValues (Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x0013a] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, Newtonsoft.Json.Serialization.ObjectConstructor`1[T] creator, System.String id) [0x000b2] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract objectContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id, System.Boolean& createdFromNonDefaultCreator) [0x0008b] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00148] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0006d] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000db] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00053] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x0002d] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value) [0x00000] in <dc86da7fc46c487ba6c7ab826da479cc>:0
  at CoiniumServ.Daemon.DaemonBase.GetRpcResponse[T] (System.Net.HttpWebRequest httpWebRequest) [0x0001e] in <a85beafdc66c462ba62a2ddb050a6d1a>:0
   --- End of inner exception stack trace ---
  at CoiniumServ.Daemon.DaemonBase.GetRpcResponse[T] (System.Net.HttpWebRequest httpWebRequest) [0x00036] in <a85beafdc66c462ba62a2ddb050a6d1a>:0
  at CoiniumServ.Daemon.DaemonBase.MakeRpcRequest[T] (CoiniumServ.Daemon.DaemonRequest walletRequest) [0x00008] in <a85beafdc66c462ba62a2ddb050a6d1a>:0
  at CoiniumServ.Daemon.DaemonBase.MakeRequest[T] (System.String method, System.Object[] parameters) [0x00019] in <a85beafdc66c462ba62a2ddb050a6d1a>:0
  at CoiniumServ.Daemon.DaemonClient.GetMiningInfo () [0x00000] in <a85beafdc66c462ba62a2ddb050a6d1a>:0
  at CoiniumServ.Pools.NetworkInfo.Recache () [0x00095] in <a85beafdc66c462ba62a2ddb050a6d1a>:0
  at CoiniumServ.Pools.NetworkInfo..ctor (CoiniumServ.Daemon.IDaemonClient daemonClient, CoiniumServ.Algorithms.IHashAlgorithm hashAlgorithm, CoiniumServ.Pools.IPoolConfig poolConfig) [0x00048] in <a85beafdc66c462ba62a2ddb050a6d1a>:0
  at (wrapper dynamic-method) System.Object:lambda_method (System.Runtime.CompilerServices.Closure,object[])
  at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) [0x000f7] in <bb3027f50b35411088f45475912cc2ff>:0
   --- End of inner exception stack trace ---
  at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) [0x0010d] in <bb3027f50b35411088f45475912cc2ff>:0
  at Nancy.TinyIoc.TinyIoCContainer+MultiInstanceFactory.GetObject (System.Type requestedType, Nancy.TinyIoc.TinyIoCContainer container, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) [0x0000e] in <bb3027f50b35411088f45475912cc2ff>:0
   --- End of inner exception stack trace ---
  at Nancy.TinyIoc.TinyIoCContainer+MultiInstanceFactory.GetObject (System.Type requestedType, Nancy.TinyIoc.TinyIoCContainer container, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) [0x00026] in <bb3027f50b35411088f45475912cc2ff>:0
  at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TinyIoCContainer+TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) [0x00027] in <bb3027f50b35411088f45475912cc2ff>:0
  at Nancy.TinyIoc.TinyIoCContainer.Resolve (System.Type resolveType, Nancy.TinyIoc.NamedParameterOverloads parameters) [0x0000d] in <bb3027f50b35411088f45475912cc2ff>:0
  at Nancy.TinyIoc.TinyIoCContainer.Resolve[ResolveType] (Nancy.TinyIoc.NamedParameterOverloads parameters) [0x00000] in <bb3027f50b35411088f45475912cc2ff>:0
  at CoiniumServ.Container.ObjectFactory.GetNetworkInfo (CoiniumServ.Daemon.IDaemonClient daemonClient, CoiniumServ.Algorithms.IHashAlgorithm hashAlgorithm, CoiniumServ.Pools.IPoolConfig poolConfig) [0x00035] in <a85beafdc66c462ba62a2ddb050a6d1a>:0
  at CoiniumServ.Pools.Pool.InitStatisticsServices () [0x00019] in <a85beafdc66c462ba62a2ddb050a6d1a>:0
  at CoiniumServ.Pools.Pool.Initialize () [0x00057] in <a85beafdc66c462ba62a2ddb050a6d1a>:0
bonesoul commented 6 years ago

which version of bitcoin, 0.16 or 0.15 series?

felixonmars commented 6 years ago

bitcoind version is at the latest stable 0.15.1. Do I need a newer one?

bonesoul commented 6 years ago

Nah, 0.16 will be going changes and i thought this would be about it - but seems not.

regtable commented 6 years ago

im having same error. works with other coins though

regtable commented 6 years ago

Thanks bonesoul guess it's waiting on next Bitcoin update

bonesoul commented 6 years ago

actually we can fix it i guess.

regtable commented 6 years ago

Everything's possible :-) I'm enjoying using coiniumserv so far best stratum mpos jobby I have found. Supports enough coins for my liking. And minimal issues bar resources running out. There is an odd one that makes me have to put a fee on and basically mints 1 less coin than reward is for the block and it's not dev fees because set to 0 fee it won't mine and set to 0.1 It takes 1.1 off. Only did that with one coin though. Incakoin if you want to test it. Have to set up extras in conf :-/

jeong760 commented 6 years ago

Dears,

Do you have any idea to sovled this? I've downgraded a bitcoin core from 15.1 to 15.0 but problem is not solved. so just wonder if this able to fix later on

Regards, John Ahn

regtable commented 6 years ago

They will Probably change getnetworkhashps to getnetworkmhashps in the Bitcoin client or get it futureproof and use getnetworkphashps I missed the first line myself. It's exponential numbers. E+19 makes for a very very large number. If mhsps that's down to a smaller number but Mayne still an exponent so then it would need to be ghsps

jeong760 commented 6 years ago

Dears,

So should I change a source code in order to solved this issue?
if you have any idea share please...

Regards, John Ahn -----Original Message----- From: "regtable"<notifications@github.com> To: "bonesoul/CoiniumServ"<CoiniumServ@noreply.github.com>; Cc: "jeong760"<jeong760@naver.com>; "Comment"<comment@noreply.github.com>; Sent: 2018-01-30 (화) 13:41:03 Subject: Re: [bonesoul/CoiniumServ] Bitcoin getnetworkhashps overflow (#933)

They will Probably change getnetworkhashps to getnetworkmhashps in the Bitcoin client or get it futureproof and use getnetworkphashps I missed the first line myself. It's exponential numbers. E+19 makes for a very very large number. If mhsps that's down to a smaller number but Mayne still an exponent so then it would need to be ghsps

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

regtable commented 6 years ago

No I think it will be done in the Bitcoin client code. So it handles the request differently and outputs a more humane number. If not then yes I'm sure something could be done in code but that will break a lot of other things I'm sure. Lets see what bonesoul thinks. But I will see what can be done in the mean time. This must be a recent issue with the skyrocket in hashpower

jeong760 commented 6 years ago

@regtable, I am not sure this is solved by following but mine has been gone above issue.

{ "enabled":true, "coin": "bitcoin.json", "daemon": { "host": "127.0.0.1", "port": 8332, "username": "RPC username", "password": "Password of RPC user" }, "meta": { "motd": "Welcome to CoiniumServ pool, enjoy your stay! - http://www.coiniumserv.com", "txMessage": "http://www.coiniumserv.com/" }, "wallet" : { "address": "1MMdwRZg4K9p6oH2bWUQdohbxGbAvXS1t1" }, "rewards": [ {"1MMdwRZg4K9p6oH2bWUQdohbxGbAvXS1t1": 1} ], "banning": { "enabled": true, "duration": 600, "invalidPercent": 50, "checkThreshold": 100, "purgeInterval": 300 }, "payments": { "enabled": true, "interval": 60, "minimum": 0.01 }, "miner": { "validateUsername": true, "timeout": 300 }, "job": { "blockRefreshInterval": 1000, "rebroadcastTimeout": 55
}, "stratum": { "enabled": true, "bind": "0.0.0.0", "port": 3333, "diff": 16, "vardiff": { "enabled": true, "minDiff": 8, "maxDiff": 512, "targetTime": 15, "retargetTime": 90, "variancePercent": 30 } }, "storage": { "hybrid": { "enabled": false, "redis": { "host": "127.0.0.1", "port": 6379, "password": "", "databaseId": 0 < --- assign a Redis keyvalues by each coins. like that bitcoin use a 0 and other use a 1 . etc. }, "mysql": { "host": "127.0.0.1", "port": 3306, "user": "username", "password": "password", "database": "db-name" } }, "mpos": { "enabled": false, "mysql": { "host": "127.0.0.1", "port": 3306, "user": "username", "password": "password", "database": "db-name" } } }, "vanilla": { "enabled": false, "bind": "localhost", "port": 2223 } }

regtable commented 6 years ago

I will try that.

On 1 Feb 2018 14:11, "jeong760" notifications@github.com wrote:

@regtable https://github.com/regtable, I am not sure this is solved by following but mine has been gone above issue.

  • Create a each coins config file separtly like following The sample of bitcoin.json

{ "enabled":true, "coin": "bitcoin.json", "daemon": { "host": "127.0.0.1", "port": 8332, "username": "RPC username", "password": "Password of RPC user" }, "meta": { "motd": "Welcome to CoiniumServ pool, enjoy your stay! - http://www.coiniumserv.com", "txMessage": "http://www.coiniumserv.com/" },

"wallet" : { "address": "1MMdwRZg4K9p6oH2bWUQdohbxGbAvXS1t1" }, "rewards": [ {"1MMdwRZg4K9p6oH2bWUQdohbxGbAvXS1t1": 1} ], "banning": { "enabled": true, "duration": 600, "invalidPercent": 50, "checkThreshold": 100, "purgeInterval": 300 }, "payments": { "enabled": true, "interval": 60, "minimum": 0.01 }, "miner": { "validateUsername": true, "timeout": 300 }, "job": { "blockRefreshInterval": 1000, "rebroadcastTimeout": 55 }, "stratum": { "enabled": true, "bind": "0.0.0.0", "port": 3333, "diff": 16, "vardiff": { "enabled": true, "minDiff": 8, "maxDiff": 512, "targetTime": 15, "retargetTime": 90, "variancePercent": 30 } }, "storage": { "hybrid": { "enabled": false, "redis": { "host": "127.0.0.1", "port": 6379, "password": "", "databaseId": 0 }, "mysql": { "host": "127.0.0.1", "port": 3306, "user": "username", "password": "password", "database": "db-name" } }, "mpos": { "enabled": false, "mysql": { "host": "127.0.0.1", "port": 3306, "user": "username", "password": "password", "database": "db-name" } } }, "vanilla": { "enabled": false, "bind": "localhost", "port": 2223 }

}

  • Change default.json as following and save. default.json { }

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bonesoul/CoiniumServ/issues/933#issuecomment-362276942, or mute the thread https://github.com/notifications/unsubscribe-auth/AHQVF04oc_subaSQ_HyPIsmNATAKvvaSks5tQcYigaJpZM4Ru_Wm .

regtable commented 6 years ago

it did not help me :-/

dracolumina commented 6 years ago

Getting this error as well and for the life of me I can't get it to work. using 15.1 core.

02/04/2018 13:27:16 -08:00 [Information] [PlatformManager] [global] Running over .Net, framework: 4.5 (v4.0.30319.42000). 02/04/2018 13:27:16 -08:00 [Debug] [Pool] [Bitcoin] Generated cryptographically random instance Id: 1471353524 02/04/2018 13:27:16 -08:00 [Information] [MySqlProvider] [Bitcoin] Mysql storage initialized: 127.0.0.1:3306, database: bitcoin. 02/04/2018 13:27:16 -08:00 [Information] [RedisProvider] [Bitcoin] Redis storage initialized: 127.0.0.1:6379. 02/04/2018 13:27:17 -08:00 [Error] [ShareManager] [Bitcoin] Error getting account for pool central wallet address: 19FSzo3vXnEkapELUwr86u1ySedr39bzWr - Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Information] [BanManager] [Bitcoin] No expired bans found to be cleared [remaining bans: 0]. 02/04/2018 13:27:17 -08:00 [Error] [JobManager] [Bitcoin] New job creation failed: Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Error] [JobManager] [Bitcoin] New job creation failed: Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Error] [JobManager] [Bitcoin] New job creation failed: Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Error] [BlockProcessor] [Bitcoin] Error getting account for pool central wallet address: 19FSzo3vXnEkapELUwr86u1ySedr39bzWr - Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Error] [PaymentProcessor] [Bitcoin] Halted as we can not connect to configured coin daemon: Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getdifficulty(): Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not probe submitblock() support: Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getinfo(): Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getmininginfo(): Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getblocktemplate(): Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Information] [NetworkInfo] [Bitcoin] symbol: BTC algorithm: sha256 version: null protocol: 0 wallet: 0 network difficulty: 0.00000000 block difficulty: 0.00 network hashrate: 0.00 KH/s network: mainnet peers: 0 blocks: -2 errors: none 02/04/2018 13:27:17 -08:00 [Information] [StratumServer] [Bitcoin] Stratum server listening on 0.0.0.0:0 02/04/2018 13:27:17 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getinfo(): Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getmininginfo(): Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getblocktemplate(): Unable to connect to the remote server 02/04/2018 13:27:17 -08:00 [Debug] [StatisticsManager] [global] Recached statistics - took 0.269 seconds 02/04/2018 13:27:18 -08:00 [Information] [WebServer] [global] Web-server listening on: http://localhost/ 02/04/2018 13:32:14 -08:00 [Information] [PlatformManager] [global] Running over .Net, framework: 4.5 (v4.0.30319.42000). 02/04/2018 13:32:15 -08:00 [Debug] [Pool] [Bitcoin] Generated cryptographically random instance Id: 1892005947 02/04/2018 13:32:15 -08:00 [Information] [MySqlProvider] [Bitcoin] Mysql storage initialized: 127.0.0.1:3306, database: bitcoin. 02/04/2018 13:32:15 -08:00 [Information] [RedisProvider] [Bitcoin] Redis storage initialized: 127.0.0.1:6379. 02/04/2018 13:32:15 -08:00 [Error] [ShareManager] [Bitcoin] Error getting account for pool central wallet address: 1HrB54m9GNajTy4Hz5HKHF2pgFfV2mhjYs - Unable to connect to the remote server 02/04/2018 13:32:15 -08:00 [Information] [BanManager] [Bitcoin] No expired bans found to be cleared [remaining bans: 0]. 02/04/2018 13:32:15 -08:00 [Error] [JobManager] [Bitcoin] New job creation failed: Unable to connect to the remote server 02/04/2018 13:32:15 -08:00 [Error] [JobManager] [Bitcoin] New job creation failed: Unable to connect to the remote server 02/04/2018 13:32:15 -08:00 [Error] [JobManager] [Bitcoin] New job creation failed: Unable to connect to the remote server 02/04/2018 13:32:15 -08:00 [Error] [BlockProcessor] [Bitcoin] Error getting account for pool central wallet address: 1HrB54m9GNajTy4Hz5HKHF2pgFfV2mhjYs - Unable to connect to the remote server 02/04/2018 13:32:15 -08:00 [Error] [PaymentProcessor] [Bitcoin] Halted as we can not connect to configured coin daemon: Unable to connect to the remote server 02/04/2018 13:32:15 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getdifficulty(): Unable to connect to the remote server 02/04/2018 13:32:15 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not probe submitblock() support: Unable to connect to the remote server 02/04/2018 13:32:15 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getinfo(): Unable to connect to the remote server 02/04/2018 13:32:15 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getmininginfo(): Unable to connect to the remote server 02/04/2018 13:32:15 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getblocktemplate(): Unable to connect to the remote server 02/04/2018 13:32:15 -08:00 [Information] [NetworkInfo] [Bitcoin] symbol: BTC algorithm: sha256 version: null protocol: 0 wallet: 0 network difficulty: 0.00000000 block difficulty: 0.00 network hashrate: 0.00 KH/s network: mainnet peers: 0 blocks: -2 errors: none 02/04/2018 13:32:15 -08:00 [Information] [StratumServer] [Bitcoin] Stratum server listening on 0.0.0.0:0 02/04/2018 13:32:15 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getinfo(): Unable to connect to the remote server 02/04/2018 13:32:15 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getmininginfo(): Unable to connect to the remote server 02/04/2018 13:32:15 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getblocktemplate(): Unable to connect to the remote server 02/04/2018 13:32:16 -08:00 [Debug] [StatisticsManager] [global] Recached statistics - took 0.267 seconds 02/04/2018 13:32:16 -08:00 [Information] [WebServer] [global] Web-server listening on: http://localhost/ 02/04/2018 13:34:57 -08:00 [Information] [PlatformManager] [global] Running over .Net, framework: 4.5 (v4.0.30319.42000). 02/04/2018 13:34:58 -08:00 [Debug] [Pool] [Bitcoin] Generated cryptographically random instance Id: 3724846033 02/04/2018 13:34:58 -08:00 [Information] [MySqlProvider] [Bitcoin] Mysql storage initialized: 127.0.0.1:3306, database: bitcoin. 02/04/2018 13:34:58 -08:00 [Information] [RedisProvider] [Bitcoin] Redis storage initialized: 127.0.0.1:6379. 02/04/2018 13:34:58 -08:00 [Error] [ShareManager] [Bitcoin] Error getting account for pool central wallet address: 1HrB54m9GNajTy4Hz5HKHF2pgFfV2mhjYs - Unable to connect to the remote server 02/04/2018 13:34:58 -08:00 [Information] [BanManager] [Bitcoin] No expired bans found to be cleared [remaining bans: 0]. 02/04/2018 13:34:58 -08:00 [Error] [JobManager] [Bitcoin] New job creation failed: Unable to connect to the remote server 02/04/2018 13:34:58 -08:00 [Error] [JobManager] [Bitcoin] New job creation failed: Unable to connect to the remote server 02/04/2018 13:34:58 -08:00 [Error] [JobManager] [Bitcoin] New job creation failed: Unable to connect to the remote server 02/04/2018 13:34:58 -08:00 [Error] [BlockProcessor] [Bitcoin] Error getting account for pool central wallet address: 1HrB54m9GNajTy4Hz5HKHF2pgFfV2mhjYs - Unable to connect to the remote server 02/04/2018 13:34:58 -08:00 [Error] [PaymentProcessor] [Bitcoin] Halted as we can not connect to configured coin daemon: Unable to connect to the remote server 02/04/2018 13:34:58 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getdifficulty(): Unable to connect to the remote server 02/04/2018 13:34:58 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not probe submitblock() support: Unable to connect to the remote server 02/04/2018 13:34:58 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getinfo(): Unable to connect to the remote server 02/04/2018 13:34:58 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getmininginfo(): Unable to connect to the remote server 02/04/2018 13:34:58 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getblocktemplate(): Unable to connect to the remote server 02/04/2018 13:34:58 -08:00 [Information] [NetworkInfo] [Bitcoin] symbol: BTC algorithm: sha256 version: null protocol: 0 wallet: 0 network difficulty: 0.00000000 block difficulty: 0.00 network hashrate: 0.00 KH/s network: mainnet peers: 0 blocks: -2 errors: none 02/04/2018 13:34:58 -08:00 [Information] [StratumServer] [Bitcoin] Stratum server listening on 0.0.0.0:9995 02/04/2018 13:34:59 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getinfo(): Unable to connect to the remote server 02/04/2018 13:34:59 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getmininginfo(): Unable to connect to the remote server 02/04/2018 13:34:59 -08:00 [Error] [NetworkInfo] [Bitcoin] Can not read getblocktemplate(): Unable to connect to the remote server 02/04/2018 13:34:59 -08:00 [Debug] [StatisticsManager] [global] Recached statistics - took 0.267 seconds 02/04/2018 13:34:59 -08:00 [Information] [WebServer] [global] Web-server listening on: http://localhost/ `

jeong760 commented 6 years ago

You know when I removed a bitcoin client and installation again it works few times but after that it generate a above error. also bitcoin 15.1 does not support a getinfo() anymore it depreciated RPC command but still works with warning message.

I think this problem of "Serilog", Newtonsoft.Json,Nancy does not have enough buffer for bitcoin difficult conversion. so this should be changed a some code.

The warning message when issued a getinfo() "deprecation-warning": "WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16",

dracolumina commented 6 years ago

I tried rolling the core back to 15.0 but still got errors

dracolumina commented 6 years ago

of course it works perfectly for litecoin. altho I have yet to test the pool as I don't have a scrypt miner lol

mbruton commented 6 years ago

I think the issue occurs on line 75 in src/CoiniumServ/Daemon/Responses/MiningInfo.cs, the value being returned by the network is bigger than a UInt64 allows.

I'm not really a C# developer so am not sure how to fix it. I've tried using double but this causes other issues, also tried BigInteger but it fails to compile on linux and I am unsure of how to include System.Numerics in the build.

dracolumina commented 6 years ago

I have worked with c# will take a look at it, and yeah replacing just that with double don't fix it.

jeong760 commented 6 years ago

@mbruton I've changed following all value ulong but not solved the problem. because using System; is a UInt64. but I don't know where I can change to solve this...

src/CoininumServ/Daemon/Responses/miningInfo.cs [JsonProperty] private UInt64 NetworkHashps { get; set; }

    [JsonIgnore]
    public UInt64 NetworkHashPerSec { get; set; }

    [OnDeserialized]
    internal void OnDeserializedMethod(StreamingContext context)
    {
        NetworkHashPerSec = 0;

        if (NetMHashps > 0)
            NetworkHashPerSec = (UInt64)(NetMHashps*1000*1000);
        else if (NetworkGhps > 0)
            NetworkHashPerSec = (UInt64)(NetworkGhps * 1000 * 1000 * 1000);
        else if (NetworkMhps > 0)
            NetworkHashPerSec = (UInt64)(NetworkMhps * 1000 * 1000);
        else if (NetworkHashps > 0)
            NetworkHashPerSec = NetworkHashps;
    }

src/CoininumServ/Pools/INetworkInfo.cs -46: public ulong Hashrate { get; private set; }

src/CoininumServ/Pools/NetowkrInfo.cs

regtable commented 6 years ago

Wouldn't it just work by removing the 100010001000 maths and having it change a value from khs to mhs ghs or phs ?

mbruton commented 6 years ago

@jeong760 I believe ulong is also 64 bit and so not big enough.

@regtable the value is being returned by the Bitcoin API and so is too big to fit into the variable and so it fails before the calculations are even performed, the value should be stored in NetworkHashps which comes from the API call getMiningInfo.

jeong760 commented 6 years ago

@mbruton, Yes, ulong does not help to solve.
Just I assumed that Newtonsoft.Json also a problem to calculate a NetworkHashps value to UInt64 so it seems not the only CoiniumServ problem.

jeong760 commented 6 years ago

@mbruton, Do you know the biggest value to replace a UInt64 in C#? I am not a programmer so don't know which value should I use.

@bonesoul, Could you give us a clue to solve this? Because it seems able to solve but first I need to understand the structure... also your new hypepool project still does not support a sha256 and testing phase so... until then we need to use a CoiniumServ.

dracolumina commented 6 years ago

I tried, but then it started throwing up cast errors on the build. sometime this week I should be able to dig into it.

On Wed, Feb 14, 2018 at 3:58 PM, jeong760 notifications@github.com wrote:

@mbruton https://github.com/mbruton, Do you know the biggest value to replace a UInt64 in C#? I am not a programmer so don't know which value should I use.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bonesoul/CoiniumServ/issues/933#issuecomment-365785192, or mute the thread https://github.com/notifications/unsubscribe-auth/AG4-p0UFVpLEW025Xv6fL-IcfaYSgLEMks5tU3M3gaJpZM4Ru_Wm .

jeong760 commented 6 years ago

Dears,

VC2017 debugging phase point to the following /src/pool/DaemonBase.cs (175 ~ 189 lines) So I think this seems related to JsonResponse problem also, which does not convert a value to UInt64.

private DaemonResponse GetRpcResponse(HttpWebRequest httpWebRequest) { string json = GetJsonResponse(httpWebRequest);

        _logger.Verbose("rx: {0}", json.PrettifyJson());

        try
        {
            return JsonConvert.DeserializeObject<DaemonResponse<T>>(json);
        }
        catch (JsonException jsonEx)
        {
            httpWebRequest = null;
            throw new Exception("There was a problem deserializing the response from the coin wallet.", jsonEx);
        }

Regards, John Ahn

bonesoul commented 6 years ago

yes bitcoin has changed it's rpc response signature, i'll take a look.

jeong760 commented 6 years ago

@bonesoul, Thank you. so that's why it still generate an error even if I changed a following on src/Daemon/Response/DaemonResponse.cs.

Before [JsonProperty] private UInt64 NetworkHashps { get; set; }

After [JsonProperty] private ulong NetworkHashps { get; set; }

Regards, John Ahn

jeong760 commented 6 years ago

@bonesoul, here is getmininginfo code of bitcoin(16.01). which under sr/rpc/mining.cpp. I hope you will find a clue to fix this issue with bitcoin. and getinfo rpc command also needs to replace with etblockchaininfo, getnetworkinfo, and getwalletinfo before they'll release a 16.01 bitcoin core.

UniValue getmininginfo(const JSONRPCRequest& request) { if (request.fHelp || request.params.size() != 0) throw std::runtime_error( "getmininginfo\n" "\nReturns a json object containing mining-related information." "\nResult:\n" "{\n" " \"blocks\": nnn, (numeric) The current block\n" " \"currentblockweight\": nnn, (numeric) The last block weight\n" " \"currentblocktx\": nnn, (numeric) The last block transaction\n" " \"difficulty\": xxx.xxxxx (numeric) The current difficulty\n" " \"networkhashps\": nnn, (numeric) The network hashes per second\n" " \"pooledtx\": n (numeric) The size of the mempool\n" " \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n" " \"warnings\": \"...\" (string) any network and blockchain warnings\n" "}\n" "\nExamples:\n"

Regards, John Ahn

regtable commented 6 years ago

Cool.

On 14 Feb 2018 18:56, "Matt Bruton" notifications@github.com wrote:

@jeong760 https://github.com/jeong760 I believe ulong is also 64 bit and so not big enough.

@regtable https://github.com/regtable the value is being returned by the Bitcoin API and so is too big to fit into the variable and so it fails before the calculations are even performed, the value should be stored in NetworkHashps which comes from the API call getMiningInfo.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bonesoul/CoiniumServ/issues/933#issuecomment-365708566, or mute the thread https://github.com/notifications/unsubscribe-auth/AHQVF1ZpYU0DKsAZ1UQBE899j_Biq3Qbks5tUyxWgaJpZM4Ru_Wm .

jeong760 commented 6 years ago

Dears,

I've inquired about above issue on bitcoin git hub they told this answer. it means that we will need to change an integer to double or a more lager one in order to represent this values

-- Replied on bitcoin git -- You can't represent this value as a uint64 anymore, you'll need to use a double or a larger integer type.

This has nothing to do with a change in Bitcoin Core, but with the fact that the network's hash rate is now too large for your software to deal with.

Regards, John Ahn

jeong760 commented 6 years ago

@bonesoul,

Do we need to change a pool.cs on following but after I change it generate an error. so how I fixed it? How I use a double integer instead ulong or Uint64?

When after I changed an integer as ulong to double on both (Networkinfo.cs and INetworkInfo.cs) The following error message displayed

Error CS1929 'double' does not contain a definition for 'GetReadableHashrate' and the best extension method overload 'Humanize.GetReadableHashrate(ulong)' requires a receiver of type 'ulong' CoiniumServ D:\git\CoiniumServ\src\CoiniumServ\Pools\NetworkInfo.cs 153 Active

src/pools/INetworkinfo.cs (code line 87-160) [JsonProperty("hashrate")] UInt64 Hashrate { get; } ---> double Hashrate { get; }

src/pools/networkinfo.cs (code line 46) public ulong Hashrate { get; private set; } ---> public double Hashrate { get; private set; }

src/pools/networkinfo.cs (code line 110 till to 126) public void Recache() { try // read getinfo() based data. { var info = _daemonClient.GetInfo();

            // read data.
            CoinVersion = info.Version;
            ProtocolVersion = info.ProtocolVersion;
            WalletVersion = info.WalletVersion;
            Testnet = info.Testnet;
            Connections = info.Connections;
            Errors = info.Errors;

            // check if our network connection is healthy.
            Healthy = Connections >= 0 && string.IsNullOrEmpty(Errors);
        }
        catch (RpcException e)
        {
            _logger.Error("Can not read getinfo(): {0:l}", e.Message);
            Healthy = false; // set healthy status to false as we couldn't get a reply.
        }

        try // read getmininginfo() based data.
        {
            var miningInfo = _daemonClient.GetMiningInfo();

            // read data.
            Hashrate = miningInfo.NetworkHashPerSec;
            Difficulty = miningInfo.Difficulty;
            Round = miningInfo.Blocks + 1;
        }
        catch (RpcException e)
        {
            _logger.Error("Can not read getmininginfo(): {0:l}", e.Message);
            Hashrate = 0;
            Difficulty = 0;
            Round = -1;
            Healthy = false; // set healthy status to false as we couldn't get a reply.
        }

        try // read getblocktemplate() based data.
        {
            var blockTemplate = _daemonClient.GetBlockTemplate(_poolConfig.Coin.Options.BlockTemplateModeRequired);
            Reward = (UInt64)blockTemplate.Coinbasevalue / 100000000; // coinbasevalue is in satoshis, convert it to actual coins.
        }
        catch (RpcException e)
        {
            _logger.Error("Can not read getblocktemplate(): {0:l}", e.Message);
            Reward = 0;
        }
    }

    private void PrintNetworkInfo()
    {
        _logger.Information("symbol: {0:l} algorithm: {1:l} " +
                            "version: {2:l} protocol: {3} wallet: {4} " +
                            "network difficulty: {5:0.00000000} block difficulty: {6:0.00} network hashrate: {7:l} " +
                            "network: {8:l} peers: {9} blocks: {10} errors: {11:l} ",
            _poolConfig.Coin.Symbol,
            _poolConfig.Coin.Algorithm,
            CoinVersion,
            ProtocolVersion,
            WalletVersion,
            Difficulty,
            Difficulty*_hashAlgorithm.Multiplier,
            **Hashrate.GetReadableHashrate(),** <--- this requires a **ulong** integer
            Testnet ? "testnet" : "mainnet",
            Connections,
            Round - 1,
            string.IsNullOrEmpty(Errors) ? "none" : Errors);
    }

Regards, John Ahn

jeong760 commented 6 years ago

@bonesoul is there anything should I change?

jeong760 commented 6 years ago

@bonesoul and Others, I think I've solved(Refers to pictures) a Network Hash rate issue on CoinuimServ after made several tests by my self. I've lost and don't know why but found that public static string GetReadableHashrate(this double hashrate) on Humanize.cs to give a Hashrate.GetReadableHashrate() on NetowrkInfo.cs. so I've additionally changed it, And then it works well with Bitcoin.

src/Algorithms/HashAlgorithmStatistics.cs 47: public double Hashrate { get; private set);

src/Algorithms/IHashAlgorithmStatistics.cs 51: double Hashrate { get; }

src/Daemon/Responses/MiningInfo.cs 54: public double HashesPerSec { get; set; } 75: private double NetworkHashps { get; set; } 78: public double NetworkHashPerSec { get; set; }

src/Pools/NetworkInfo.cs 46: public double Hashrate { get; private set; }

src/Pools/INetworkInfo.cs 55: double Hashrate { get; }

src/Pools/Pools.cs 66: public double Hashrate { get; private set; }

src/Pools/IPools.cs 51: double Hashrate { get; }

src/Statistics/StatisticsManager.cs 42: public double Hashrate { get; private set; }

src/Statistics/IStatisticsManager.cs 43: double Hashrate { get; }

src/Utils/Humanize.cs 43: public static string GetReadableHashrate(this UInt64 hashrate) ---> public static string GetReadableHashrate(this double hashrate)

And finally please removed following code on web. it seems not implemented on CoiniumServ srv/web/default/views/partial/pools.cshtml 22: Profitability

Bitcoin network hash rate on CoiniumServ console coiniumserv_console

Pool hash rate correctly displayed on web. capture

Regards, John Ahn

jeong760 commented 6 years ago

@bonesoul, I will open a new PR for this issue after making a week test in my pool. So if you think this no need to open a PR then please apply it to yourself as soon as possible, please.

jeong760 commented 6 years ago

@bonesoul, PR opened #953

jeong760 commented 6 years ago

@bonesoul , Could you add a Globaltoken(GLT) and its icon? I think it omitted. so need to manual add please

Globaltoken(GLT).zip

jeong760 commented 6 years ago

@felixonmars @regtable @dracolumina @mbruton , Does anyone confirmation that above change not affect alt-coins work?

Maleksh commented 6 years ago

Does any one knows how to solve the time out issue below: How we can alter the IOCP Min from 8 to 300 Error Below: 01:57:02 [Error] [HybridStorage] [Bitcoin] An exception occured while comitting share: Timeout performing ZADD bitcoin:hashrate, inst: 3, queue: 0, qu: 0, qs: 0, qc: 0, wr: 0, wq: 0, in: 0, ar: 0, clientName: DESKTOP-BASKBI5, serverEndpoint: 127.0.0.1:6379, keyHashSlot: 12176, IOCP: (Busy=1,Free=999,Min=8,Max=1000), WORKER: (Busy=327,Free=1720,Min=8,Max=2047) (Please take a look at this article for some common client-side issues that can cause timeouts: http://stackexchange.github.io/StackExchange.Redis/Timeouts)

jeong760 commented 6 years ago

@Maleksh, please increased a memory on your system. Redis is in memory key value storage so it needed at least 1GB for it. I’ve recommanded you increase a yout system memory morethan 2GB.

Maleksh commented 6 years ago

@jeong760 , I have 32GB installed on the Workstation, with 1 TB M550 Crucial SSD, including 1 GB Cache memory. no luck, memory usage not more than 4 GB.

BenKnigge commented 6 years ago

I ran into this same issue today. Is there anything I can do to help expedite a solution?

Maleksh commented 6 years ago

I was able to Increase the Dot Net Framwork Threads by following the below instruction: However, i am getting a new error at the End: Open C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config And C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config Edit the below: From processModel autoConfig="true" To processModel minIoThreads="50" Note, 50* 4 No. Of CPU Cores=200 Min Threads Allowed as per the above settings

New Error Below: Anyone have any idea what to do 11:42:41 [Error] [StratumServer] [BitcoinDB] Send System.Net.Sockets.SocketException (0x80004005): A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at CoiniumServ.Server.Mining.Stratum.Sockets.SocketServer.Send(Connection connection, Byte[] buffer, Int32 start, Int32 count, SocketFlags flags)

jeong760 commented 6 years ago

@BenKnigge Which kind of issue do you mean? bitcoin network hash rate issue or other like related Redis

dracolumina commented 6 years ago

@jeong760 I have tried your changes, but when I go to compile I get the error Severity Code Description Project File Line Suppression State Error CS0738 'NetworkInfo' does not implement interface member 'INetworkInfo.Hashrate'. 'NetworkInfo.Hashrate' cannot implement 'INetworkInfo.Hashrate' because it does not have the matching return type of 'ulong'. CoiniumServ C:\Users\Draco\Downloads\CoiniumServ-master\CoiniumServ-master\src\CoiniumServ\Pools\NetworkInfo.cs 40 Active

BenKnigge commented 6 years ago

@jeong760 The same issue as in the stack trace. I ended up downgrading the full node to version 15 and it resolved the issue.