diff --git a/dot/core/service.go b/dot/core/service.go index c5ec6bf35a..e9e8f2261f 100644 --- a/dot/core/service.go +++ b/dot/core/service.go @@ -381,21 +381,21 @@ func (s *Service) maintainTransactionPool(block *types.Block) { s.transactionState.RemoveExtrinsic(ext) } + //// get the best block corresponding runtime + bestBlockHash := s.blockState.BestBlockHash() + stateRoot, err := s.storageState.GetStateRootFromBlock(&bestBlockHash) + if err != nil { + logger.Errorf("could not get state root from block %s: %w", bestBlockHash, err) + } + + ts, err := s.storageState.TrieState(stateRoot) + if err != nil { + logger.Errorf(err.Error()) + } + // re-validate transactions in the pool and move them to the queue txs := s.transactionState.PendingInPool() for _, tx := range txs { - //// get the best block corresponding runtime - bestBlockHash := s.blockState.BestBlockHash() - stateRoot, err := s.storageState.GetStateRootFromBlock(&bestBlockHash) - if err != nil { - logger.Errorf("could not get state root from block %s: %w", bestBlockHash, err) - } - - ts, err := s.storageState.TrieState(stateRoot) - if err != nil { - logger.Errorf(err.Error()) - } - rt, err := s.blockState.GetRuntime(&bestBlockHash) if err != nil { logger.Warnf("failed to get runtime to re-validate transactions in pool: %s", err) @@ -411,7 +411,6 @@ func (s *Service) maintainTransactionPool(block *types.Block) { txnValidity, err := rt.ValidateTransaction(externalExt) if err != nil { // hitting this case on old runtime - fmt.Println(err.Error()) s.transactionState.RemoveExtrinsic(tx.Extrinsic) continue }