Kudaraidee / miningcore-xiaolin1579

Miningcore is a high-performance Mining Pool Software for Linux and Windows.
https://store.miningcore.pro
MIT License
33 stars 43 forks source link

"Block submission failed with: bad-cb-payee" AND "IsBlockPayeeValid -- ERROR: Invalid smartnode payment detected" #26

Closed stabner closed 10 months ago

stabner commented 10 months ago

Having trouble getting the blocks into my pool wallet, I am finding many blocks but error on all of them. And its related to: "Block submission failed with: bad-cb-payee" AND "IsBlockPayeeValid -- ERROR: Invalid smartnode payment detected",

I have tried to do some research and found out it might have to do with the wallets address legacy and or the smartnode, I have tried to create one but I failed... I lack the experience to solve this, I have tried for 5-6 days now so I am not lazy just ran out of options.

ive seen many post about this but havent seen any solutions, I also know it might not be related to Miningcore it self, if you know something I can try I would really appreciate it. <3

I have tried Create these wallets: skytere-cli getnewaddress - didnt work skytere-cli getnewaddress legacy - didnt work skytere-cli getnewaddress poolwallet legacy - didnt work

coin.json file:

"skytere": { "name": "Skytere", "canonicalName": "Skytere", "symbol": "SKYT", "family": "bitcoin", "website": "https://skytere.com/", "market": "", "github": "", "twitter": "", "telegram": "", "discord": "https://discord.com/invite/UGfj5D6hEb", "coinbaseHasher": { "hash": "sha256d" }, "headerHasher": { "hash": "ghostrider" }, "blockHasher": { "hash": "reverse", "args": [ { "hash": "sha256d" } ] }, "hasFounderFee": true, "hasMasterNodes": true, "hasSmartNodes": true, "shareMultiplier": 65536, "explorerBlockLink": "https://explorer.skytere.com//block/$hash$", "explorerTxLink": "https://explorer.skytere.com//tx/{0}", "explorerAccountLink": "https://explorer.skytere.com//address/{0}"

stabner commented 10 months ago

Dont know if I have understand this correctly but!

Asking me if I have them installed on this machine to handle payments or if the network have them? Since I have NOT installed any smartnode on this machine I am gonna try to turn this off/or remove line ("hasSmartNodes": false).

xiaolin1579 commented 10 months ago

plaese update https://github.com/xiaolin1579/miningcore/commit/af113536e284d668623890c1dc1055b71c5c96c7

stabner commented 10 months ago

Went to make the change, but it was already set to that line. I am getting hairless soon :D haha sorry for being a pain in the a**

A copy from the repo:

region Masternodes

protected MasterNodeBlockTemplateExtra masterNodeParameters;

protected virtual Money CreateMasternodeOutputs(Transaction tx, Money reward)
{
    if(masterNodeParameters.Masternode != null)
    {
        Masternode[] masternodes;

        // Dash v13 Multi-Master-Nodes
        if(masterNodeParameters.Masternode.Type == JTokenType.Array)
            masternodes = masterNodeParameters.Masternode.ToObject<Masternode[]>();
        else
            masternodes = new[] { masterNodeParameters.Masternode.ToObject<Masternode>() };

        if(masternodes != null)
        {
            foreach(var masterNode in masternodes)
            {
                if(!string.IsNullOrEmpty(masterNode.Payee))
                {
                    var payeeDestination = BitcoinUtils.AddressToDestination(masterNode.Payee, network);
                    var payeeReward = masterNode.Amount;

                    tx.Outputs.Add(payeeReward, payeeDestination);
                    reward -= payeeReward;
                }
            }
        }
    }

    if(masterNodeParameters.SuperBlocks is { Length: > 0 })
    {
        foreach(var superBlock in masterNodeParameters.SuperBlocks)
        {
            var payeeAddress = BitcoinUtils.AddressToDestination(superBlock.Payee, network);
            var payeeReward = superBlock.Amount;

            tx.Outputs.Add(payeeReward, payeeAddress);
            reward -= payeeReward;
        }
    }

    if(!coin.HasPayee && !string.IsNullOrEmpty(masterNodeParameters.Payee))
    {
        var payeeAddress = BitcoinUtils.AddressToDestination(masterNodeParameters.Payee, network);
        var payeeReward = masterNodeParameters.PayeeAmount;

        tx.Outputs.Add(payeeReward, payeeAddress);
        reward -= payeeReward;
    }

    return reward;
}
xiaolin1579 commented 10 months ago

Did it work?

stabner commented 10 months ago

I dont think so, it was already set to that change you posted :) I am starting to test some different coin.json settings, waiting on finding a block and see what happends. thanks for replying so fast though <3

I am also installing GspCoin daemon, where I find blocks easier and compare them.

stabner commented 10 months ago

I dont think the problem is in Miningcore itself, it has to be the coin.json config for the coin, thats my opinion on this, I was "dirty" and did a copy paste from another ghostrider algo and change some info that fits Skytere, soo I am not 100% if its the right settings.

stabner commented 10 months ago

ok, tried mining on GspCoin also and finding blocks but getting the same error there

from the log of GspCoin:

[2023-11-26 17:32:08.9258] [I] [gsp] Submitting block 137118 [05dac9e6945d0be7cd67e58d06907dd199c7585befb02d1cb1febb96609ec219] [2023-11-26 17:32:09.0154] [W] [gsp] Block 137118 submission failed with: bad-cb-payee [2023-11-26 17:32:09.0196] [I] [gsp] [0HMVEIJU18S3D] Share accepted: D=0.776 [2023-11-26 17:32:14.5269] [I] [gsp] [0HMVEIJU18S3D] Share accepted: D=0.776 [2023-11-26 17:32:22.9104] [I] [gsp] [0HMVEIJU18S3D] Share accepted: D=0.776 [2023-11-26 17:32:23.5891] [I] [gsp] [0HMVEIJU18S3C] Share accepted: D=0.471 [2023-11-26 17:32:24.7840] [I] [gsp] [0HMVEIJU18S3D] Share accepted: D=0.776 [2023-11-26 17:32:28.5214] [I] [gsp] [0HMVEIJU18S3D] Share accepted: D=0.776 [2023-11-26 17:32:28.5450] [I] [gsp] [0HMVEIJU18S3D] Share accepted: D=0.776 [2023-11-26 17:32:28.5452] [I] [gsp] [0HMVEIJU18S3D] VarDiff update to 1.151 [2023-11-26 17:32:31.1529] [I] [gsp] [0HMVEIJU18S3C] Share accepted: D=0.471 [2023-11-26 17:32:42.7287] [I] [gsp] [0HMVEIJU18S3D] Share accepted: D=1.151 [2023-11-26 17:32:45.5238] [I] [gsp] [0HMVEIJU18S3D] Share accepted: D=1.151 [2023-11-26 17:32:46.0228] [I] [gsp] [0HMVEIJU18S3C] Share accepted: D=0.471 [2023-11-26 17:32:56.6972] [I] [gsp] [0HMVEIJU18S3D] Share accepted: D=1.151 [2023-11-26 17:33:54.3769] [I] [gsp] [0HMVEIJU18S3C] Share accepted: D=0.471 [2023-11-26 17:33:54.3769] [I] [gsp] [0HMVEIJU18S3C] VarDiff update to 0.323 [2023-11-26 17:34:01.3359] [I] [gsp] [0HMVEIJU18S3C] Share accepted: D=0.323 [2023-11-26 17:34:04.7204] [I] [gsp] [0HMVEIJU18S3D] Share accepted: D=1.151 [2023-11-26 17:34:04.7234] [I] [gsp] [0HMVEIJU18S3D] VarDiff update to 0.718 [2023-11-26 17:34:14.9882] [I] [gsp] [0HMVEIJU18S3C] Share accepted: D=0.323 [2023-11-26 17:34:18.9179] [I] [gsp] [0HMVEIJU18S3D] Share accepted: D=0.718 [2023-11-26 17:34:20.8030] [I] [gsp] [0HMVEIJU18S3C] Share accepted: D=0.323 [2023-11-26 17:34:46.2080] [I] [gsp] Submitting block 137118 [cf51dbd2f3cfd84c94d69d446e120f635025276721e584ab3998bf5be7170991] [2023-11-26 17:34:46.2728] [W] [gsp] Block 137118 submission failed with: bad-cb-payee

I am using the coin.json file that came with the repo of this Miningcore.

what the heck am I missing :/

stabner commented 10 months ago

Do you have to setup a smartnode your self in order for this to work, I have just download the ubuntu 20 release daemon for the coins and synced them up and then ran with these settings:

daemon=1 server=1 listen=1 rpcport=12345 rpcuser=user rpcpassword=password

ofc I am using their own rpcport

xiaolin1579 commented 10 months ago

https://github.com/xiaolin1579/miningcore/blob/dev/src/Miningcore/Blockchain/Bitcoin/BitcoinJob.cs#L789-L807

stabner commented 10 months ago

interesting, that code part was different from mine, testing it now :)

xiaolin1579 commented 9 months ago

https://github.com/xiaolin1579/miningcore/commit/e9ee11ced33039dce1845cdf742e264c15e166ed