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

fix: add recover to InitChainer to diplay informative message when starting a node from block 1 #2925

Merged
merged 7 commits into from
Sep 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use const for message
kingpinXD committed Sep 30, 2024
commit e5c63e2ee96a8e21f949d13d0a686f00bea305a1
3 changes: 2 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
@@ -877,11 +877,12 @@ func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.Respo
// InitChainer application update at chain initialization
func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
// InitChainErrorMessage is the error message displayed when trying to sync testnet or mainnet from block 1 using the latest binary.
InitChainErrorMessage := `
const InitChainErrorMessage = `
Unable to sync testnet or mainnet from block 1 using the latest version.
Please use a snapshot to sync your node.
Refer to the documentation for more information:
https://www.zetachain.com/docs/nodes/start-here/syncing/`

// The defer is used to catch panics during InitChain
// and display a more meaningful message for people trying to sync a node from block 1 using the latest binary.
// We exit the process after displaying the message as we do not need to start a node with empty state.