Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions process/sync/baseSync.go
Original file line number Diff line number Diff line change
Expand Up @@ -2025,6 +2025,11 @@ func (boot *baseBootstrap) restoreState(

boot.chainHandler.SetCurrentBlockHeaderHash(currHeaderHash)

// for legacy (non-V3) headers, keep last executed block header in sync with current block header
if check.IfNil(currHeader) || !currHeader.IsHeaderV3() {
boot.chainHandler.SetLastExecutedBlockHeaderAndRootHash(currHeader, currHeaderHash, currRootHash)
}

err = boot.scheduledTxsExecutionHandler.RollBackToBlock(currHeaderHash)
if err != nil {
scheduledInfo := &process.ScheduledInfo{
Expand Down Expand Up @@ -2055,6 +2060,11 @@ func (boot *baseBootstrap) setCurrentBlockInfo(

boot.chainHandler.SetCurrentBlockHeaderHash(headerHash)

// for legacy (non-V3) headers, keep last executed block header in sync with current block header
if check.IfNil(header) || !header.IsHeaderV3() {
boot.chainHandler.SetLastExecutedBlockHeaderAndRootHash(header, headerHash, rootHash)
}

return nil
}

Expand Down
2 changes: 2 additions & 0 deletions process/sync/storageBootstrap/baseStorageBootstrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,8 @@ func (st *storageBootstrapper) restoreBlockChainToGenesis() {
}

st.blkc.SetCurrentBlockHeaderHash(nil)
// keep last executed block header in sync when reverting to genesis
st.blkc.SetLastExecutedBlockHeaderAndRootHash(nil, nil, nil)
}

func checkBaseStorageBootstrapperArguments(args ArgsBaseStorageBootstrapper) error {
Expand Down
Loading