From 23daa74712708c826517925515dd5120d5e33594 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Thu, 28 Sep 2023 13:40:28 +0200 Subject: [PATCH] remove app version check in state sync --- statesync/syncer.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/statesync/syncer.go b/statesync/syncer.go index aeb58677d7..b12adba9fb 100644 --- a/statesync/syncer.go +++ b/statesync/syncer.go @@ -306,7 +306,7 @@ func (s *syncer) Sync(snapshot *snapshot, chunks *chunkQueue) (sm.State, *types. } // Verify app and app version - if err := s.verifyApp(snapshot, state.Version.Consensus.App); err != nil { + if err := s.verifyApp(snapshot); err != nil { return sm.State{}, nil, err } @@ -482,20 +482,12 @@ 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 { +func (s *syncer) verifyApp(snapshot *snapshot) error { resp, err := s.connQuery.InfoSync(proxy.RequestInfo) if err != nil { return fmt.Errorf("failed to query ABCI app for appHash: %w", err) } - // 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 - // or the Info call correctly - return fmt.Errorf("app version mismatch. Expected: %d, got: %d", - appVersion, resp.AppVersion) - } if !bytes.Equal(snapshot.trustedAppHash, resp.LastBlockAppHash) { s.logger.Error("appHash verification failed", "expected", snapshot.trustedAppHash,