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

Add ZOMBIE test coin warning #589

Closed
wants to merge 20 commits into from
Closed

Add ZOMBIE test coin warning #589

wants to merge 20 commits into from

Conversation

smk762
Copy link

@smk762 smk762 commented Jun 23, 2023

The ZOMBIE electrum and lightwalletd services have been running on a komodod built from the https://github.com/KomodoPlatform/komodo/tree/ARRR-HTLC-debug branch. In consultation with Alright, it was determined that only the changes in this PR are needed to bring ZOMBIE back into alignment with the main/dev branch.

@@ -1549,17 +1549,21 @@ void komodo_args(char *argv0)
if ( !chainName.isKMD() )
{
BITCOIND_RPCPORT = GetArg("-rpcport", ASSETCHAINS_RPCPORT);
IS_KOMODO_TESTNODE = GetArg("-testnode",0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to remove this line entirely. It should already be set above this.

@dimxy
Copy link
Collaborator

dimxy commented Jun 24, 2023

The IS_KOMODO_TESTNODE flag actually allows that you can mine blocks on an isolated node, without peers (so in that case you probably can't buy coins anyway)

Copy link

@DeckerSU DeckerSU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's better to use && instead of alternate token and:

else if ( chainName.isSymbol("ZOMBIE") && IS_KOMODO_TESTNODE )

instead of

else if ( chainName.isSymbol("ZOMBIE") and IS_KOMODO_TESTNODE )

And can someone explain to me the logic we are trying to implement here? If the chain is ZOMBIE, we allowing the -ac_private parameter as in PIRATE and display a warning? And what if someone launches ZOMBIE with -ac_name=ZOMBIE -ac_private=1 but without -testnode?

May be we should implement this condition more clear, like (just an offer):

        if (chainName.isSymbol("PIRATE") && ASSETCHAINS_HALVING[0] == 77777) {
            ASSETCHAINS_HALVING[0] *= 5;
            fprintf(stderr, "PIRATE halving changed to %d %.1f days ASSETCHAINS_LASTERA.%llu\n", (int32_t)ASSETCHAINS_HALVING[0], (double)ASSETCHAINS_HALVING[0] / 1440, (long long)ASSETCHAINS_LASTERA);
        } else if (ASSETCHAINS_PRIVATE != 0) {
            if (chainName.isSymbol("ZOMBIE") {
                fprintf(stderr, "TEST COIN, DO NOT BUY\n");
            } else {
                fprintf(stderr, "-ac_private for a non-PIRATE chain is not supported. The only reason to have an -ac_private chain is for total privacy and that is best achieved with the largest anon set. PIRATE has that and it is recommended to just use PIRATE\n");
                StartShutdown();
            }
        }

Or may be even like:

        if (chainName.isSymbol("PIRATE") && ASSETCHAINS_HALVING[0] == 77777) {
            ASSETCHAINS_HALVING[0] *= 5;
            fprintf(stderr, "PIRATE halving changed to %d %.1f days ASSETCHAINS_LASTERA.%llu\n", (int32_t)ASSETCHAINS_HALVING[0], (double)ASSETCHAINS_HALVING[0] / 1440, (long long)ASSETCHAINS_LASTERA);
        }

        std::set<std::string> allowedPrivateOnly = {"PIRATE", "ZOMBIE"};
        if (ASSETCHAINS_PRIVATE != 0 && allowedPrivateOnly.find(chainName.ToString()) == allowedPrivateOnly.end()) {
            fprintf(stderr, "-ac_private for a non-PIRATE chain is not supported. The only reason to have an -ac_private chain is for total privacy and that is best achieved with the largest anon set. PIRATE has that and it is recommended to just use PIRATE\n");
            StartShutdown();
        }

@DeckerSU
Copy link

The discussion seems to have come to a standstill, so I am closing it. Additionally, the changes made in this PR only introduce one new message that is printed in stdout, which is considered unnecessary.

@DeckerSU DeckerSU closed this Jan 26, 2024
@smk762 smk762 reopened this Mar 7, 2024
@smk762
Copy link
Author

smk762 commented Mar 7, 2024

@DeckerSU I'm reopening this one, as it does one thing else beyond adding the log message - it avoids progressing into the next conditional which allows running ZOMBIE without needing a special branch, so that when testing z_* methods in other PRs we can use it instead of PIRATE. I'm happy to change the approach of how this is achieved - your second suggestion looks nice so I'll go with that.

@DeckerSU
Copy link

DeckerSU commented Mar 7, 2024

@DeckerSU I'm reopening this one, as it does one thing else beyond adding the log message - it avoids progressing into the next conditional which allows running ZOMBIE without needing a special branch, so that when testing z_* methods in other PRs we can use it instead of PIRATE. I'm happy to change the approach of how this is achieved - your second suggestion looks nice so I'll go with that.

Could you please remind me of the specific arguments / command line parameters for the ZOMBIE chain?

p.s. Never mind. I have submitted a new pull request with an improved solution. Once it is approved, this can be closed.

DeckerSU added a commit that referenced this pull request Mar 7, 2024
Better solution for the issues mentioned in
#589 .
DeckerSU added a commit to DeckerSU/KomodoOcean that referenced this pull request Mar 7, 2024
Better solution for the issue(s) mentioned in KomodoPlatform/komodo#589 .

- KomodoPlatform/komodo#615
@DeckerSU
Copy link

Closed because #615 was accepted.

@DeckerSU DeckerSU closed this Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants