Sifchain / sifnode

SifNode - The future of Defi
Other
108 stars 119 forks source link

feat: add chain-initiator tool to use mainnet snapshot in localnet #3435

Closed snobbee closed 7 months ago

snobbee commented 7 months ago

Here is how to run the chain-initiator tool:

$ go run ./scripts/chain-initiator/... https://snapshots.polkachu.com/snapshots/sifchain/sifchain_15048938.tar.lz4 https://github.com/Sifchain/sifnode/releases/download/v1.3.0-beta/sifnoded-v1.3.0-beta-darwin-arm64 https://github.com/Sifchain/sifnode/releases/download/v1.3.1-beta/sifnoded-v1.3.1-beta-darwin-arm64 --home /tmp/node --skip-snapshot --skip-chain-init
2023/12/11 10:42:26 skipping snapshot retrieval
2023/12/11 10:42:26 skipping chain init
2023/12/11 10:42:31 Old binary path: /tmp/sifnoded-1.3.0-beta and version: 1.3.0-beta
2023/12/11 10:42:38 New binary path: /tmp/sifnoded-1.3.1-beta and version: 1.3.1-beta
2023/12/11 10:42:38 Waiting for node to start...
[...]
2023/12/11 10:42:43 Node is running.
2023/12/11 10:42:44 Current Block Height: 15049014
2023/12/11 10:42:44 Waiting for next block height...
[...]
10:42AM INF executed block height=15049015 module=state num_invalid_txs=0 num_valid_txs=0
10:42AM INF commit synced commit=436F6D6D697449447B5B3830203133392032343720323535203132392034392032322031363720353320313832203137342031313720313135203636203620313637203232302031353020313630203138342031393120313339203233322039302032313720313933203237203933203234332031363920313436203232365D3A4535413133377D
[...]
2023/12/11 10:42:49 New Block Height: 15049015
[...]
2023/12/11 10:42:51 Submitted upgrade proposal: 1.3.1-beta, upgrade block height: 15049020
[...]
10:42AM INF received complete proposal block hash=3718AD754A13DF012AFEBB89397BBA7909F997AE4A8D4978EB31F68B1FC3F8CF height=15049017 module=consensus
[...]
2023/12/11 10:42:56 Voted on upgrade proposal: 149
[...]
2023/12/11 10:43:01 Waiting for block height 15049020 ...
[...]
2023/12/11 10:43:06 Waiting for block height 15049020 ...
[...]
10:43AM ERR UPGRADE "1.3.1-beta" NEEDED at height: 15049020: 
10:43AM ERR CONSENSUS FAILURE!!! err="UPGRADE \"1.3.1-beta\" NEEDED at height: 15049020: " module=consensus stack="goroutine 101 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x64\ngithub.com/tendermint/tendermint/consensus.(*State).receiveRoutine.func2()\n\tgithub.com/tendermint/tendermint@v0.34.27/consensus/state.go:732 +0x44\npanic({0x102c860e0, 0x1405fc772f0})\n\truntime/panic.go:884 +0x204\ngithub.com/cosmos/cosmos-sdk/x/upgrade.BeginBlocker({{_, _}, _, {_, _}, {_, _}, _, {_, _}, ...}, ...)\n\tgithub.com/cosmos/cosmos-sdk@v0.45.16/x/upgrade/abci.go:71 +0xc38\ngithub.com/cosmos/cosmos-sdk/x/upgrade.AppModule.BeginBlock(...)\n\tgithub.com/cosmos/cosmos-sdk@v0.45.16/x/upgrade/module.go:130\ngithub.com/cosmos/cosmos-sdk/types/module.(*Manager).BeginBlock(_, {{0x102fa8418, 0x140000520b0}, {0x102fb6650, 0x14060464080}, {{0xb, 0x0}, {0x14055635f90, 0xa}, 0xe5a13c, ...}, ...}, ...)\n\tgithub.com/cosmos/cosmos-sdk@v0.45.16/types/module/module.go:491 +0x188\ngithub.com/Sifchain/sifnode/app.(*SifchainApp).BeginBlocker(...)\n\tgithub.com/Sifchain/sifnode/app/app.go:721\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).BeginBlock(_, {{0x14060439f80, 0x20, 0x20}, {{0xb, 0x0}, {0x14055635f90, 0xa}, 0xe5a13c, {0x1bb798a8, ...}, ...}, ...})\n\tgithub.com/cosmos/cosmos-sdk@v0.45.16/baseapp/abci.go:177 +0x768\ngithub.com/tendermint/tendermint/abci/client.(*localClient).BeginBlockSync(_, {{0x14060439f80, 0x20, 0x20}, {{0xb, 0x0}, {0x14055635f90, 0xa}, 0xe5a13c, {0x1bb798a8, ...}, ...}, ...})\n\tgithub.com/tendermint/tendermint@v0.34.27/abci/client/local_client.go:280 +0x108\ngithub.com/tendermint/tendermint/proxy.(*appConnConsensus).BeginBlockSync(_, {{0x14060439f80, 0x20, 0x20}, {{0xb, 0x0}, {0x14055635f90, 0xa}, 0xe5a13c, {0x1bb798a8, ...}, ...}, ...})\n\tgithub.com/tendermint/tendermint@v0.34.27/proxy/app_conn.go:81 +0x4c\ngithub.com/tendermint/tendermint/state.execBlockOnProxyApp({0x102fa9288?, 0x1400012f440}, {0x102fb0500, 0x1400120afb0}, 0x140005d03c0, {0x102fb7c20, 0x14000ca2090}, 0xe5a13b?)\n\tgithub.com/tendermint/tendermint@v0.34.27/state/execution.go:307 +0x3a8\ngithub.com/tendermint/tendermint/state.(*BlockExecutor).ApplyBlock(_, {{{0xb, 0x0}, {0x140014a3b30, 0x7}}, {0x140014a3b40, 0xa}, 0xe5a0eb, 0xe5a13b, {{0x1405dcd1100, ...}, ...}, ...}, ...)\n\tgithub.com/tendermint/tendermint@v0.34.27/state/execution.go:140 +0xf0\ngithub.com/tendermint/tendermint/consensus.(*State).finalizeCommit(0x14000226000, 0xe5a13c)\n\tgithub.com/tendermint/tendermint@v0.34.27/consensus/state.go:1661 +0x99c\ngithub.com/tendermint/tendermint/consensus.(*State).tryFinalizeCommit(0x14000226000, 0xe5a13c)\n\tgithub.com/tendermint/tendermint@v0.34.27/consensus/state.go:1570 +0x28c\ngithub.com/tendermint/tendermint/consensus.(*State).enterCommit.func1()\n\tgithub.com/tendermint/tendermint@v0.34.27/consensus/state.go:1505 +0xa0\ngithub.com/tendermint/tendermint/consensus.(*State).enterCommit(0x14000226000, 0xe5a13c, 0x0)\n\tgithub.com/tendermint/tendermint@v0.34.27/consensus/state.go:1543 +0xb90\ngithub.com/tendermint/tendermint/consensus.(*State).addVote(0x14000226000, 0x1405fb70280, {0x0, 0x0})\n\tgithub.com/tendermint/tendermint@v0.34.27/consensus/state.go:2164 +0x1698\ngithub.com/tendermint/tendermint/consensus.(*State).tryAddVote(0x14000226000, 0x1405fb70280, {0x0?, 0x100ff0e90?})\n\tgithub.com/tendermint/tendermint@v0.34.27/consensus/state.go:1962 +0x28\ngithub.com/tendermint/tendermint/consensus.(*State).handleMsg(0x14000226000, {{0x102f8de00, 0x1405fc54468}, {0x0, 0x0}})\n\tgithub.com/tendermint/tendermint@v0.34.27/consensus/state.go:861 +0x37c\ngithub.com/tendermint/tendermint/consensus.(*State).receiveRoutine(0x14000226000, 0x0)\n\tgithub.com/tendermint/tendermint@v0.34.27/consensus/state.go:788 +0x350\ncreated by github.com/tendermint/tendermint/consensus.(*State).OnStart\n\tgithub.com/tendermint/tendermint@v0.34.27/consensus/state.go:379 +0xf4\n"
10:43AM INF service stop impl={"Logger":{}} module=consensus msg={} wal=/tmp/node/data/cs.wal/wal
10:43AM INF service stop impl={"Dir":"/tmp/node/data/cs.wal","Head":{"ID":"4BeLzGkSMXWx:/tmp/node/data/cs.wal/wal","Path":"/tmp/node/data/cs.wal/wal"},"ID":"group:4BeLzGkSMXWx:/tmp/node/data/cs.wal/wal","Logger":{}} module=consensus msg={} wal=/tmp/node/data/cs.wal/wal
2023/12/11 10:43:11 Block height 15049020 reached
2023/12/11 10:43:11 Process killed successfully
2023/12/11 10:43:11 Process was killed: signal: killed
2023/12/11 10:43:16 Waiting for node to start...
[...]
10:43AM INF applying upgrade "1.3.1-beta" at height: 15049020
10:43AM INF Running upgrade handler for 1.3.1-beta
[...]
2023/12/11 10:43:21 Node is running.
2023/12/11 10:43:21 Current Block Height: 15049020
2023/12/11 10:43:21 Waiting for next block height...
[...]
10:43AM INF executed block height=15049021 module=state num_invalid_txs=0 num_valid_txs=0
10:43AM INF commit synced commit=436F6D6D697449447B5B3739203739203534203135203335203134203236203134342031313120323439203133362032382035322031352032343420323432203936203234352036392031303820323434203138372031313020323331203234362031363220313938203139322032353520313131203934203133335D3A4535413133447D
[...]
^C2023/12/11 10:43:42 Process killed successfully

