Skip to content

Instantly share code, notes, and snippets.

@CrazySerGo
Last active November 23, 2021 16:40
Show Gist options
  • Save CrazySerGo/8944aaa92bce55357c26e6e4e88e2225 to your computer and use it in GitHub Desktop.
Save CrazySerGo/8944aaa92bce55357c26e6e4e88e2225 to your computer and use it in GitHub Desktop.
Testnet 1.8.5 Restart
(If you are running Solana v1.8.*, please upgrade to v1.8.5)
The restart will start from the highest finalized slot.
$ solana slot -ul --commitment finalized
103858865
Highest optimistically confirmed slot should contain: 103858865
Note: If your last confirmed slot is lower than that the one listed below, this is likely your node crashed before it was able to observe the latest supermajority. Follow the instructions in the appendix
The known validator arguments provided below are validators who have the last optimistic slot and are providing snapshots for it, don’t keep them in your list as known validators after the restart as these are community validators not Solana Foundation nodes.
Important: DO NOT delete your ledger directory
## Step 0: Stop the validator service
**IMPORTANT:** ⚠️MAKE SURE TO STOP YOUR VALIDATOR BEFORE DOING ANYTHING ELSE.⚠️
**IMPORTANT:** ⚠️DO NOT delete your ledger directory.⚠️
**NOTE:** *Upgrade to v1.8.5 if you are running older Solana version.*
## Step 1:
Step 1: Create a snapshot at slot 103858865
This document assumes your ledger directory is called ledger/. If not then adjust the following commands accordingly.
Use the ledger tool to create a new snapshot at slot 103858865, replacing the two instances of <ledger path> to your actual ledger path:
$ solana-ledger-tool --ledger <ledger path> create-snapshot 103858865 <ledger path> --hard-fork 103858865 --destake-vote-account 8Enep3GC85MpmyztHRCetpLH2TuNgVrcsZzdjtepZ3GB
Or else, if you use separate directory for snapshots:
$ solana-ledger-tool --ledger <ledger path> create-snapshot 103858865 <snapshots path> --hard-fork 103858865 --snapshot-archive-path <snapshots path> --destake-vote-account 8Enep3GC85MpmyztHRCetpLH2TuNgVrcsZzdjtepZ3GB
**NOTE:** --destake-vote-account adds 1 more slot*
OBS: 8Enep3GC85MpmyztHRCetpLH2TuNgVrcsZzdjtepZ3GB is a validator with 1m SOL that has been offline for weeks
Add --snapshot-archive-path before “create-snapshot” if you have a separate snapshot dir, and --accounts after “create-snapshot” if you have a separate accounts dir
The final line of output should be “Shred version: 40424”, and this snapshot file should now exist:
ledger/snapshot-103858866-Gu2jB6vUVy7XZWMPPErAUszYg65K7fqricimCjXXmHLy.tar.zst
Check your ledger/ directory to ensure that you have no snapshot newer than ledger/snapshot-103858866-..... This is very unlikely, but if found should be removed. Snapshots older than ledger/snapshot-103858866-.. should not be removed.
NOTE: If you receive “Error: Slot 103858865 is not available”, please see appendix
Step 2: Adjust your validator command-line arguments, temporarily for this restart to include:
--wait-for-supermajority 103858866 \
--no-snapshot-fetch \
--no-genesis-fetch \
--expected-bank-hash 7haWD8r1tvRaK1gw95eVedXKJTVD43PXnoBXyjerFbav \
--expected-shred-version 40424 \
--entrypoint entrypoint.testnet.solana.com:8001 \
--entrypoint entrypoint2.testnet.solana.com:8001 \
--entrypoint entrypoint3.testnet.solana.com:8001 \
--known-validator GcibmF4zgb6Vr4bpZZYHGDPZNWiLnBDUHdpJZTsTDvwe \
--known-validator eoKpUABi59aT4rR9HGS3LcMecfut9x7zJyodWWP43YQ \
--known-validator 3iPu9xQ3mCFmqME9ZajuZbFHjwagAxhgfTxnc4pWbEBC \
--known-validator 8SRKNfvMerfA1BdU79CAwU4wNfjnDvFrBo3o5f5TS4uv \
--known-validator FCnsZL8d45gC5aVsmheV3zs533DfM2jRk1vNnDgLNkfr \
--known-validator 8VNj7K6ssFcUogRfT6miUzz8HTKu1nX2n8MYr5z49CXb \
(Remove the previous value of “--expected-shred-version“ if present)
Once the cluster restarts and normal operation resumes, remember to remove these arguments. They are only required for the restart.
Step 3: Start your validator
As it boots, it will load the snapshot for slot 103858866 and wait for 80% of the stake to come online before producing/validating new blocks.
To confirm your restarted validator is correctly waiting for 80% stake, look for this periodic log message to confirm it is waiting:
INFO solana_core::validator] Waiting for 80% of activated stake at slot 103858866 to be in gossip...
And if you have RPC enabled, ask it repeated for the current slot:
$ solana --url http://127.0.0.1:8899 slot
Any number other than 103858866 means you did not complete the steps correctly.
Appendix: Resolution if you did not preserve your ledger or your last optimistically confirmed slot is below 103858865
NOT RECOMMENDED - this resolution should only be attempted if your ledger/ directory is unavailable.
If your ledger history is corrupt or otherwise unavailable, delete your ledger/ directory instead of Steps 1 & 2, then complete Steps 3.
OBS: remove --no-snapshot-fetch if set
Add these arguments to restart:
--wait-for-supermajority 103858866 \
--expected-shred-version 40424 \
--entrypoint entrypoint.testnet.solana.com:8001 \
--entrypoint entrypoint2.testnet.solana.com:8001 \
--entrypoint entrypoint3.testnet.solana.com:8001 \
--expected-bank-hash 7haWD8r1tvRaK1gw95eVedXKJTVD43PXnoBXyjerFbav \
--known-validator GcibmF4zgb6Vr4bpZZYHGDPZNWiLnBDUHdpJZTsTDvwe \
--known-validator eoKpUABi59aT4rR9HGS3LcMecfut9x7zJyodWWP43YQ \
--known-validator 3iPu9xQ3mCFmqME9ZajuZbFHjwagAxhgfTxnc4pWbEBC \
--known-validator 8SRKNfvMerfA1BdU79CAwU4wNfjnDvFrBo3o5f5TS4uv \
--known-validator FCnsZL8d45gC5aVsmheV3zs533DfM2jRk1vNnDgLNkfr \
--known-validator 8VNj7K6ssFcUogRfT6miUzz8HTKu1nX2n8MYr5z49CXb \
NOTE: You can download snapshot here:
$ wget --trust-server-names http://hel2.rpcpool.com/snapshot.tar.bz2
NOTE: Entrypoints were updated with default https://edge.docs.solana.com/clusters#testnet to avoid extra traffic to community nodes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment