public async Task MarkUnparallelizableAsync(IChainContext chainContext, Address contractAddress) { if (_smartContractExecutiveService.IsContractDeployOrUpdating(contractAddress)) { return; } await MarkAsync(chainContext, contractAddress, true); }
private async Task <(Transaction, TransactionResourceInfo)> GetResourcesForOneWithCacheAsync( IChainContext chainContext, Transaction transaction, CancellationToken ct) { if (ct.IsCancellationRequested || _smartContractExecutiveService.IsContractDeployOrUpdating(transaction.To)) { return(transaction, new TransactionResourceInfo() { TransactionId = transaction.GetHash(), ParallelType = ParallelType.NonParallelizable }); } if (_resourceCache.TryGetValue(transaction.GetHash(), out var resourceCache)) { return(transaction, resourceCache.ResourceInfo); } return(transaction, await GetResourcesForOneAsync(chainContext, transaction, ct)); }