@@ -111,15 +111,10 @@ func runE(*cobra.Command, []string) error {
111111
112112 // remove chunk data packs first, because otherwise the index to find chunk data pack will be removed.
113113 if len (chunkIDs ) > 0 {
114- chunkDataPackIDs , err := chunkDataPacks .BatchRemove (chunkIDs , protocolDBBatch )
114+ _ , err := chunkDataPacks .BatchRemove (chunkIDs , protocolDBBatch )
115115 if err != nil {
116116 return fmt .Errorf ("could not remove chunk data packs at %v: %w" , flagHeight , err )
117117 }
118-
119- err = storedChunkDataPacks .Remove (chunkDataPackIDs )
120- if err != nil {
121- return fmt .Errorf ("could not commit chunk batch at %v: %w" , flagHeight , err )
122- }
123118 }
124119
125120 err = protocolDBBatch .Commit ()
@@ -143,8 +138,11 @@ func runE(*cobra.Command, []string) error {
143138 })
144139}
145140
146- // use badger instances directly instead of stroage interfaces so that the interface don't
147- // need to include the Remove methods
141+ // removeExecutionResultsFromHeight removes all execution results and related data
142+ // from the specified block height onward to roll back the protocol state.
143+ // It returns the chunk IDs removed from the protocol state DB,
144+ // which can then be used to delete the corresponding chunk data packs from chunk
145+ // data pack database.
148146func removeExecutionResultsFromHeight (
149147 protocolDBBatch storage.Batch ,
150148 protoState protocol.State ,
0 commit comments