The command requires 3 arguments:

What it does?

codecov[bot] commented 7 months ago

Codecov Report

Merging #3435 (8970c55) into master (0c63583) will increase coverage by 1.00%. Report is 14 commits behind head on master. The diff coverage is 58.58%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435/graphs/tree.svg?width=650&height=150&src=pr&token=3MUGKY0G1M&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain)](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain) ```diff @@ Coverage Diff @@ ## master #3435 +/- ## ========================================== + Coverage 43.35% 44.35% +1.00% ========================================== Files 166 183 +17 Lines 15895 16736 +841 ========================================== + Hits 6891 7423 +532 - Misses 8591 8868 +277 - Partials 413 445 +32 ``` | [Files](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain) | Coverage Δ | | |---|---|---| | [app/app.go](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain#diff-YXBwL2FwcC5nbw==) | `94.42% <100.00%> (+4.31%)` | :arrow_up: | | [cmd/sifnoded/cmd/ibc-diag.go](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain#diff-Y21kL3NpZm5vZGVkL2NtZC9pYmMtZGlhZy5nbw==) | `15.74% <ø> (ø)` | | | [x/clp/keeper/executors.go](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain#diff-eC9jbHAva2VlcGVyL2V4ZWN1dG9ycy5nbw==) | `59.12% <100.00%> (+0.60%)` | :arrow_up: | | [x/clp/types/codec.go](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain#diff-eC9jbHAvdHlwZXMvY29kZWMuZ28=) | `100.00% <100.00%> (ø)` | | | [x/clp/types/key\_rewards\_bucket.go](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain#diff-eC9jbHAvdHlwZXMva2V5X3Jld2FyZHNfYnVja2V0Lmdv) | `100.00% <100.00%> (ø)` | | | [x/clp/types/keys.go](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain#diff-eC9jbHAvdHlwZXMva2V5cy5nbw==) | `85.36% <100.00%> (+2.03%)` | :arrow_up: | | [x/clp/types/querier.go](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain#diff-eC9jbHAvdHlwZXMvcXVlcmllci5nbw==) | `100.00% <ø> (ø)` | | | [x/clp/types/types.go](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain#diff-eC9jbHAvdHlwZXMvdHlwZXMuZ28=) | `97.14% <100.00%> (+0.26%)` | :arrow_up: | | [x/dispensation/types/types.go](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain#diff-eC9kaXNwZW5zYXRpb24vdHlwZXMvdHlwZXMuZ28=) | `100.00% <100.00%> (ø)` | | | [x/epochs/keeper/abci.go](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain#diff-eC9lcG9jaHMva2VlcGVyL2FiY2kuZ28=) | `100.00% <100.00%> (ø)` | | | ... and [26 more](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain) | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/Sifchain/sifnode/pull/3435/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sifchain)