@@ -267,6 +267,8 @@ func (s *Service) handleCodeSubstitution(hash common.Hash) error {
267267 return err
268268 }
269269
270+ // TODO: this needs to create a new runtime instance, otherwise it will update
271+ // the blocks that reference the current runtime version to use the code substition
270272 err = rt .UpdateRuntimeCode (code )
271273 if err != nil {
272274 return err
@@ -307,16 +309,17 @@ func (s *Service) handleCurrentSlot(header *types.Header) error {
307309// does not need to be completed before the next block can be imported.
308310func (s * Service ) handleBlocksAsync () {
309311 for {
312+ prev := s .blockState .BestBlockHash ()
313+
310314 select {
311315 case block := <- s .blockAddCh :
312316 if block == nil {
313317 continue
314318 }
315319
316- // TODO: add inherent check
317- // if err := s.handleChainReorg(prev, block.Header.Hash()); err != nil {
318- // logger.Warn("failed to re-add transactions to chain upon re-org", "error", err)
319- // }
320+ if err := s .handleChainReorg (prev , block .Header .Hash ()); err != nil {
321+ logger .Warn ("failed to re-add transactions to chain upon re-org" , "error" , err )
322+ }
320323
321324 if err := s .maintainTransactionPool (block ); err != nil {
322325 logger .Warn ("failed to maintain transaction pool" , "error" , err )
@@ -422,12 +425,11 @@ func (s *Service) maintainTransactionPool(block *types.Block) error {
422425 // re-validate transactions in the pool and move them to the queue
423426 txs := s .transactionState .PendingInPool ()
424427 for _ , tx := range txs {
425- // TODO: re-add this on update to v0.8
426-
428+ // TODO: re-add this
427429 // val, err := s.rt.ValidateTransaction(tx.Extrinsic)
428430 // if err != nil {
429431 // // failed to validate tx, remove it from the pool or queue
430- // s.transactionState.RemoveExtrinsic(ext )
432+ // s.transactionState.RemoveExtrinsic(tx.Extrinsic )
431433 // continue
432434 // }
433435
0 commit comments