From ecc23f4d2eb09fe3339bf0373e66e8db0d1c7f06 Mon Sep 17 00:00:00 2001 From: tnasu Date: Thu, 15 Dec 2022 00:58:19 +0900 Subject: [PATCH] Add the comment about checking "AppVersion" in "verifyApp" --- statesync/syncer.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/statesync/syncer.go b/statesync/syncer.go index 983321aba..4372a2f88 100644 --- a/statesync/syncer.go +++ b/statesync/syncer.go @@ -489,6 +489,8 @@ func (s *syncer) requestChunk(snapshot *snapshot, chunk uint32) { // verifyApp verifies the sync, checking the app hash, last block height and app version func (s *syncer) verifyApp(snapshot *snapshot, appVersion uint64) error { + // XXX Is it okay to check with "ABCI.Info" only + // since AppVersion will be updated by "ABCI.InitChain" and "ABCI.EndBlock"? resp, err := s.connQuery.InfoSync(proxy.RequestInfo) if err != nil { return fmt.Errorf("failed to query ABCI app for appHash: %w", err) @@ -497,7 +499,7 @@ func (s *syncer) verifyApp(snapshot *snapshot, appVersion uint64) error { // sanity check that the app version in the block matches the application's own record // of its version if resp.AppVersion != appVersion { - // An error here most likely means that the app hasn't inplemented state sync + // An error here most likely means that the app hasn't implemented state sync // or the Info call correctly return fmt.Errorf("app version mismatch. Expected: %d, got: %d", appVersion, resp.AppVersion)