File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -309,11 +309,14 @@ func (s *Syncer) initializeState() error {
309309 if s .config .P2P .TrustedHeight > 0 {
310310 s .logger .Info ().Uint64 ("trusted_height" , s .config .P2P .TrustedHeight ).Msg ("initializing state from trusted height" )
311311
312- // Load and verify the trusted header
313- trustedHeader , err := s .store .GetHeader (s .ctx , s .config .P2P .TrustedHeight )
312+ // Load and verify the trusted header from the P2P header store.
313+ // The header is fetched via P2P and stored in the StoreAdapter's pending cache,
314+ // so we must use headerStore.GetByHeight() which checks both the main store and pending cache.
315+ p2pHeader , err := s .headerStore .GetByHeight (s .ctx , s .config .P2P .TrustedHeight )
314316 if err != nil {
315317 return fmt .Errorf ("failed to load trusted header at height %d: %w" , s .config .P2P .TrustedHeight , err )
316318 }
319+ trustedHeader := p2pHeader .SignedHeader
317320
318321 // Initialize new chain state from the trusted header
319322 stateRoot , initErr := s .exec .InitChain (
You can’t perform that action at this time.
0 commit comments