Can't run test LCD on because it timeouts when setting out nValidators > 2
On client/lcd/lcd_test.go
I defined:
cleanup, pks, port := InitializeTestLCD(t, 2, []sdk.AccAddress{addr})
Which after 60s timeouts:
E[09-14|13:03:51.561] Couldn't connect to any seeds module=p2p
LADDR tcp://0.0.0.0:54870
E[09-14|13:04:21.565] Couldn't connect to any seeds module=p2p
Tests timed out after 60000ms
After printing different steps in the code it seems that the error comes from this part of the function:
GaiaAppGenState
allocates equal power to initial validators:
https://github.com/cosmos/cosmos-sdk/blob/416181be60f32750178c24be52c9ebf15ce9a25b/cmd/gaia/app/genesis.go#L200
So node does not start when nValidator > 1
. Also see https://github.com/cosmos/cosmos-sdk/pull/1373#issuecomment-404699243.
I think we can write something like TestGaiaAppGenState
, which allocates voting power depending on its input.
@mossid also genesis.go
has a very low test coverage (51.2%)
So ended up digging a long time into this (both TM SDK) and @mossid is correct, It boils down to GaiaAppGenState
(because init chainer on TM relay gets called which sends the app state that has equal power for each validator). So I'll be writing a test version of that.
Also throughout this process, I've realized the genesis logic and implementation as well as the higher level commands calling it, is pretty convoluted, messy and complex.
Most helpful comment
GaiaAppGenState
allocates equal power to initial validators:https://github.com/cosmos/cosmos-sdk/blob/416181be60f32750178c24be52c9ebf15ce9a25b/cmd/gaia/app/genesis.go#L200
So node does not start when
nValidator > 1
. Also see https://github.com/cosmos/cosmos-sdk/pull/1373#issuecomment-404699243.I think we can write something like
TestGaiaAppGenState
, which allocates voting power depending on its input.