Skip to content

Commit

Permalink
Add the comment about checking "AppVersion" in "verifyApp"
Browse files Browse the repository at this point in the history
  • Loading branch information
tnasu committed Dec 15, 2022
1 parent 870eb70 commit ecc23f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion statesync/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit ecc23f4

Please sign in to comment.