Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0HN97JT339OQK] Connection error: System.NullReferenceException: Object reference not set to an instance of an object. #89

Open
PortusCoin opened this issue Dec 29, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@PortusCoin
Copy link

[Description]
When running a litecoin pool, using a mining software like cgminer or cpuminer after sucess mining when the miner submit the information error happens:

[2024-12-29 00:30:58.6091] [D] [] [0HN97JT339OQK] [PIPE] Received data: {"params": ["Lexn89hBUJzWkEdpjQaxBVnQeThX3PLeJF", "00000026", "11000000", "67709841", "d5160600"], "id": 8, "method": "mining.submit"}

[2024-12-29 00:30:58.6091] [D] [] [0HN97JT339OQK] Dispatching request 'mining.submit' [8]
[2024-12-29 00:30:58.6091] [E] [] [0HN97JT339OQK] Connection error: System.NullReferenceException: Object reference not set to an instance of an object.
at Miningcore.Extensions.StringExtensions.HexToByteArray(String str) in /home/pool/miningcore/src/Miningcore/Extensions/StringExtensions.cs:line 16
at Miningcore.Blockchain.Bitcoin.BitcoinJob.SerializeBlock(Byte[] header, Byte[] coinbase) in /home/pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinJob.cs:line 424
at Miningcore.Blockchain.Bitcoin.BitcoinJob.ProcessShareInternal(StratumConnection worker, String extraNonce2, UInt32 nTime, UInt32 nonce, Nullable1 versionBits) in /home/pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinJob.cs:line 375 at Miningcore.Blockchain.Bitcoin.BitcoinJob.ProcessShare(StratumConnection worker, String extraNonce2, String nTime, String nonce, String versionBits) in /home/pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinJob.cs:line 762 at Miningcore.Blockchain.Bitcoin.BitcoinJobManager.SubmitShareAsync(StratumConnection worker, Object submission, CancellationToken ct) in /home/pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinJobManager.cs:line 286 at Miningcore.Blockchain.Bitcoin.BitcoinPool.OnSubmitAsync(StratumConnection connection, Timestamped1 tsRequest, CancellationToken ct) in /home/pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinPool.cs:line 184
at Miningcore.Blockchain.Bitcoin.BitcoinPool.OnRequestAsync(StratumConnection connection, Timestamped1 tsRequest, CancellationToken ct) in /home/pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinPool.cs:line 423 at Miningcore.Stratum.StratumServer.OnRequestAsync(StratumConnection connection, JsonRpcRequest request, CancellationToken ct) in /home/pool/miningcore/src/Miningcore/Stratum/StratumServer.cs:line 200 at Miningcore.Stratum.StratumConnection.ProcessRequestAsync(CancellationToken ct, Func4 onRequestAsync, ReadOnlySequence1 lineBuffer) in /home/pool/miningcore/src/Miningcore/Stratum/StratumConnection.cs:line 384 at Miningcore.Stratum.StratumConnection.ProcessRequestAsync(CancellationToken ct, Func4 onRequestAsync, ReadOnlySequence1 lineBuffer) in /home/pool/miningcore/src/Miningcore/Stratum/StratumConnection.cs:line 384 at Miningcore.Stratum.StratumConnection.ProcessReceivePipeAsync(CancellationToken ct, TcpProxyProtocolConfig proxyProtocol, Func4 onRequestAsync) in /home/pool/miningcore/src/Miningcore/Stratum/StratumConnection.cs:line 287
[2024-12-29 00:30:58.6091] [I] [] [0HN97JT339OQK] Connection closed
[2024-12-29 00:30:58.7073] [I] [] [0HN97JT339OQL] Accepting connection from ::ffff:85.242.25.241:59508 ...

@PortusCoin PortusCoin added the bug Something isn't working label Dec 29, 2024
@PortusCoin
Copy link
Author

This is the configuration file for the pool, I don't see any mistakes:

