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

State Sync doesn't work on latest binaries (v1.0.0) #2

Open
hdmiimdh opened this issue Dec 15, 2022 · 2 comments
Open

State Sync doesn't work on latest binaries (v1.0.0) #2

hdmiimdh opened this issue Dec 15, 2022 · 2 comments

Comments

@hdmiimdh
Copy link

Error trying to state sync.

4:10PM ERR snapshot manager not configured
4:10PM ERR State sync failed err="state sync aborted" module=statesync

RPC Node configuration:

pruning = "custom"
pruning-keep-recent = "100"
pruning-keep-every = "2000"
pruning-interval = "10"

snapshot-interval = 2000
snapshot-keep-recent = 2

You can use our RPC for testing purposes:

SNAP_RPC="https://humans-testnet.nodejumper.io:443"

In order to reproduce run the below set of commands:

sudo systemctl stop humansd

cp $HOME/.humans/data/priv_validator_state.json $HOME/.humans/priv_validator_state.json.backup
humansd tendermint unsafe-reset-all --home $HOME/.humans --keep-addr-book

SNAP_RPC="https://humans-testnet.nodejumper.io:443"

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH

peers="e4234a5fba85b2c3d2ad157b6961ac3d115f4c49@humans-testnet.nodejumper.io:28656"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$peers'"|' $HOME/.humans/config/config.toml

sed -i -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.humans/config/config.toml

mv $HOME/.humans/priv_validator_state.json.backup $HOME/.humans/data/priv_validator_state.json

sudo systemctl restart humansd
sudo journalctl -u humansd -f --no-hostname -o cat
@hdmiimdh
Copy link
Author

After some investigation, it turns out that this was actually a bug in the SDK. Should already be solved in 0.46.7.

Corresponding issue: cosmos/cosmos-sdk#13766

Temporary workaround is to set the snapshot interval flags for the syncing node.

I think this can be closed.

@0x4139
Copy link
Contributor

0x4139 commented Dec 23, 2022

Not really a bug more like a configuration gotcha

sed -E -i -s 's/snapshot-interval = 0/snapshot-interval = 10000/' $HOME/.humans/config/app.toml

should help everyone out.

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

No branches or pull requests

2 participants