Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
David20240718 committed Nov 5, 2024
1 parent c4a95c6 commit 49c00e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ public async Task<List<ExecutionReturnSet>> ExecuteAsync(TransactionExecutingDto
var returnSetCollection = new ExecutionReturnSetCollection(returnSets);
var updatedPartialBlockStateSet = GetUpdatedBlockStateSet(returnSetCollection, transactionExecutingDto);

Logger.LogTrace("Entered ExecuteNonParallelizableTransactionsAsync.");
Logger.LogInformation("Entered ExecuteNonParallelizableTransactionsAsync.");
var nonParallelizableReturnSets = await ExecuteNonParallelizableTransactionsAsync(
groupedTransactions.NonParallelizables, blockHeader,
updatedPartialBlockStateSet, cancellationToken);
Logger.LogTrace("Entered ExecuteNonParallelizableTransactionsAsync. end");
Logger.LogInformation("Entered ExecuteNonParallelizableTransactionsAsync. end");

returnSets.AddRange(nonParallelizableReturnSets);

var transactionWithoutContractReturnSets = ProcessTransactionsWithoutContract(
groupedTransactions.TransactionsWithoutContract);

Logger.LogTrace("Merged results from transactions without contract.");
Logger.LogInformation("Merged results from transactions without contract.");
returnSets.AddRange(transactionWithoutContractReturnSets);

if (conflictingSets.Count > 0 &&
Expand Down Expand Up @@ -169,7 +169,7 @@ private async Task<List<ExecutionReturnSet>> ExecuteNonParallelizableTransaction
},
cancellationToken);

Logger.LogTrace("Merged results from non-parallelizables.");
Logger.LogInformation("Merged results from non-parallelizables.");
return nonParallelizableReturnSets;
}

Expand Down
5 changes: 5 additions & 0 deletions src/AElf.Kernel/Miner/Application/MiningService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ public async Task<BlockExecutedSet> MineAsync(RequestMiningDto requestMiningDto,
{
using var cts = new CancellationTokenSource();
var expirationTime = blockTime + requestMiningDto.BlockExecutionTime;
Logger.LogInformation(" MineAsync expirationTime : {expirationTime}");
Logger.LogInformation(" MineAsync BlockExecutionTime : {requestMiningDto.BlockExecutionTime}");
Logger.LogInformation(" MineAsync blockTime : {blockTime}");

if (expirationTime < TimestampHelper.GetUtcNow())
{
cts.Cancel();
Expand All @@ -57,6 +61,7 @@ public async Task<BlockExecutedSet> MineAsync(RequestMiningDto requestMiningDto,
{
var ts = (expirationTime - TimestampHelper.GetUtcNow()).ToTimeSpan();
if (ts.TotalMilliseconds > int.MaxValue) ts = TimeSpan.FromMilliseconds(int.MaxValue);
Logger.LogInformation(" MineAsync ts time: {ts}");

cts.CancelAfter(ts);
}
Expand Down

0 comments on commit 49c00e8

Please sign in to comment.