KomodoPlatform / komodo

Komodo
https://komodoplatform.com/
Other
118 stars 95 forks source link

-testnet flag crashes komodod #519

Open gcharang opened 2 years ago

gcharang commented 2 years ago

Describe the issue

Please provide a general summary of the issue you're experiencing

starting komodod with the -testnet parameter causes it to crash with the line:

komodod: main.cpp:2704: void InvalidChainFound(CBlockIndex*): Assertion `tip' failed.

I think the -testnet flag was initially designed for just launching and testing smartchains without needing 2 nodes/daemons

It might also be causing this following line to be printed when the parameter is used with a plain komodod:

./komodod -testnet                                                                                                                                                                                  
couldnt open.(/home/gcharang/.komodo/.komodo/komodo.conf) will not validate dest notarizations 

Notice: .komodo/.komodo/komodo.conf , it is wierd and looks like a smart chain's conf location had its name replaced by "komodo"

Using

./komodod -ac_name=TEST -ac_supply=100000000 -testnet

Shows the usual output that creates a conf file at the appropriate location and the line with netmagic but still ends with the Assertiontip' failed.` error

Can you reliably reproduce the issue?

If so, please list the steps to reproduce below:

  1. build komodod from master
  2. add -testnet to any set of launch parameters that include komodod
  3. watch the daemon's output

Expected behaviour

Gracefully shutdown if no valid -ac_ params are given Launch a new Smart Chain if the -ac_ params are valid

Actual behaviour + errors

Komodo:

./komodod -testnet
couldnt open.(/home/gcharang/.komodo/.komodo/komodo.conf) will not validate dest notarizations
chainparams_commandline called
call komodo_args.(./komodod) NOTARY_PUBKEY.()
initialized  at 1637849952
Komodo  server starting
nMaxConnections 384
finished loading blocks 
processing /home/gcharang/.komodo/komodostate 10206KB, validated.-1
inds.0x7fe039dc1010 validate /home/gcharang/.komodo/komodostate.ind fsize.2415328 datalen.10451142 n.603832 lastfpos.0
/home/gcharang/.komodo/komodostate.ind validated fpos.10451142
took 1 seconds to process /home/gcharang/.komodo/komodostate 10206KB
fAddressIndex.0/0 fSpentIndex.0/0
komodod: main.cpp:2704: void InvalidChainFound(CBlockIndex*): Assertion `tip' failed.

Smart Chain

./komodod -ac_name=TEST -ac_supply=100000000 -testnet
ASSETCHAINS_SUPPLY 100000000
MAX_MONEY 10000006320417438 100000063.20417438
Created (/home/gcharang/.komodo/TEST/TEST.conf)
chainparams_commandline called
>>>>>>>>>> TEST: p2p.12183 rpc.12184 magic.ee32f43e 3996316734 100000000 coins
call komodo_args.(./komodod) NOTARY_PUBKEY.()
initialized TEST at 1637850038
nMaxConnections 384
finished loading blocks TEST
fAddressIndex.0/0 fSpentIndex.0/0
komodod: main.cpp:2704: void InvalidChainFound(CBlockIndex*): Assertion `tip' failed.
Aborted

The version of Komodo you were using:

Komodo Daemon version v0.7.1-beta1-d7edae28b-dirty

cc: @Alrighttt @dimxy

dimxy commented 2 years ago

I have seen this bug, will find out

hashbender commented 2 years ago

Same here