GetBlok-io / miningcore

Miningcore is a high-performance Mining Pool Software for Linux and Windows maintained by GetBlok.io
https://www.getblok.io
MIT License
2 stars 1 forks source link

ERGO Stratum: Block 615914 submission failed with: Invalid block mined: requirement failed: h(f) < b condition not met #2

Closed vinnielima closed 2 years ago

vinnielima commented 2 years ago

Describe the bug We have experienced this error three times now, from different stratum and different node combinations.

On Miningcore stratum:

[2021-11-09 19:59:19.9642] [I] [ergo1] Submitting block 615914 []
[2021-11-09 19:59:20.4041] [W] [ergo1] Block 615914 submission failed with: Invalid block mined: requirement failed: h(f) < b condition not met

On the Ergo node:

06:59:20.308 INFO  [ctor.default-dispatcher-7] s.c.n.PeerConnectionHandler - Received message MessageSpec(55: Inv) from ConnectionId(remote=/93.123.180.164:9030, local=/10.1.2.4:43966, direction=Outgoing)
06:59:20.365 INFO  [tor.default-dispatcher-14] o.e.m.CandidateGenerator - New block mined, header: Header({"extensionId":"f24752386c96881c6177dd21eb6334041fcb9817ecf0d8004887165bf53d8beb","difficulty":"2076938810163200","votes":"000000","timestamp":1636459156974,"size":220,"stateRoot":"e3eb8495652d771314767d130855933b7e1b31107012399eacc35fcc86d0422617","height":615929,"nBits":117924087,"version":2,"id":"82484bb06abe5eb8edba97f887be953e20a2f35ac192cab294f060afcb73bcb9","adProofsRoot":"fd66557beeac91a49d7ee8aae253bd6946e1542223e23986c352f6d097ce903d","transactionsRoot":"89bfe51466e5172383c39a2fd913cea30794a94d9686d38abe0a8bc07398032b","extensionHash":"eb715ad70c258b497aaa007c920b20b22fd766a4681e3162fc04ef44cd63af29","powSolutions":{"pk":"0302122c332fd4e3c901f045ac18f559dcecf8dc61f6f94fbb34d0c7c3aac71fb7","w":"0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","n":"a0b3655c998b6444","d":0},"adProofsId":"e8d0b10e86af6e9b8218d9b2fb8a4e79cdd5dede70d3a02f7405f1f2f6135324","transactionsId":"787727cb8dfda03a2467b31e13b86eba1e7a89b7cc33f1c384f68c1f6ba42db2","parentId":"d92695d75e26644c4dee1f3fe7eb98dc56799b850223f1107f470545660845bc"})

To Reproduce Not sure how to reproduce this.

Expected behavior

Screenshots See above

OS This is on Ubuntu 20.04

Additional context Multiple stratum and nodes deployed, persisting to same Postgresql back end. Stratum nodes are paired with their own Nodes. Nodes have same pool wallet loaded, same API key used.

vinnielima commented 2 years ago

This seems to be an issue with new jobs not being rebroadcasted when a block is found.

Code that notifies new jobs to miners (ErgoPool.cs):

image

Needs to be invoked when a block is found (in ErgoJobManager.cs): image

vinnielima commented 2 years ago

The problem is if you look in update job it sends this log message: $"Detected new block {job.Height} [{via}]" The thing is we've seen this log message and the miners continue to send old jobs even after this log message is sent For example in the log it prints out this: [2021-11-18 22:43:16.4095] [I] [ergo1] Detected new block 115171 [POLL] But then it continues to receive old jobs for 115159

vinnielima commented 2 years ago

Logs from testnet, you can see candidate blocks being found and shortly after jobs being submitted for that same block.

Stratum: https://vvlsystems-my.sharepoint.com/:f:/p/vlima/EiE-uz8Z0rtLkKEP7EFkDB8Bwsyxv855vuYpqgtDj7NLLw?e=TLbxMt Node (v 16): https://vvlsystems-my.sharepoint.com/:u:/p/vlima/EZXNkCF9vc9AvPTzDnwdyEQBhaSrCgyzXApPY6hvwBFK_A?e=NdSvFQ

vinnielima commented 2 years ago

Here's an example you will find in the above log.

Block candidate mined:

image

Shortly after, submitted share for the old block: image