{
"logging": {
"level": "debug",
"enableConsoleLog": true,
"enableConsoleColors": true,
"logFile": "",
"apiLogFile": "",
"logBaseDirectory": "",
"perPoolLogFile": false
},
"banning": {
"manager": "Integrated",
"banOnJunkReceive": false,
"banOnInvalidShares": false,
"banOnLoginFailure": false
},
"notifications": {
"enabled": false,
"email": {
"host": "smtp.example.com",
"port": 587,
"user": "user",
"password": "password",
"fromAddress": "info@yourpool.org",
"fromName": "support"
},
"admin": {
"enabled": true,
"emailAddress": "info@yourpool.org",
"notifyBlockFound": true
}
},
"persistence": {
"postgres": {
"host": "127.0.0.1",
"port": 5432,
"user": "miningcore",
"password": "miningcore",
"database": "miningcore"
}
},
"paymentProcessing": {
"enabled": true,
"interval": 3600
},
"shareRecoveryFile": "recovered-shares.txt",
"api": {
"enabled": true,
"listenAddress": "0.0.0.0",
"port": 5000,
"metricsIpWhitelist": [
"127.0.0.1"
],
"adminIpWhitelist": [
"127.0.0.1"
],
"rateLimiting": {
"disabled": true,
"rules": [
{
"Endpoint": "*",
"Period": "1s",
"Limit": 5000
}
],
"ipWhitelist": [
"127.0.0.1"
]
}
},
"pools": [
{
"id": "portus01",
"enabled": true,
"coin": "litecoin",

		"address": "Lexn89hBUJzWkEdpjQaxBVnQeThX3PLeJF",
		"rewardRecipients": [
			{
				"address": "Lexn89hBUJzWkEdpjQaxBVnQeThX3PLeJF",
				"percentage": 1.0
			}
		],
		"blockRefreshInterval": 500,
		"jobRebroadcastTimeout": 10,
		"clientConnectionTimeout": 600,
		"banning": {
			"enabled": false,
			"time": 600,
			"invalidPercent": 50,
			"checkThreshold": 50
		},
		"ports": {
			"3042": {
				"listenAddress": "*",
				"difficulty": 1024,
				"name": "ASIC Mining",
				"varDiff": {
					"minDiff": 512,
					"maxDiff": 10000,
					"targetTime": 15,
					"retargetTime": 90,
					"variancePercent": 30
				}
			}
		},
		"daemons": [
			{
				"host": "127.0.0.1",
				"port": 11332,
				"user": "RPCUSER",
				"password": "RPCPASSWPRD"
			}
		],
		"paymentProcessing": {
			"enabled": true,
			"minimumPayment": 0.5,
			"payoutScheme": "PPLNS",
			"payoutSchemeConfig": {
				"factor": 2.0
			}
		}
	}
]

}

@PortusCoin
Copy link
Author

I think the problem is with the mining submit:

[2024-12-29 19:41:28.0710] [D] [portus01] [0HN97JT339OQM] [PIPE] Received data: {"method": "mining.submit", "params": ["Lexn89hBUJzWkEdpjQaxBVnQeThX3PLeJF", "00001d51", "00000000", "6771a5d1", "f9ac0640"], "id":4}

[2024-12-29 19:41:28.0710] [D] [portus01] [0HN97JT339OQM] Dispatching request 'mining.submit' [4]
[2024-12-29 19:41:28.0748] [E] [portus01] [0HN97JT339OQM] Connection error: System.NullReferenceException: Object reference not set to an instance of an object.
at Miningcore.Extensions.StringExtensions.HexToByteArray(String str) in /home/pool/miningcore/src/Miningcore/Extensions/StringExtensions.cs:line 16
at Miningcore.Blockchain.Bitcoin.BitcoinJob.SerializeBlock(Byte[] header, Byte[] coinbase) in /home/pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinJob.cs:line 424
at Miningcore.Blockchain.Bitcoin.BitcoinJob.ProcessShareInternal(StratumConnection worker, String extraNonce2, UInt32 nTime, UInt32 nonce, Nullable1 versionBits) in /home/pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinJob.cs:line 375 at Miningcore.Blockchain.Bitcoin.BitcoinJob.ProcessShare(StratumConnection worker, String extraNonce2, String nTime, String nonce, String versionBits) in /home/pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinJob.cs:line 762 at Miningcore.Blockchain.Bitcoin.BitcoinJobManager.SubmitShareAsync(StratumConnection worker, Object submission, CancellationToken ct) in /home/pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinJobManager.cs:line 286 at Miningcore.Blockchain.Bitcoin.BitcoinPool.OnSubmitAsync(StratumConnection connection, Timestamped1 tsRequest, CancellationToken ct) in /home/pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinPool.cs:line 184
at Miningcore.Blockchain.Bitcoin.BitcoinPool.OnRequestAsync(StratumConnection connection, Timestamped1 tsRequest, CancellationToken ct) in /home/pool/miningcore/src/Miningcore/Blockchain/Bitcoin/BitcoinPool.cs:line 423 at Miningcore.Stratum.StratumServer.OnRequestAsync(StratumConnection connection, JsonRpcRequest request, CancellationToken ct) in /home/pool/miningcore/src/Miningcore/Stratum/StratumServer.cs:line 200 at Miningcore.Stratum.StratumConnection.ProcessRequestAsync(CancellationToken ct, Func4 onRequestAsync, ReadOnlySequence1 lineBuffer) in /home/pool/miningcore/src/Miningcore/Stratum/StratumConnection.cs:line 384 at Miningcore.Stratum.StratumConnection.ProcessRequestAsync(CancellationToken ct, Func4 onRequestAsync, ReadOnlySequence1 lineBuffer) in /home/pool/miningcore/src/Miningcore/Stratum/StratumConnection.cs:line 384 at Miningcore.Stratum.StratumConnection.ProcessReceivePipeAsync(CancellationToken ct, TcpProxyProtocolConfig proxyProtocol, Func4 onRequestAsync) in /home/pool/miningcore/src/Miningcore/Stratum/StratumConnection.cs:line 287
[2024-12-29 19:41:28.0748] [I] [portus01] [0HN97JT339OQM] Connection closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant