|
@ -246,14 +246,14 @@ func (h *Handshaker) Handshake(ctx context.Context, appClient abciclient.Client) |
|
|
return fmt.Errorf("error calling Info: %w", err) |
|
|
return fmt.Errorf("error calling Info: %w", err) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
blockHeight := res.LastBlockHeight |
|
|
|
|
|
if blockHeight < 0 { |
|
|
|
|
|
return fmt.Errorf("got a negative last block height (%d) from the app", blockHeight) |
|
|
|
|
|
|
|
|
appBlockHeight := res.LastBlockHeight |
|
|
|
|
|
if appBlockHeight < 0 { |
|
|
|
|
|
return fmt.Errorf("got a negative last block height (%d) from the app", appBlockHeight) |
|
|
} |
|
|
} |
|
|
appHash := res.LastBlockAppHash |
|
|
appHash := res.LastBlockAppHash |
|
|
|
|
|
|
|
|
h.logger.Info("ABCI Handshake App Info", |
|
|
h.logger.Info("ABCI Handshake App Info", |
|
|
"height", blockHeight, |
|
|
|
|
|
|
|
|
"height", appBlockHeight, |
|
|
"hash", appHash, |
|
|
"hash", appHash, |
|
|
"software-version", res.Version, |
|
|
"software-version", res.Version, |
|
|
"protocol-version", res.AppVersion, |
|
|
"protocol-version", res.AppVersion, |
|
@ -265,13 +265,13 @@ func (h *Handshaker) Handshake(ctx context.Context, appClient abciclient.Client) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Replay blocks up to the latest in the blockstore.
|
|
|
// Replay blocks up to the latest in the blockstore.
|
|
|
_, err = h.ReplayBlocks(ctx, h.initialState, appHash, blockHeight, appClient) |
|
|
|
|
|
|
|
|
_, err = h.ReplayBlocks(ctx, h.initialState, appHash, appBlockHeight, appClient) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return fmt.Errorf("error on replay: %w", err) |
|
|
return fmt.Errorf("error on replay: %w", err) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
h.logger.Info("Completed ABCI Handshake - Tendermint and App are synced", |
|
|
h.logger.Info("Completed ABCI Handshake - Tendermint and App are synced", |
|
|
"appHeight", blockHeight, "appHash", appHash) |
|
|
|
|
|
|
|
|
"appHeight", appBlockHeight, "appHash", appHash) |
|
|
|
|
|
|
|
|
// TODO: (on restart) replay mempool
|
|
|
// TODO: (on restart) replay mempool
|
|
|
|
|
|
|
|
|